SKILL.md
Version Compatibility
Reference examples tested with: R stats (base), ggplot2 3.5+, limma 3.58+, numpy 1.26+, pandas 2.2+, scipy 1.12+, statsmodels 0.14+
Before using code patterns, verify installed versions match. If versions differ:
- Python:
pip show <package>thenhelp(module.function)to check signatures - R:
packageVersion('<pkg>')then?function_nameto verify parameters
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Differential Protein Abundance
"Find differentially abundant proteins between my conditions" → Perform statistical testing on quantified protein intensities to identify proteins with significant abundance changes between experimental groups.
- R:
MSstats::groupComparison()for feature-level mixed models - R:
limma::eBayes()for empirical Bayes moderated t-tests on protein-level data - Python:
scipy.stats.ttest_ind()withstatsmodelsFDR correction
MSstats Group Comparison (R stats (base)+)
Goal: Identify differentially abundant proteins between experimental conditions using feature-level mixed models or moderated t-tests.
Approach: Define contrast matrices for pairwise comparisons, run MSstats groupComparison (or limma eBayes for protein-level data), then filter results by adjusted p-value and log2 fold change thresholds.
library(MSstats)
# After dataProcess()
comparison_matrix <- matrix(c(1, -1, 0, 0,
1, 0, -1, 0,
0, 1, -1, 0),
nrow = 3, byrow = TRUE)
rownames(comparison_matrix) <- c('Treatment1-Control', 'Treatment2-Control', 'Treatment1-Treatment2')
colnames(comparison_matrix) <- c('Control', 'Treatment1', 'Treatment2', 'Treatment3')
results <- groupComparison(contrast.matrix = comparison_matrix, data = processed)
# Significant proteins
sig_proteins <- results$ComparisonResult[results$ComparisonResult$adj.pvalue < 0.05 &
abs(results$ComparisonResult$log2FC) > 1, ]
