🥚 Proteomics Differential Expression
This skill performs differential expression analysis on label-free quantitative (LFQ) intensity data from MaxQuant and DIA-NN outputs, including preprocessing, imputation, statistical testing, and visualization.
Domain Decisions
1. Multi-format Input Support
- Supports MaxQuant
proteinGroups.txt
- Automatic filtering of reverse hits, contaminants, and site-only identifications
- Supports DIA-NN output
- Automatically extracts protein IDs and
.raw intensity columns
2. Preprocessing Strategy
- MaxQuant:
- Filters:
Reverse
Potential contaminant / Contaminant
Only identified by site
- DIA-NN:
- Extracts protein identifiers and intensity matrix directly
3. Intensity Transformation
- LFQ intensities are transformed using log2 scaling
- Ensures approximate normality for downstream statistical testing
4. Missing Value Imputation
- Uses down-shifted Gaussian imputation
- Mean shifted by:
median - shift × std
- Default:
- Assumption:
- Missing values represent low-abundance proteins
5. Statistical Testing
- Two-sample t-test between treatment and control groups
- Default degrees of freedom:
df = 4 (for 3 vs 3 replicates)
6. Multiple-Testing Correction
- Benjamini-Hochberg on the raw t-test p-values →
padj
- This is what controls the false discovery rate
7. s0 Fold-Change Curve
- Hyperbolic volcano boundary combining log2 fold change and p-value
- Shape follows Giai Gianetto et al. (2016)
- s0 is a fold-change fudge factor, not a multiplicity correction. Perseus and SAM derive an FDR for this curve by permutation; permutation is not implemented here, so the curve is used only as an additional effect-size requirement on top of BH
8. Significance Thresholding
- A protein is called
upregulated/downregulated only when it clears both:
padj <= --fdr (Benjamini-Hochberg)
- the s0 curve
- Default:
9. Visualization Outputs
- PCA plot
- Volcano plot (with s0 curve)
- Imputation distribution comparison
Safety Rules
Local-first
- No data upload without explicit user consent
Statistical caution
- Statistical results should be interpreted with caution and not overinterpreted
- Avoid drawing conclusions beyond what the data supports
Missing data assumptions
- Imputation assumes missing values correspond to low abundance
- May not hold in all experimental designs
Small sample limitations
- t-test reliability depends on sufficient replicates
Reproducibility
- All parameters and commands are logged
No hallucinated science
- All methods are based on established proteomics workflows
Agent Boundary
This skill DOES:
- Perform differential expression analysis on LFQ proteomics data
- Handle MaxQuant and DIA-NN outputs
- Generate statistical results and visualizations
- Produce reproducible reports
This skill DOES NOT:
- Process raw mass spectrometry data (e.g. RAW files)
- Perform peptide identification or database search
- Conduct pathway or functional enrichment analysis
- Provide biological interpretation of results
Input Contract
Supported Input Formats
- MaxQuant
proteinGroups.txt
- DIA-NN output (
.tsv / .txt)
Metadata Requirements
.csv or .tsv
- Must include:
Supports:
- raw names
- full paths (e.g.
/path/sample.raw)
Output Structure
proteomics_de_report/
├── report.md
├── figures/
│ ├── imputation_distribution.png
│ ├── pca.png
│ └── volcano.png
├── tables/
│ ├── imputed_proteinGroups.csv
│ └── de_results.csv
├── ro-crate-metadata.json
└── reproducibility/
├── commands.sh
├── environment.yml
└── checksums.sha256
Usage
Demo
python proteomics_de.py \
--demo \
--output report_dir
MaxQuant Input
python proteomics_de.py \
--input proteinGroups.txt \
--input-type maxquant \
--metadata metadata.csv \
--contrast "treated,control" \
--output report_dir
DIA-NN Input
python proteomics_de.py \
--input diann_output.tsv \
--input-type diann \
--metadata metadata.csv \
--contrast "treated,control" \
--output report_dir
Parameters
| Parameter |
Description |
Default |
--input |
Input file path |
- |
--input-type |
maxquant or diann |
maxquant |
--metadata |
Metadata file |
- |
--contrast |
treatment,control |
treated,control |
--s0 |
s0 parameter |
0.1 |
--fdr |
BH FDR threshold; also positions the s0 curve |
0.05 |
--ttest-df |
Degrees of freedom |
4 |
--imputation-shift |
Imputation shift |
1.8 |
--imputation-scale |
Imputation scale |
0.3 |
--output |
Output directory |
- |
References
- test_proteinGroups.txt is from: Keilhauer EC, Hein MY, Mann M. Accurate protein complex retrieval by affinity enrichment mass spectrometry (AE-MS) rather than affinity purification mass spectrometry (AP-MS). Mol Cell Proteomics. 2015 Jan;14(1):120-35. doi: 10.1074/mcp.M114.041012. Epub 2014 Nov 2. PMID: 25363814; PMCID: PMC4288248.
- s0 correction algorithm is from: Giai Gianetto Q, Couté Y, Bruley C, Burger T. Uses and misuses of the fudge factor in quantitative discovery proteomics. Proteomics. 2016 Jul;16(14):1955-60. doi: 10.1002/pmic.201600132. PMID: 27272648.
- s0 correction algorithm is cited by: Michaelis AC, Brunner AD, Zwiebel M, Meier F, Strauss MT, Bludau I, Mann M. The social and structural architecture of the yeast protein interactome. Nature. 2023 Dec;624(7990):192-200. doi: 10.1038/s41586-023-06739-5. Epub 2023 Nov 15. PMID: 37968396; PMCID: PMC10700138.
1---2name: proteomics-de3description: Differential expression analysis for label-free quantitative (LFQ) intensity data with standard MaxQuant and DIA-NN output. Workflow includes preprocessing, imputation, and statistical testing.4license: MIT5---67# 🥚 Proteomics Differential Expression89This skill performs differential expression analysis on label-free quantitative (LFQ) intensity data from MaxQuant and DIA-NN outputs, including preprocessing, imputation, statistical testing, and visualization.1011---1213## Domain Decisions1415### 1. Multi-format Input Support16- Supports **MaxQuant `proteinGroups.txt`**17 - Automatic filtering of reverse hits, contaminants, and site-only identifications18- Supports **DIA-NN output**19 - Automatically extracts protein IDs and `.raw` intensity columns2021---2223### 2. Preprocessing Strategy24- MaxQuant:25 - Filters:26 - `Reverse`27 - `Potential contaminant` / `Contaminant`28 - `Only identified by site`29- DIA-NN:30 - Extracts protein identifiers and intensity matrix directly3132---3334### 3. Intensity Transformation35- LFQ intensities are transformed using **log2 scaling**36- Ensures approximate normality for downstream statistical testing3738---3940### 4. Missing Value Imputation41- Uses **down-shifted Gaussian imputation**42 - Mean shifted by: `median - shift × std`43 - Default:44 - `shift = 1.8`45 - `scale = 0.3`46- Assumption:47 - Missing values represent **low-abundance proteins**4849---5051### 5. Statistical Testing52- Two-sample **t-test** between treatment and control groups53- Default degrees of freedom:54 - `df = 4` (for 3 vs 3 replicates)5556---5758### 6. Multiple-Testing Correction59- **Benjamini-Hochberg** on the raw t-test p-values → `padj`60- This is what controls the false discovery rate6162---6364### 7. s0 Fold-Change Curve65- Hyperbolic volcano boundary combining log2 fold change and p-value66- Shape follows Giai Gianetto et al. (2016)67- s0 is a fold-change fudge factor, **not** a multiplicity correction. Perseus and SAM derive an FDR for this curve by permutation; permutation is not implemented here, so the curve is used only as an additional effect-size requirement on top of BH6869---7071### 8. Significance Thresholding72- A protein is called `upregulated`/`downregulated` only when it clears **both**:73 - `padj <= --fdr` (Benjamini-Hochberg)74 - the s0 curve75- Default:76 - `FDR = 0.05`77 - `s0 = 0.1`7879---8081### 9. Visualization Outputs82- PCA plot83- Volcano plot (with s0 curve)84- Imputation distribution comparison8586---8788## Safety Rules8990- **Local-first**91 - No data upload without explicit user consent9293- **Statistical caution**94 - Statistical results should be interpreted with caution and not overinterpreted95 - Avoid drawing conclusions beyond what the data supports9697- **Missing data assumptions**98 - Imputation assumes missing values correspond to low abundance99 - May not hold in all experimental designs100101- **Small sample limitations**102 - t-test reliability depends on sufficient replicates103104- **Reproducibility**105 - All parameters and commands are logged106107- **No hallucinated science**108 - All methods are based on established proteomics workflows109110---111112## Agent Boundary113114### This skill DOES:115- Perform differential expression analysis on LFQ proteomics data116- Handle MaxQuant and DIA-NN outputs117- Generate statistical results and visualizations118- Produce reproducible reports119120---121122### This skill DOES NOT:123- Process raw mass spectrometry data (e.g. RAW files)124- Perform peptide identification or database search125- Conduct pathway or functional enrichment analysis126- Provide biological interpretation of results127128---129130## Input Contract131132### Supported Input Formats1331. MaxQuant `proteinGroups.txt`1342. DIA-NN output (`.tsv` / `.txt`)135136---137138### Metadata Requirements139- `.csv` or `.tsv`140- Must include:141 - `sample_id`142 - `group`143144Supports:145- raw names146- full paths (e.g. `/path/sample.raw`)147148---149150## Output Structure151```152proteomics_de_report/153├── report.md154├── figures/155│ ├── imputation_distribution.png156│ ├── pca.png157│ └── volcano.png158├── tables/159│ ├── imputed_proteinGroups.csv160│ └── de_results.csv161├── ro-crate-metadata.json162└── reproducibility/163 ├── commands.sh164 ├── environment.yml165 └── checksums.sha256166```167168---169170## Usage171172### Demo173```bash174python proteomics_de.py \175 --demo \176 --output report_dir177```178179### MaxQuant Input180```bash181python proteomics_de.py \182 --input proteinGroups.txt \183 --input-type maxquant \184 --metadata metadata.csv \185 --contrast "treated,control" \186 --output report_dir187```188189### DIA-NN Input190```bash191python proteomics_de.py \192 --input diann_output.tsv \193 --input-type diann \194 --metadata metadata.csv \195 --contrast "treated,control" \196 --output report_dir197```198199### Parameters200201| Parameter | Description | Default |202| -------------------- | --------------------- | --------------- |203| `--input` | Input file path | - |204| `--input-type` | `maxquant` or `diann` | maxquant |205| `--metadata` | Metadata file | - |206| `--contrast` | treatment,control | treated,control |207| `--s0` | s0 parameter | 0.1 |208| `--fdr` | BH FDR threshold; also positions the s0 curve | 0.05 |209| `--ttest-df` | Degrees of freedom | 4 |210| `--imputation-shift` | Imputation shift | 1.8 |211| `--imputation-scale` | Imputation scale | 0.3 |212| `--output` | Output directory | - |213214## References215- test_proteinGroups.txt is from: Keilhauer EC, Hein MY, Mann M. Accurate protein complex retrieval by affinity enrichment mass spectrometry (AE-MS) rather than affinity purification mass spectrometry (AP-MS). Mol Cell Proteomics. 2015 Jan;14(1):120-35. doi: 10.1074/mcp.M114.041012. Epub 2014 Nov 2. PMID: 25363814; PMCID: PMC4288248. 216- s0 correction algorithm is from: Giai Gianetto Q, Couté Y, Bruley C, Burger T. Uses and misuses of the fudge factor in quantitative discovery proteomics. Proteomics. 2016 Jul;16(14):1955-60. doi: 10.1002/pmic.201600132. PMID: 27272648.217- s0 correction algorithm is cited by: Michaelis AC, Brunner AD, Zwiebel M, Meier F, Strauss MT, Bludau I, Mann M. The social and structural architecture of the yeast protein interactome. Nature. 2023 Dec;624(7990):192-200. doi: 10.1038/s41586-023-06739-5. Epub 2023 Nov 15. PMID: 37968396; PMCID: PMC10700138.218