cycombinepy.io.read_fcs_dir¶
- cycombinepy.io.read_fcs_dir(data_dir, pattern='*.fcs', metadata=None, filename_col='filename', sample_key=None, batch_key=None, condition_key=None, anchor_key=None, markers=None, transform=True, cofactor=5.0, derand=True, downsample=None, sampling_type='random', seed=None)[source]¶
Read all FCS files in
data_dirinto a single AnnData.Mirrors
compile_fcs+convert_flowset+prepare_datafromR/01_prepare_data.R. Metadata (a DataFrame or a CSV/Excel path) is joined on the basename of each FCS file viafilename_col. Its columns are renamed tobatch/sample/condition/anchorif the corresponding*_keyargument points at them.- Parameters:
pattern (
str) – Glob pattern for selecting files.metadata (
DataFrame|str|PathLike|None) – DataFrame or path to a CSV/TSV/XLSX table. Must containfilename_colmatching the FCS basenames.filename_col (
str) – Column inmetadataholding the FCS filenames.anchor_key (
str|None) – Columns ofmetadatato use forsample/batch/condition/anchorrespectively. Resultingadata.obswill use those canonical names.markers (
Optional[Iterable[str]]) – Restrict to these var_names after loading (optional).transform (
bool) – If True, applycycombinepy.transform_asinh()withcofactor.cofactor (
float) – Forwarded totransform_asinh.derand (
bool) – Forwarded totransform_asinh.downsample (
int|None) – If given, downsample each unit (defined bysampling_type) to this many cells.sampling_type (
Literal['random','per_batch','per_sample']) – How to downsample: uniformly at random, or per batch / per sample.sample_key (str | None)
batch_key (str | None)
condition_key (str | None)
- Return type: