proteomics-data-import
Load when ingesting a MaxQuant `proteinGroups.txt`, FragPipe `combined_protein.tsv`, DIA-NN report, or generic CSV / TSV protein-quantification table — normalises columns to a standard schema, emits `tables/proteins.csv`. Skip when raw spectra are the input (run the search engine first); the file is already OmicsClaw schema.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-08
- Stars
- ★ 161
- Forks
- 27
01 前言 Front Matter
- name
- proteomics-data-import
- tags
- [ "proteomics", "import", "maxquant", "fragpipe", "diann", "spectronaut" ]
- trigger
- data import, convert proteomics, format conversion
- description
- Load when ingesting a MaxQuant `proteinGroups.txt`, FragPipe `combined_protein.tsv`, DIA-NN report, or generic CSV / TSV protein-quantification table — normalises columns to a standard schema, emits `tables/proteins.csv`. Skip when raw spectra are the input (run the search engine first); the file is already OmicsClaw schema.
02 资源文件 7
- 脚本_api.py2.9 KB
- 脚本examples/example_step.py479 B
- 脚本proteomics_data_import.py4.5 KB
- 参考文档references/methodology.md280 B
- 参考文档references/output_contract.md267 B
- 参考文档references/parameters.md300 B
- 脚本tests/test_api.py1.1 KB
03 SKILL.md 正文
proteomics-data-import
When to use
maxquant is the default; fragpipe, diann and generic normalize their own column names. read_table detects CSV/TSV separation. Use existing search-engine tables; this skill does not search raw spectra.
Use from a step
from skills._sdk.notebook import load_skill, write_output
library = load_skill('proteomics-data-import')
data = library.demo_data(random_state=42)
result = library.standardize(data)
write_output(result, 'tables/proteins.csv')
For real data, use read_input and pass any read_table helper as reader=.
The executable examples/example_step.py also checks the result and writes a Figure.
API
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
read_table(path: str | Path) -> pd.DataFrame
Read a CSV or TSV; pass this function as reader= to read_input.
:param path: Search-engine output file; the first line selects comma or tab separation. :returns: Unmodified input columns as a DataFrame. :raises OSError: The file cannot be read.
standardize(data: pd.DataFrame, *, format: str='maxquant') -> pd.DataFrame
Return a standardized copy of a search-engine protein table.
:param data: Original protein table with engine-specific column names. :param format: CLI default maxquant; fragpipe, diann and generic use their own mappings. :returns: Protein table; MaxQuant reverse, contaminant and site-only flags are filtered. :raises ValueError: The format is unsupported.
run_info(table: pd.DataFrame, *, keep: bool=True) -> dict
Read import diagnostics.
:param table: Standardized protein table. :param keep: True preserves attrs; False removes diagnostics. :returns: A separate diagnostic dictionary. :raises TypeError: The input is not a DataFrame.
intensity_figure(table: pd.DataFrame)
Plot numeric column medians for checking an imported table.
:param table: Standardized protein table; numeric metadata is included. :returns: A matplotlib Figure without writing files. :raises TypeError: The input is not a DataFrame.
demo_data(*, random_state: int=42) -> pd.DataFrame
Generate a synthetic MaxQuant table in memory.
:param random_state: CLI seed 42; change for another simulation. :returns: Two hundred protein rows, including five flagged rows. :raises ValueError: The seed is invalid.
<!-- api:end -->
Methods and parameters
maxquant is the default; fragpipe, diann and generic normalize their own column names. read_table detects CSV/TSV separation.
Functions return new DataFrames. run_info(result) reads diagnostic attrs;
use keep=False before serialization when those attrs are not needed.
Gotchas
- standardize filters MaxQuant Reverse, Potential contaminant and Only identified by site flags. Generic import does not infer those flags.
demo_datauses seed 42, matching the CLI; every demo is synthetic.run_infolives in DataFrame attrs and is not preserved by CSV serialization.
Inputs and outputs
The CLI reads CSV tables and writes:
- tables/proteins.csv
- report.md
- result.json
demo_proteinGroups.txtis written only with--demo.
Functions return data and Figures without writing files. Steps own their outputs. Demo mode also writes its synthetic input when the original CLI used a file.
CLI
python skills/proteomics/proteomics-data-import/proteomics_data_import.py --demo --output /tmp/proteomics_data_import
For real input replace --demo with --input <table>.
See also
references/methodology.mdreferences/parameters.mdreferences/output_contract.mdproteomics-data-importfor protein-table normalization;proteomics-defor comparisons.
Dependencies
numpy, pandas, matplotlib
04 同仓库更多 Skills
demo-skill
A fixture skill for the skill environment tests. Use it for nothing else.
fake-domains
Test fixture for the golden deployment in tests/entry. Load never; it has no script.
replace-me-skill
Load when copying this directory to bootstrap a new OmicsClaw skill. Skip when an existing skill already covers the request.
spatial-velocity
Load when estimating RNA velocity on a spatial AnnData with `layers["spliced"]` + `layers["unspliced"]` via scVelo (stochastic / deterministic / dynamical) or veloVI (deep generative). Skip when input lacks the spliced/unspliced layers (must be quantified upstream by velocyto / kb-python / STARsolo); non-spatial scRNA velocity (use sc-velocity).
spatial-trajectory
Load when inferring pseudotime / lineage trajectories on a preprocessed spatial AnnData via DPT (default — diffusion pseudotime), CellRank (terminal-state + fate-probability), or Palantir (waypoint branch probabilities). Skip when the data has spliced/unspliced layers and you want velocity-driven dynamics (use spatial-velocity); non-spatial scRNA pseudotime (use sc-pseudotime).
spatial-statistics
Load when running spatial autocorrelation / hotspot / co-occurrence / neighbourhood-enrichment / Ripley K stats on a clustered spatial AnnData via squidpy. Skip when ranking spatially variable genes (use spatial-genes); tissue domain detection (use spatial-domains).