spamosaic.preprocessing.RNA_preprocess
- spamosaic.preprocessing.RNA_preprocess(rna_ads, batch_corr=False, favor='adapted', n_hvg=5000, lognorm=True, scale=False, n_comps=50, batch_key='src', key='dimred_bc', return_hvf=False)[source]
Preprocessing pipeline for RNA modality.
- Parameters:
rna_ads (list of AnnData) – RNA modality per batch.
batch_corr (bool) – Whether to perform batch correction.
favor ({'adapted', 'scanpy'}) – Which pipeline to use.
n_hvg (int) – Number of highly variable genes.
lognorm (bool) – Whether to apply log-normalization.
scale (bool) – Whether to scale features.
n_comps (int) – Number of output components.
batch_key (str) – Key in
.obsindicating batch identity.key (str) – Key to store result in
.obsm.return_hvf (bool) – If
True, return indices of selected HVGs.
- Returns:
If
return_hvfisTrue, returns (gene_names, indices); otherwiseNone.- Return type:
Optional[Tuple[np.ndarray, np.ndarray]]