scparadise.scnoah.balance

Contents

scparadise.scnoah.balance#

scparadise.scnoah.balance(adata, sample=None, celltype_l1=None, celltype_l2=None, celltype_l3=None, celltype_l4=None, celltype_l5=None, shrinkage=1)[source]#

Balance cell types in AnnData object. Returns adata_balanced with updated matrix and adata_balanced.obs with given celltypes levels and sample. If you give counts function returns counts. If you give normalized data function returns normalized data.

Parameters:
  • adata (AnnData) – Annotated data matrix. Function uses adata.X for oversample.

  • sample (str, (default: None)) – Samples names key in adata.obs dataframe.

  • celltype_l1 (str, (default: None)) – First level of cell annotation. Key in adata.obs dataframe.

  • celltype_l2 (str, (default: None)) – Second level of cell annotation. Key in adata.obs dataframe.

  • celltype_l3 (str, (default: None)) – Third level of cell annotation. Key in adata.obs dataframe.

  • celltype_l4 (str, (default: None)) – Forth level of cell annotation. Key in adata.obs dataframe.

  • celltype_l5 (str, (default: None)) – Fifth level of cell annotation. Key in adata.obs dataframe.

  • shrinkage (float, (default: 1.0)) – Parameter controlling the shrinkage applied to the covariance matrix when a smoothed bootstrap is generated.