cytoflow.views.export_fcs

class cytoflow.views.export_fcs.ExportFCS[source]

Bases: traits.has_traits.HasStrictTraits

Exports events as FCS files.

This isn’t a traditional view, in that it doesn’t implement plot(). Instead, use enum_files() to figure out which files will be created from a particular experiment, and export() to export the FCS files.

The Cytoflow attributes will be encoded in keywords in the FCS TEXT segment, starting with the characters CF_. Any FCS keywords that are the same across all the input files will also be included.

base

The prefix of the FCS filenames

Type:Str
path

The directory to export to.

Type:Directory
by

A list of conditions from conditions; each unique combination of conditions will be exported to an FCS file.

Type:List(Str)
keywords

If you want to add more keywords to the FCS files’ TEXT segment, specify them here.

Type:Dict(Str, Str)
subset

A Python expression used to select a subset of the data

Type:str

Examples

Make a little data set.

>>> import cytoflow as flow
>>> import_op = flow.ImportOp()
>>> import_op.tubes = [flow.Tube(file = "Plate01/RFP_Well_A3.fcs",
...                              conditions = {'Dox' : 10.0}),
...                    flow.Tube(file = "Plate01/CFP_Well_A4.fcs",
...                              conditions = {'Dox' : 1.0})]
>>> import_op.conditions = {'Dox' : 'float'}
>>> ex = import_op.apply()

Export the data

>>> import tempfile
>>> flow.ExportFCS(path = 'export/',
...                by = ["Dox"],
...                subset = "Dox == 10.0").export(ex)
enum_files(experiment)[source]

Return an iterator over the file names that this export module will produce from a given experiment.

Parameters:experiment (Experiment) – The Experiment to export
export(experiment)[source]

Export FCS files from an experiment.

Parameters:experiment (Experiment) – The Experiment to export