snapatac2.tl.marker_regions#
- snapatac2.tl.marker_regions(data, groupby, pvalue=0.01)[source]#
Select marker regions for each group by z-score enrichment.
Use this lightweight screen to obtain candidate group-specific regions from aggregated accessibility before running more formal differential tests.
Anti-Patterns#
Do NOT treat these markers as regression-adjusted differential results; use
diff_testfor hypothesis testing between two cell groups.Do NOT pass a grouping key that is absent from
data.obs.
- param data:
Annotated data object with regions in
.var_namesand counts in.X.- type data:
AnnData|AnnDataSet- param groupby:
Grouping key in
data.obs, or one group label per cell.- type groupby:
- param pvalue:
One-sided normal survival-function threshold applied to z-scores.
- type pvalue:
- returns:
Mapping from group name to marker region names.
- rtype:
Examples
>>> import snapatac2 as snap >>> adata = snap.datasets.pbmc5k(type="annotated_h5ad") >>> markers = snap.tl.marker_regions(adata, groupby="cell_type", pvalue=0.01) >>> isinstance(markers, dict) True