scverse / pytometry

Flow & mass cytometry analytics.

Home Page:https://pytometry.readthedocs.io/en/latest/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Write fcs function

mbuttner opened this issue · comments

Pytometry should include a function to export an anndata file to fcs using the Gating ML 2.0 version and FCS standard 3.*

In scyan, there is this write_fcs function that we could move to pytometry
But it uses fcswrite internally, and it seems this repository is not actively maintained, what do you think?

EDIT: we can also add this write_csv function, since FlowJO supports reading from CSV files

A couple points from the discussion in scverse/governance#64:

  • There was some agreement that it makes sense to keep IO separate from the rest in readfcs. I'm sure they would be happy to include functions for writing FCS filese
  • Here it could make sense to either switch to @whitews's FlowIO package or use it as another backend in readfcs.
adata = readfcs.read("sample.fcs", backend="fcsparser")
adata = readfcs.read("sample.fcs", backend="flowio")
readfcs.write(adata, "sample.fcs", backend="flowio")
  • Or maybe to add support for AnnData directly in FlowIO?
pip install flowio[anndata]
adata = flowio.FlowData('sample.fcs').to_anndata()