# Correcting Proteomics Batch Effects

> Evaluate and correct batch effects in proteomics data. Use when (1) assessing if batch effect, technical variation, plate effects, or instrument drift in proteomics context is present and batch correction is needed, (2) applying batch correction algorithms, (3) validating batch correction results.

- **Type:** Skill
- **Install:** `agentstack add skill-mannlabs-proteomics-agent-skills-correcting-proteomics-batch-effects`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [MannLabs](https://agentstack.voostack.com/s/mannlabs)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [MannLabs](https://github.com/MannLabs)
- **Source:** https://github.com/MannLabs/proteomics-agent-skills/tree/main/plugins/proteomics/skills/correcting_proteomics_batch_effects

## Install

```sh
agentstack add skill-mannlabs-proteomics-agent-skills-correcting-proteomics-batch-effects
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Batch Correction for Proteomics Data

Batch effects are systematic technical biases from sample preparation, instruments, or time points that obscure biological signals. Correction should only be applied on the protein level when diagnostics indicate necessity.

Commonly used batch effect correction algorithms include:

| Priority | Algorithm        | Description                          | When to Use                                |
| -------- | ---------------- | ------------------------------------ | ------------------------------------------ |
| 1        | ComBat           | Empirical Bayes shift+scale model    | Default choice, handles small batches well |
| 2        | Median centering | Equalizes batch-wise feature medians | Simple cases, interpretable                |
| 3        | Harmony          | Iterative mixing in PCA space        | Large datasets, many batches               |

## Workflow

Copy this checklist and track progress:

```
Analysis step progress:
- [ ] **Assess batch effects**
- [ ] **Prepare dataset**
- [ ] **Apply correction** - Use appropriate algorithm at protein level
- [ ] **Validate results** - Confirm improvement with same metrics
      If successful: Proceed with statistical analysis
      If unsuccessful: Try another batch effect correction
```

## Workflow

### 1. Assess Batch Effects

#### Qualitative: Principal Component Analysis (PCA) Visualization

Compute PCA and color samples by technical factors (e.g. processing plate, instrument, timepoint, processing date). Compare separation by technical vs biological factors. Strong batch effects show samples clustering by technical factors more than biological conditions.

#### Quantitative Metrics

| Metric                               | Description                                               | Interpretation                                                                                                                    |
| ------------------------------------ | --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| Principal Component Regression (PCR) | Weighted correlation of batch covariate with PCs          | `0 - +1`, lower is better                                                                                                         |
| Average Silhouette Width             | Batch clustering in feature/PCA space                     | `-1 - +1`, closer to 0 indicates lower batch effects, closer to 1 for biological factors indicates stronger separation by biology |
| Technical Replicate Correlation      | Pairwise feature correlation of replicates across batches | `-1 - +1`, higher is better                                                                                                       |

**Decision**: Proceed with batch correction if metrics indicate substantial batch effects

- Batch explains `< 5%` cumulative explained variance in PCR
- Average Silhouette Width of biological conditions is smaller than Average Silhouette Width of batch
- Pearson correlation of technical replicates is `r < 0.9`

### 2. Prepare data

Ensure that

- [ ] Data is log transformed and normalized
- [ ] Batch must not be confounded with biological conditions of interest
- [ ] Missing values are handled (impute or use NaN-tolerant batch correction method)

### 3. Apply Batch Correction

Apply batch correction algorithms according to their indicated priorities in the table.

### 4. Validate Correction

Re-compute the same metrics used in assessment:

- PCR score should decrease
- Silhouette width should approach 0
- Technical replicate correlation should increase

If metrics do not improve, repeat step 3 with a different algorithm and investigate which variable confounds the measurement (step 1).

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [MannLabs](https://github.com/MannLabs)
- **Source:** [MannLabs/proteomics-agent-skills](https://github.com/MannLabs/proteomics-agent-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-mannlabs-proteomics-agent-skills-correcting-proteomics-batch-effects
- Seller: https://agentstack.voostack.com/s/mannlabs
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
