scparadise.scnoah.undersample#
- scparadise.scnoah.undersample(adata, dictionary=None, celltype=None)[source]#
Undersample some cell types in AnnData object. Returns subsetted adata_undersampled object.
- Parameters:
adata (AnnData) – Annotated data matrix.
dictionary (dict, (default: None)) – Dictionary with cell type to be undersampled as key and number of cells you want to get as value. Dictionary should only include cell types from the most detailed level of annotation.
celltype (str, (default: None)) – Level of cell annotation used in dictionary. Key in adata.obs dataframe.