alphapepttools.tl.diff_exp_alphaquant#
- alphapepttools.tl.diff_exp_alphaquant(adata, report, between_column, comparison, min_valid_values=2, valid_values_filter_mode='either', plots='hide')#
Calculate differential expression using AlphaQuant.
- Parameters:
adata (
AnnData) – AnnData object containing the expression data and sample metadata.report (
DataFrame) – DataFrame with quantification report data for AlphaQuant analysis.between_column (
str) – Column name in adata.obs containing group labels for comparison.comparison (
tuple) – Tuple of exactly two group names to compare.min_valid_values (
int(default:2)) – Minimum number of valid values required per group for statistical testing.valid_values_filter_mode (
str(default:'either')) – How to apply the min_valid_values filter - ‘either’ or ‘both’.plots (
str(default:'hide')) – Whether to ‘show’ or ‘hide’ AlphaQuant’s generated plots.
- Return type:
- Returns:
tuple[str, dict[str, pd.DataFrame]] Tuple containing: - comparison_key: String identifier for the comparison (e.g., “Group1_VS_Group2”) - results: Dictionary with keys ‘protein’, ‘peptide’, ‘proteoform’ containing
standardized differential expression results for each level.
- Raises:
ImportError – If alphaquant is not installed.
ValueError – If plots is not ‘hide’ or ‘show’, if between_column is not in adata.obs, or if comparison is not a tuple of exactly two elements.
Examples
Run differential expression analysis between treatment groups:
comparison_key, alphaquant_results = at.tl.diff_exp_alphaquant( adata=adata_precursor, report=full_report, between_column="treatment", comparison=("control", "treated"), valid_values_filter_mode="either", min_valid_values=3, plots="hide", ) # Access results for different levels protein_results = alphaquant_results["protein"] peptide_results = alphaquant_results["peptide"] proteoform_results = alphaquant_results["proteoform"]