sccoda.util.cell_composition_data.read_anndata_one_sample¶
-
sccoda.util.cell_composition_data.
read_anndata_one_sample
(adata, cell_type_identifier, covariate_key=None)¶ Converts a single scRNA-seq data set from scanpy (anndata format) to a row of a cell count matrix.
It is assumed that a column of adata.obs (e.g. Louvain clustering results) contains the cell type assignment. Additionally, covariates (control/disease group, …) can be specified as a subdict in adata.uns
Usage:
cell_counts, covs = from_scanpy(adata, cell_type_identifier="Louvain", covariate_key="covariates")
- Parameters
- Return type
- Returns
A numpy array for the cell counts and a dict for the covariates
cell_counts – cell count vector
covs – covariate dictionary