FCS (.fcs, .lmd)

  • Import supports most popular variants of the FCS file format, including Versions 2.0, 3.0, and 3.1 with events stored as 8-, 16-, 24-, 32-, 64-, and 128-bit integers or 32- and 64-bit reals.
  • Export generates FCS3.1 files.
  • Background

      FCS molecular biology format.
      Standard format for storing and exchanging flow cytometry data.
      Mixed ASCII/binary format.
      Stores signal intensities for cell events as an array.
      Meta-information about the data acquisition is stored in the file.

    Import and Export

    • Import["file.fcs"] returns an array representing the cellular events stored in the file.
    • Export["file.fcs",{paramnames,events}] exports a list of parameter names and an array of events to the FCS format.
    • Export["file.fcs",{paramnames,paramreagents,events}] exports a list of parameter names, a list of parameter reagents, and an array of events to the FCS format.
    • Import["file.fcs",elem] imports the specified element from an FCS file.
    • Import["file.fcs",{{elem1,elem2,}}] imports multiple elements.
    • The import format can be specified with Import["file","FCS"] or Import["file",{"FCS",elem,}].
    • Export["file.fcs",{expr1,expr2,},{{elem1,elem2,}}] treats each expri as specifying the corresponding elemi.
    • Export["file.fcs",expr,opt1->val1,] exports expr with the specified option elements taken to have the specified values.
    • Export["file.fcs",{elem1->expr1,elem2->expr2,},"Rules"] uses rules to specify the elements to be exported.
    • See the reference pages for full general information on Import and Export.
    • ImportString and ExportString support the FCS format.

    Elements

    • General Import elements:
    • "Elements"list of elements and options available in this file
      "Rules"full list of rules for each element and option
      "Options"list of rules for options, properties, and settings
    • File metadata:
    • "Header"raw file header given as a list of rules
    • Data representation elements:
    • "Events"cellular events as an array
      "ParameterName"parameter names as a list of rules (import) or a list (export)
      "ParameterReagent"parameter reagents as a list of rules (import) or a list (export)
    • Additional data elements:
    • "Data"cellular events as an array
      "LabeledData"list of rules for data stored in the file
    • Import uses the "Events" element by default for the FCS format.
    • Export requires at least a list of parameter names and an array of events.
    • Export can optionally take a list of parameter reagents. All other optional keys must be specified via the "OptionalKeys" option.

    Options

    • Advanced Export options:
    • "DataType"Automaticdata type used to encode events
      "OptionalKeys"{}optional keys to include in the header, as a list of rules
    • The Wolfram Language attempts to identify the most compact format in which the events can be encoded. Automatic data type identification may be overridden via the "DataType" option.
    • Valid settings for "DataType" are:
    • "UnsignedInteger8"8-bit unsigned integer
      "UnsignedInteger16"16-bit unsigned integer
      "UnsignedInteger24"24-bit unsigned integer
      "UnsignedInteger32"32-bit unsigned integer
      "Real32"IEEE single-precision real number
      "Real64"IEEE double-precision real number
    • The Wolfram Language will automatically overwrite certain protected keys (such as "$BEGINDATA" and "$BYTEORD") that are specified in "OptionalKeys". Thus, if you are re-exporting an imported FCS file, you may directly set "OptionalKeys" to the value of the "Header" element from the imported FCS file. Parameter reagents ($PnS keys) will be removed from "OptionalKeys" only if parameter reagents are provided in the main Export expression.

    Examples

    open allclose all

    Basic Examples  (7)

    Read the file header from a sample FCS file:

    In[1]:=
    Click for copyable input
    Out[1]//Short=

    Read the parameter names and reagents:

    In[1]:=
    Click for copyable input
    Out[1]=

    Read events and display the first several in a table:

    In[1]:=
    Click for copyable input
    Out[1]//TableForm=

    Export an array of event values with parameter names:

    In[1]:=
    Click for copyable input
    Out[1]=

    Specify a data type to use when exporting:

    In[1]:=
    Click for copyable input
    Out[1]=

    Export an array of event values with parameter names and parameter reagents:

    In[1]:=
    Click for copyable input
    Out[1]=

    Export a version of a data file with the same header, but with a small subset of the events:

    In[1]:=
    Click for copyable input
    In[2]:=
    Click for copyable input
    Out[2]=

    Scope  (6)

    See Also

    "MOL"  "PDB"  "XYZ"

    Introduced in 2012
    (9.0)