scdrs.method.downstream_group_analysis#
- scdrs.method.downstream_group_analysis(adata: AnnData, df_full_score: DataFrame, group_cols: List[str], fdr_thresholds: List[float] = [0.05, 0.1, 0.2]) Dict[str, DataFrame] [source]#
scDRS group-level analysis.
For each annotation in group_cols and each group of cells in the annotation, compute:
Proportion of FDR < 0.1 cells.
Group-level trait association.
Group-level heterogeneity.
connectivities is expected in adata.obsp for the group-level heterogeneity analysis. Recommended parameters: sc.pp.neighbors(adata, n_neighbors=15, n_pcs=20).
- Parameters:
- adataanndata.AnnData
Single-cell data of shape (n_cell, n_gene). Assumed to be size-factor-normalized and log1p-transformed.
- df_full_scorepd.DataFrame
scDRS .full_score file for a given trait.
- group_colslist of str
List of column names in adata.obs used to define cell groups.
- Returns:
- dict_df_resDict[str, pd.DataFrame]
Group-level statistics (n_group, n_stats) keyed by the group names.