FACSPy.dt.create_dataset

Contents

FACSPy.dt.create_dataset#

FACSPy.dt.create_dataset(metadata, panel, workspace, input_directory=None, subsample_fcs_to=None, truncate_max_range=True, keep_raw=False)#

Creates the dataset.

Parameters:
  • metadata (Metadata) – The metadata object of Metadata

  • panel (Panel) – The panel object of Panel

  • workspace (Union[FlowJoWorkspace, DivaWorkspace]) – The accompanying workspace of FlowJoWorkspace

  • input_directory (Optional[str]) – path that points to the FCS files. If no input directory is specified, the current working directory is assumed.

  • subsample_fcs_to (Optional[int]) – Parameter that specifies how many cells of an FCS file are read. Per default, all cells are read in

  • truncate_max_range (bool) – Parameter that controls if the FCS-File data should be truncated to their pnr value. Defaults to True.

  • keep_raw (bool) – Whether to keep the raw, uncompensated events. Defaults to False.

Return type:

The dataset object of AnnData

Examples

>>> import FACSPy as fp
>>> metadata = fp.dt.Metadata("metadata.csv") # creates the Metadata object
>>> panel = fp.dt.Panel("panel.csv") # creates the Panel object
>>> # alternatively, if the panel is stored in the FCS files:
>>> panel = fp.create_panel_from_fcs() # assumes that FCS files are in the current working directory
>>> workspace = fp.dt.FlowJoWorkspace("workspace.wsp") # creates the FlowJoWorkspace object
>>> dataset = fp.create_dataset(
...    panel = panel,
...    metadata = metadata,
...    workspace = workspace,
...    subsample_fcs_to = 10_000,
...    truncate_max_range = True,
...    keep_raw = False
... )
>>> dataset
AnnData object with n_obs × n_vars = 615936 × 22
obs: 'sample_ID', 'file_name', 'condition'
var: 'pns', 'png', 'pne', 'pnr', 'type', 'pnn'
uns: 'metadata', 'panel', 'workspace', 'gating_cols', 'dataset_status_hash'
obsm: 'gating'
layers: 'compensated'

Notes

See further explanation about the created dataset in the following tutorials: The FACSPy dataset: Structure