dotools_py.tl.run_mast

Contents

dotools_py.tl.run_mast#

dotools_py.tl.run_mast(adata, cond_key, reference, disease, covariates=None)[source]#

Run MAST Test for sc/snRNAseq.

Parameters:
adata AnnData

Annotated Data matrix.

cond_key str

Metadata column in obs with condition groups.

reference str

Reference condition.

disease str | list

Disease conditions.

covariates str | list | None (default: None)

Extra covariates to account for.

Return type:

DataFrame

Returns:

Returns a DataFrame. The following fields are included:

GeneName

Name of the genes

pvals and padj

The adjusted p-value uses Benjamini-Hochberg correction method.

log2fc

Log2FoldChamge

pts_ref and pts_group

Percentage of cells in the reference in the disease group expressing the gene

groups

Column containing the group tested

See also

dotools_py.tl.rank_genes_groups()

run DEA at single-cell level

dotools_py.tl.grouped_ttest()

run DEA at pseudobulk level

Example

>>> import dotools_py as do
>>> adata = do.dt.example_10x_processed()
>>> df = do.tl.run_mast(adata, "condition", "healthy", "disease")
>>> df.head(5)
      GeneName     pvals    log2fc      padj   pts_ref  pts_group   groups
0   A4GALT  0.001722 -1.018231  0.015546  0.003846   0.000000  disease
1     AAK1  0.019197  0.517996  0.105754  0.457692   0.516667  disease
2     ABAT  0.551787  1.530515  0.842536  0.000000   0.000000  disease
3    ABCB4  0.581264 -1.968762  0.842536  0.176923   0.050000  disease
4    ABCB9  0.458918 -1.468043  0.808238  0.121154   0.044444  disease