sccloud.de_analysis¶
-
sccloud.de_analysis(data, cluster, condition=None, subset=None, result_key='de_res', n_jobs=-1, auc=True, t=True, fisher=False, mwu=False, temp_folder=None, verbose=True)[source]¶ Perform Differential Expression (DE) Analysis on data.
- Parameters
data (
anndata.AnnData) – Annotated data matrix with rows for cells and columns for genes.cluster (
str) – Cluster labels used in DE analysis. Must exist indata.obs.condition (
str, optional, default:None) – Sample attribute used as condition in DE analysis. IfNone, no condition is considered; otherwise, must exist indata.obs.subset (
str, optional, default:None) – Perform DE analysis on only a subset of cluster IDs. Cluster ID subset is specified as"clust_id1,clust_id2,...,clust_idn", where all IDs must exist indata.obs[cluster].result_key (
str, optional, default:"de_res") – Key name of DE analysis result stored.n_jobs (
int, optional, default:-1) – Number of threads to use. If-1, use all available threads.auc (
bool, optional, default:True) – IfTrue, calculate area under ROC (AUROC) and area under Precision-Recall (AUPR).t (
bool, optional, default:True) – IfTrue, calculate Welch’s t test.fisher (
bool, optional, default:False) – IfTrue, calculate Fisher’s exact test.mwu (
bool, optional, default:False) – IfTrue, calculate Mann-Whitney U test.temp_folder (
str, optional, default:None) – Joblib temporary folder for memmapping numpy arrays.verbose (
bool, optional, default:True) – IfTrue, show detailed intermediate output.
- Return type
None- Returns
NoneUpdate
data.varm–data.varm[result_key]: DE analysis result.
Examples
>>> scc.de_analysis(adata, cluster = 'spectral_leiden_labels')
subset: a comma-separated list of cluster labels. Then de will be performed only on these subsets.