scrnatools.tools.cluster_de
- scrnatools.tools.cluster_de(adata: AnnData, model: SCVI, cluster_key: str, lfc_mean_threshold: int = 0, bayes_factor_threshold: int = 3, non_zeroes_proportion_threshold: int = 0.1, save_path: str | None = None, subset: bool = True) Dict[str, DataFrame][source]
Calculates DE marker genes for data clusters.
- Parameters:
adata (AnnData) – The data to analyze.
model (SCVI) – The scVI model for ‘adata’.
cluster_key (str) – The column name of the cluster data in ‘adata.obs’.
lfc_mean_threshold (int, optional) – The minimum lfc_mean to filter DE genes on (exclusive). Defaults to 0.
bayes_factor_threshold (int, optional) – The minimum bayes factor to filter de genes on (exclusive). Defaults to 3.
non_zeroes_proportion_threshold (int, optional) – The minimum proportion of cells with non-zero expression filter de genes on (exclusive). Defaults to 0.1.
save_path (str, optional) – The path to save the marker gene lists to. Defaults to None.
subset (bool, optional) – Whether to subset the DE gene list based on thresholds or return all genes in data. Defaults to True.
- Raises:
ValueError – If ‘cluster_key’ is not a valid column in ‘adata.obs.columns’
- Returns:
A dictionary with keys equal to the categories of the cluster column in ‘adata.obs’ (i.e. cell types) linked to DataFrames of the filtered (or unfiltered but sorted) DE marker genes for that cluster
- Return type:
Dict[str, DataFrame]