🥚 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 and4 DIA-NN output. Workflow includes preprocessing, imputation, and statistical testing.5license: MIT6metadata:7 source: https://skillmd.com/skills/stanfish06/proteomics-de8 version: 0.1.09 openclaw:10 requires:11 bins:12 - python313 always: false14 emoji: 🥚15 homepage: https://github.com/ClawBio/ClawBio16 os:17 - darwin18 - linux19 - win3220 install:21 - kind: pip22 package: pandas23 - kind: pip24 package: numpy25 - kind: pip26 package: matplotlib27 - kind: pip28 package: scikit-learn29 - kind: pip30 package: scipy31 - kind: pip32 package: seaborn33 trigger_keywords:34 - Differential expression analysis of proteomics data from MaxQuant or DIA-NN output35---3637# 🥚 Proteomics Differential Expression3839This 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.4041---4243## Domain Decisions4445### 1. Multi-format Input Support46- Supports **MaxQuant `proteinGroups.txt`**47 - Automatic filtering of reverse hits, contaminants, and site-only identifications48- Supports **DIA-NN output**49 - Automatically extracts protein IDs and `.raw` intensity columns5051---5253### 2. Preprocessing Strategy54- MaxQuant:55 - Filters:56 - `Reverse`57 - `Potential contaminant` / `Contaminant`58 - `Only identified by site`59- DIA-NN:60 - Extracts protein identifiers and intensity matrix directly6162---6364### 3. Intensity Transformation65- LFQ intensities are transformed using **log2 scaling**66- Ensures approximate normality for downstream statistical testing6768---6970### 4. Missing Value Imputation71- Uses **down-shifted Gaussian imputation**72 - Mean shifted by: `median - shift × std`73 - Default:74 - `shift = 1.8`75 - `scale = 0.3`76- Assumption:77 - Missing values represent **low-abundance proteins**7879---8081### 5. Statistical Testing82- Two-sample **t-test** between treatment and control groups83- Default degrees of freedom:84 - `df = 4` (for 3 vs 3 replicates)8586---8788### 6. Multiple-Testing Correction89- **Benjamini-Hochberg** on the raw t-test p-values → `padj`90- This is what controls the false discovery rate9192---9394### 7. s0 Fold-Change Curve95- Hyperbolic volcano boundary combining log2 fold change and p-value96- Shape follows Giai Gianetto et al. (2016)97- 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 BH9899---100101### 8. Significance Thresholding102- A protein is called `upregulated`/`downregulated` only when it clears **both**:103 - `padj <= --fdr` (Benjamini-Hochberg)104 - the s0 curve105- Default:106 - `FDR = 0.05`107 - `s0 = 0.1`108109---110111### 9. Visualization Outputs112- PCA plot113- Volcano plot (with s0 curve)114- Imputation distribution comparison115116---117118## Safety Rules119120- **Local-first**121 - No data upload without explicit user consent122123- **Statistical caution**124 - Statistical results should be interpreted with caution and not overinterpreted125 - Avoid drawing conclusions beyond what the data supports126127- **Missing data assumptions**128 - Imputation assumes missing values correspond to low abundance129 - May not hold in all experimental designs130131- **Small sample limitations**132 - t-test reliability depends on sufficient replicates133134- **Reproducibility**135 - All parameters and commands are logged136137- **No hallucinated science**138 - All methods are based on established proteomics workflows139140---141142## Agent Boundary143144### This skill DOES:145- Perform differential expression analysis on LFQ proteomics data146- Handle MaxQuant and DIA-NN outputs147- Generate statistical results and visualizations148- Produce reproducible reports149150---151152### This skill DOES NOT:153- Process raw mass spectrometry data (e.g. RAW files)154- Perform peptide identification or database search155- Conduct pathway or functional enrichment analysis156- Provide biological interpretation of results157158---159160## Input Contract161162### Supported Input Formats1631. MaxQuant `proteinGroups.txt`1642. DIA-NN output (`.tsv` / `.txt`)165166---167168### Metadata Requirements169- `.csv` or `.tsv`170- Must include:171 - `sample_id`172 - `group`173174Supports:175- raw names176- full paths (e.g. `/path/sample.raw`)177178---179180## Output Structure181```182proteomics_de_report/183├── report.md184├── figures/185│ ├── imputation_distribution.png186│ ├── pca.png187│ └── volcano.png188├── tables/189│ ├── imputed_proteinGroups.csv190│ └── de_results.csv191├── ro-crate-metadata.json192└── reproducibility/193 ├── commands.sh194 ├── environment.yml195 └── checksums.sha256196```197198---199200## Usage201202### Demo203```bash204python proteomics_de.py \205 --demo \206 --output report_dir207```208209### MaxQuant Input210```bash211python proteomics_de.py \212 --input proteinGroups.txt \213 --input-type maxquant \214 --metadata metadata.csv \215 --contrast "treated,control" \216 --output report_dir217```218219### DIA-NN Input220```bash221python proteomics_de.py \222 --input diann_output.tsv \223 --input-type diann \224 --metadata metadata.csv \225 --contrast "treated,control" \226 --output report_dir227```228229### Parameters230231| Parameter | Description | Default |232| -------------------- | --------------------- | --------------- |233| `--input` | Input file path | - |234| `--input-type` | `maxquant` or `diann` | maxquant |235| `--metadata` | Metadata file | - |236| `--contrast` | treatment,control | treated,control |237| `--s0` | s0 parameter | 0.1 |238| `--fdr` | BH FDR threshold; also positions the s0 curve | 0.05 |239| `--ttest-df` | Degrees of freedom | 4 |240| `--imputation-shift` | Imputation shift | 1.8 |241| `--imputation-scale` | Imputation scale | 0.3 |242| `--output` | Output directory | - |243244## References245- 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. 246- 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.247- 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.248