LARRY Dataset#
Lineage tracing data from Weinreb et al. (Science, 2020), in which barcoded hematopoietic progenitors are profiled across three timepoints, allowing observed clonal fate to be compared against predicted fate.
import scdiffeq as sdq
adata = sdq.datasets.larry()
See Datasets and data sources for where files are cached and what to cite.
Variants#
Two variants are available, and the difference between them matters:
|
Shape |
|
Description |
|---|---|---|---|
|
130,887 × 2,492 |
included |
The biology-rich object. Already gene-filtered, and ships precomputed
|
|
130,887 × 25,289 |
not included |
The upstream input, before gene filtering. Carries a |
# default: ships its own X_pca
adata = sdq.datasets.larry()
# the unprocessed input; X_pca is computed during preprocessing
adata = sdq.datasets.larry(variant="unprocessed")
Deprecated since version 1.1.1: variant="fate_prediction" is deprecated in favour of
variant="unprocessed". The old name still works and emits a
DeprecationWarning.
The rename corrects a misleading name. That variant’s upstream filename is
adata.Weinreb2020.in_vitro.gene_filtered.h5ad, but the object it contains is
the unfiltered one – the gene_filtered name refers to the presence of the
filtering metadata, not to filtering having been applied. Reading it as
“already gene-filtered” led to the reasonable but incorrect expectation that it
would carry a precomputed X_pca.
Preprocessing#
With default arguments, larry() annotates the object with
precomputed CytoTRACE values, filters genes on var["use_genes"], then scales
and runs a 50-component PCA:
adata = sdq.datasets.larry(
filter_genes=True, # subset to var["use_genes"]
reduce_dimensions=True, # StandardScaler + PCA(50, random_state=0)
cytotrace=True, # merge precomputed CytoTRACE annotations
)
Each flag is independent; cytotrace=True is honoured even when the other two
are disabled. Non-default combinations are cached separately, so
reduce_dimensions=False does not overwrite the default cache.
The CytoTRACE annotations are keyed to the gene-filtered gene set, so on the
"unprocessed" variant they cover 2,492 of its 25,289 genes; the remainder are
NaN. This is expected, not an error.
API#
- scdiffeq.datasets._larry_in_vitro.larry(data_dir: str = '/home/runner/work/scDiffEq/scDiffEq/docs/source', variant: str | None = None, filter_genes: bool = True, reduce_dimensions: bool = True, cytotrace: bool = True, force_download: bool = False, force_preprocess: bool = False) AnnData[source]#
LARRY in vitro dataset
The raw download and the preprocessed result are cached as separate files, so a dataset obtained by any means (including a manual download) is still preprocessed on first use.
- Parameters:
data_dir – str, default=os.getcwd() Path to the directory where the data will be saved.
variant –
Optional[str], default=None Dataset variant.
None(default) is the biology-rich object: 130,887 x 2,492, already gene-filtered, shipping a precomputedX_pca,X_umapandX_scaled."unprocessed"is the upstream input: 130,887 x 25,289 with noX_pca, carrying ause_genescolumn that preprocessing filters by (down to 2,447 genes).X_pcais computed locally, or downloaded prebuilt when available.variant="fate_prediction"is a deprecated alias for"unprocessed"and will be removed in a future release. Despite its upstream filename (...in_vitro.gene_filtered.h5ad), that object is the unfiltered one.filter_genes – bool, default=True Whether to subset to
adata.var['use_genes']. A no-op for variants that are already gene-filtered.reduce_dimensions – bool, default=True Whether to scale and run PCA (50 components,
random_state=0).cytotrace – bool, default=True Whether to annotate with precomputed CytoTRACE values. Applied independently of the other preprocessing flags.
force_download – bool, default=False Re-download the raw file and regenerate the processed file.
force_preprocess – bool, default=False Regenerate the processed file from the cached raw file without re-downloading it.
- Returns:
Preprocessed AnnData object.
- Return type: