alphapepttools.tl.diff_exp_ttest#
- alphapepttools.tl.diff_exp_ttest(adata, between_column, comparison, min_valid_values=2, *, equal_var=False)#
Calculate ratios of features between two specific groups using t-test.
Calculate ratios and log2 ratios of each feature in the AnnData object’s X between two specific groups defined in the comparison tuple.
- Parameters:
adata (ad.AnnData) – AnnData object with features and observations.
between_column (str) – Name of the column in adata.obs that contains the groups to compare.
comparison (tuple) – Tuple of exactly two group names to compare (group1, group2).
min_valid_values (int, optional) – Minimum number of samples required per group. By default 2.
equal_var (bool, optional) – Whether to assume equal variance in the t-test. By default False.
- Return type:
DataFrame|None- Returns:
pd.DataFrame | None DataFrame with ratios, deltas, t-statistics, p-values, and adjusted p-values for the comparison between the two specified groups. Returns None if validation fails.