cellpin.pp.setup_data#
- cellpin.pp.setup_data(sc_adata, st_adata, gene_symbols=None, layer=None, batch_key=None, table_key='table')#
Prepare aligned single-cell and spatial datasets for cellpin.
- Return type:
- Args:
- sc_adata: Reference scRNA-seq AnnData. Its gene space becomes the
imputation target.
st_adata: Spatial AnnData (or SpatialData). Its genes define the panel. gene_symbols: Name of a
varcolumn holding alternative geneidentifiers (e.g. human-readable symbols when
var_namesare Ensembl IDs). WhenNone,var_namesare used directly.- layer: Expression layer to read. Must contain raw counts (non-negative
integers) — required by the NB/ZINB generative model. When
None,.Xis used.- batch_key:
obscolumn insc_adatafor batch conditioning. When None, batch correction is disabled.- table_key: Only relevant when
st_adatais aSpatialDataobject; specifies which table to read from
sdata.tables.
- Returns:
Tuple of
(scAnnDataset, stAnnDataset)— aligned datasets ready to pass toCellPin.- Raises:
- ValueError: If gene names contain duplicates, no overlapping genes are
found, or internal alignment invariants are violated.