affinity-proteomics
Unified analysis pipeline for affinity-based proteomics platforms — Olink (PEA, NPX) and SomaLogic SomaScan (SOMAmer, RFU). Platform-aware QC, normalisation, differential abundance, volcano plots, heatmaps, and PCA.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 12
- Forks
- 5
01 前言 Front Matter
- name
- affinity-proteomics
- license
- MIT
- metadata
- { "tags": [ "proteomics", "olink", "somalogic", "somascan", "npx", "affinity", "differential-abundance", "biomarker" ], "author": "Reza", "version": "0.1.0", "openclaw": { "os": [ "darwin", "linux" ], "emoji": "🧪", "always": false, "install": [ { "kind": "pip", "package": "somadata" }, { "kind": "pip", "package": "scipy" }, { "kind": "pip", "package": "statsmodels" }, { "kind": "pip", "package": "seaborn" }, { "kind": "pip", "package": "scikit-learn" } ], "homepage": "https://github.com/ClawBio/ClawBio", "requires": { "bins": [ "python3" ] }, "trigger_keywords": [ "Olink", "SomaLogic", "SomaScan", "NPX", "proteomics", "affinity proteomics", "protein biomarker", "plasma proteomics", "ADAT" ] } }
- description
- Unified analysis pipeline for affinity-based proteomics platforms — Olink (PEA, NPX) and SomaLogic SomaScan (SOMAmer, RFU). Platform-aware QC, normalisation, differential abundance, volcano plots, heatmaps, and PCA.
02 资源文件 7
- 脚本affinity_proteomics.py38.2 KB
- 参考文档agents/openai.yaml174 B
- 资产文件example_data/olink_demo_meta.csv1.9 KB
- 资产文件example_data/olink_demo_npx.csv269.7 KB
- 参考文档requirements.txt30 B
- 脚本tests/__init__.py28 B
- 脚本tests/test_affinity_proteomics.py13.6 KB
03 SKILL.md 正文
🧪 Affinity Proteomics Pipeline
You are Affinity Proteomics, a specialised ClawBio agent for Olink and SomaLogic SomaScan data analysis. Your role is to run platform-aware QC, differential abundance testing, and visualisation from affinity-based proteomics data.
Why This Exists
- Without it: Researchers must write bespoke scripts for each platform — Olink NPX and SomaLogic ADAT have completely different file formats, normalisation methods, and QC conventions
- With it: A single command handles both platforms with correct QC, normalisation, and analysis under a unified interface
- Why ClawBio: The existing
proteomics-deskill handles mass-spectrometry LFQ data (MaxQuant/DIA-NN) and does not cover affinity-based platforms. This skill fills that gap
Core Capabilities
- Dual-platform support: Olink NPX (CSV/Parquet) and SomaLogic ADAT under one interface
- Platform-specific QC: Olink (QC_Warning, LOD, sample median) / SomaLogic (RowCheck, ColCheck, normalisation scale factors, MAD outlier filtering)
- Differential abundance: t-test or Mann-Whitney U with Benjamini-Hochberg FDR correction
- Visualisation: Volcano plot, heatmap (top N proteins), PCA plot
- Structured reporting: Markdown report, result.json, per-protein TSV, reproducibility bundle
- Skill Action Menu:
result.jsonincludes a workflow state plus read-only follow-up actions for compact report cards
Input Formats
| Format | Extension | Platform | Example |
|---|---|---|---|
| Olink NPX | .csv |
Olink Explore / Target 96 | olink_demo_npx.csv |
| SomaLogic ADAT | .adat |
SomaScan v4.0/v4.1 | example_data.adat (via somadata) |
| Sample metadata | .csv |
Both (Olink requires separate file) | olink_demo_meta.csv |
CLI Reference
# Olink demo
python skills/affinity-proteomics/affinity_proteomics.py \
--demo --platform olink --output /tmp/olink_demo
# SomaLogic demo
python skills/affinity-proteomics/affinity_proteomics.py \
--demo --platform somascan --output /tmp/soma_demo
# Real Olink data
python skills/affinity-proteomics/affinity_proteomics.py \
--platform olink --input data.csv --meta samples.csv \
--group-col Group --contrast "Case,Control" --output results/
# Via ClawBio runner
python clawbio.py run affprot --demo --platform olink
Demo
python clawbio.py run affprot --demo --platform olink
Expected output: Differential abundance report for 80 samples (40 Case / 40 Control) across 40 proteins, with 5 truly differentially expressed proteins recovered, volcano plot, heatmap, PCA, and reproducibility bundle.
Output Structure
report.md— markdown report with QC, differential abundance, and top-protein sectionsresult.json— structured summary withchat_summary_lines,preferred_artifacts,workflow_state, andsuggested_actionstables/diff_abundance.tsv— per-protein differential abundance tablefigures/volcano.png,figures/heatmap.png,figures/pca.png— standard demo figuresreproducibility/— command and software-version metadata
Suggested Actions
The demo result emits workflow_state.lifecycle: "ready" and offers two read-only actions: Top Proteins and Volcano Summary. In chat, the user sees those labels as numbered options; selecting one runs the stored structured request.
state_id is derived as a SHA-256 hash over a compact deterministic state payload: platform, contrast, protein counts, significant-protein direction counts, and the top protein rows carried in each action request. If a stored request's state_id no longer matches that payload, the skill returns a structured expired result instead of rendering a stale follow-up.
{
"workflow_state": {
"state_schema": "affinity_proteomics.workflow_state.v1",
"state_id": "sha256:...",
"lifecycle": "ready",
"state_label": "differential-abundance-ready",
"description": "OLINK differential abundance results for Case vs Control are available."
},
"suggested_actions": [
{
"action_id": "show-top-proteins",
"label": "Top Proteins",
"estimate": "~5s",
"request": {
"schema": "affinity_proteomics.action_request.v1",
"action": "top-proteins",
"state_schema": "affinity_proteomics.workflow_state.v1",
"state_id": "sha256:...",
"n": 5,
"platform": "olink",
"contrast": ["Case", "Control"],
"total_proteins_tested": 40,
"significant_proteins": 5,
"proteins": [
{"protein_id": "OID00001", "gene": "GENE1", "log2fc": 0.0, "padj": "0.00e+00"}
]
}
}
]
}
Dependencies
Required:
somadata>= 1.2 — SomaLogic ADAT parsingscipy>= 1.10 — statistical testsstatsmodels>= 0.14 — multiple testing correctionmatplotlib>= 3.7 — plottingseaborn>= 0.13 — heatmapsnumpy>= 1.24 — numerical operationspandas>= 2.0 — data manipulationscikit-learn>= 1.3 — PCA dimensionality reduction for sample-level QC plots
Safety
- Local-first: All computation runs locally; no data uploaded
- Disclaimer: Every report includes the ClawBio medical disclaimer
- Platform-aware: Applies correct QC and normalisation per platform
- No hallucinated science: All thresholds trace to platform vendor documentation
Integration with Bio Orchestrator
Trigger conditions — the orchestrator routes here when:
- User mentions Olink, SomaLogic, SomaScan, NPX, ADAT, or affinity proteomics
- User provides an Olink NPX CSV or SomaLogic ADAT file
Chaining partners:
proteomics-de: Complementary — handles mass-spec LFQ; this skill handles affinity platformsdiff-visualizer: Downstream — enhanced visualisation of differential abundance results
Citations
- Assarsson et al. (2014) — Olink PEA technology
- Gold et al. (2010) — SOMAmer aptamer technology
- OlinkAnalyze — Official Olink R toolkit
- somadata — Python ADAT parser
04 同仓库更多 Skills
zarr-python
Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3/GCS storage, and NumPy/Dask/Xarray integration. Use for array layout, bounded I/O, format migration, or scientific metadata preservation.
yeet
Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.
xarray
N-dimensional labeled arrays and datasets in Python. Built on top of NumPy and Dask. It introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, making data analysis in physical sciences more intuitive and less error-prone. Use for working with multi-dimensional scientific data, NetCDF/GRIB/Zarr files, climate/weather/oceanographic datasets, remote sensing, geospatial imaging, large out-of-memory datasets with Dask, and labeled array operations.
writing-mstest-tests
Use when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for "review" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected/actual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext/lifecycle; timeout/cancellation; OS/CI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest/non-.NET code.
wgs-prs
End-to-end WGS to polygenic risk score pipeline. Takes paired-end FASTQ files (or a pre-existing VCF) through nf-core/sarek for variant calling, applies VCF QC (normalisation, hard filtering, Ti/Tv and Het/Hom checks), then computes polygenic risk scores via the PGS Catalog. Fills the FASTQ to VCF gap upstream of the gwas-prs skill.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.