Proteomics structural

From TianGzlab/OmicsClaw · View interactive version

Proteomics structural is an AI agent skill from the GitHub repository TianGzlab/OmicsClaw. Load when summarising cross-linking MS (XL-MS) results — intra/inter-protein link split, optional FDR filtering, distance-constraint validation against a per-crosslinker (DSS / BS3 / EDC / DSSO / DSBU) max distance. Skip when raw spectra are the input (run XlinkX / pLink / xiSEARCH first); no XL-MS

How to use this skill

Skill file

proteomics-structural

When to use

The CLI defaults are DSS and fdr_threshold=0.05. DSS/BS3/DSSO/DSBU use 30 angstrom; EDC uses 20 angstrom.

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-structural')
data = library.demo_data(random_state=42)
result = library.analyse_crosslinks(data)
write_output(result, 'tables/crosslinks.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 -->

`analyse_crosslinks(data: pd.DataFrame, *, fdr_threshold: float=0.05, crosslinker: str='DSS') -> pd.DataFrame`

Return filtered crosslinks with protein-pair and optional distance classifications.

:param data: Crosslink rows with protein_a and protein_b, optional fdr and distance_angstrom.

:param fdr_threshold: CLI default 0.05; filters only when an fdr column is present.

:param crosslinker: CLI default DSS; BS3, DSSO and DSBU use 30 A, EDC uses 20 A.

:returns: New crosslink table; absent distance evidence remains unchecked in run_info.

:raises ValueError: Protein identifiers, crosslinker or confidence threshold are invalid.

`run_info(table: pd.DataFrame, *, keep: bool=True) -> dict`

Read crosslink analysis diagnostics.

:param table: Output of analyse_crosslinks.

:param keep: True preserves attrs; False removes diagnostics.

:returns: A separate dictionary stating which optional checks ran.

:raises TypeError: The input is not a DataFrame.

`distance_figure(table: pd.DataFrame)`

Plot measured crosslink distances.

:param table: Crosslinks containing distance_angstrom.

:returns: A matplotlib Figure without writing files.

:raises KeyError: distance_angstrom is absent.

`demo_data(*, random_state: int=42) -> pd.DataFrame`

Generate synthetic crosslink records in memory.

:param random_state: CLI seed 42; change for another simulation.

:returns: Two hundred crosslinks with simulated distances and confidence.

:raises ValueError: The seed is invalid.

<!-- api:end -->

Methods and parameters

The CLI defaults are DSS and fdr_threshold=0.05. DSS/BS3/DSSO/DSBU use 30 angstrom; EDC uses 20 angstrom.

Functions return new DataFrames. run_info(result) reads diagnostic attrs;

use keep=False before serialization when those attrs are not needed.

Gotchas

Inputs and outputs

The CLI reads CSV tables and writes:

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-structural/struct_proteomics.py --demo --output /tmp/proteomics_structural

For real input replace --demo with --input <table>.

See also

Dependencies

numpy, pandas, matplotlib

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.