FlowCytometryTools.FCPlate.from_files

classmethod FCPlate.from_files(ID, datafiles, parser='name', position_mapper=None, readdata_kwargs={}, readmeta_kwargs={}, ID_kwargs={}, **kwargs)

Create an OrderedCollection of measurements from a set of data files.

ID : hashable
Collection ID
datafiles : str | iterable
A set of data files containing the measurements.

parser : [‘name’ | ‘number’ | ‘read’ | mapping | callable]

Extracts a key from a filename.

Later, this key is used by the position mapper to determine the location of the measurement in the measurement collection.

  • ‘name’ : Use the measurement name given in the file name.
    For example, ‘[whatever]_Well_C9_[blah].fcs’ will get key ‘C9’. The filename must look exactly like the template above.
  • ‘number’ : Use the number given in the file name.
    For example, ‘[some name].001.fcs’ will get key 001. The filename must look exactly like the template above.
  • ‘read’ : Use the measurement ID specified in the metadata.
  • mapping : mapping (dict-like) from datafiles to keys.
  • callable : takes datafile name and returns key.

position_mapper : [None, callable, mapping, ‘name’, ‘row_first_enumerator’, ‘col_first_enumerator’]

Returns the coordinates (row, col) which correspond to the key. (The key is the key extracted from the filename by the parser.)

For example, the key ‘A1’ corresponds to the matrix coordinates (0, 0).

  • None : if None, then uses the same value as the parser
  • callable : gets key and returns position
  • mapping : key:pos
  • ‘name’ : parses things like ‘A1’, ‘G12’
  • ‘row_first_enumerator’, ‘name’ : converts number to positions, going over rows first
  • ‘col_first_enumerator’ : converts number to positions, going over columns first.
ID_kwargs: dict
Additional parameters to be used when assigning IDs. Passed to ‘_assign_IDS_to_datafiles’ method.
kwargs : dict
Additional key word arguments to be passed to constructor.