This file instructs AI agents (Claude Code, GitHub Copilot, Cursor, Gemini, etc.) how to contribute tools to the agentomics repository.
Agentomics is a collection of standalone CLI tools built with pyopenms for proteomics and metabolomics workflows. These tools fill gaps not yet covered by OpenMS/pyopenms. All code in this repo is written by AI agents.
Every tool must be a self-contained directory under tools/<domain>/<topic>/<tool_name>/:
tools/<domain>/<topic>/<tool_name>/
├── <tool_name>.py # The tool itself
├── requirements.txt # pyopenms + any tool-specific deps (no version pins)
├── README.md # Brief description + CLI usage examples
└── tests/
├── conftest.py # Shared test config (see below)
└── test_<tool_name>.py
Proteomics topics: spectrum_analysis/, peptide_analysis/, protein_analysis/, fasta_utils/, file_conversion/, quality_control/, targeted_proteomics/, identification/, ptm_analysis/, structural_proteomics/, specialized/, rna/, signal_processing/, map_alignment/, quantification/, inference/, dia_analysis/
Metabolomics topics: formula_tools/, feature_processing/, spectral_analysis/, compound_annotation/, drug_metabolism/, isotope_labeling/, lipidomics/, export/, identification/, preprocessing/
<domain>isproteomicsormetabolomics<topic>is one of the topic directories listed aboverequirements.txtalways includespyopenmswith no version pin — builds against latest- No cross-tool imports — each tool is fully independent
- No
__init__.pyfiles — these are NOT Python packages - No tools that duplicate functionality already in OpenMS/pyopenms TOPP tools
Every tool must have:
- Module docstring with description, features, and usage examples
- pyopenms import guard:
import sys try: import pyopenms as oms except ImportError: sys.exit("pyopenms is required. Install it with: pip install pyopenms")
- Importable functions as the primary interface (with type hints and numpy-style docstrings)
main()function with click CLIif __name__ == "__main__": main()guardPROTON = 1.007276constant where mass-to-charge calculations are needed
Every tests/conftest.py must contain:
import sys
import os
import pytest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
try:
import pyopenms # noqa: F401
HAS_PYOPENMS = True
except ImportError:
HAS_PYOPENMS = False
requires_pyopenms = pytest.mark.skipif(not HAS_PYOPENMS, reason="pyopenms not installed")Test files:
- Decorate test classes with
@requires_pyopenmsfrom conftest - Import tool functions inside test methods:
from <tool_name> import <function> - For file-I/O tools: generate synthetic data using pyopenms objects, write to
tempfile.TemporaryDirectory()
Every tool must pass validation in an isolated venv before it can be merged. Run these commands from the repo root:
TOOL_DIR=tools/<domain>/<topic>/<tool_name>
VENV_DIR=$(mktemp -d)
python -m venv "$VENV_DIR"
"$VENV_DIR/bin/python" -m pip install -r "$TOOL_DIR/requirements.txt"
"$VENV_DIR/bin/python" -m pip install pytest ruff
"$VENV_DIR/bin/python" -m ruff check "$TOOL_DIR/"
PYTHONPATH="$TOOL_DIR" "$VENV_DIR/bin/python" -m pytest "$TOOL_DIR/tests/" -v
rm -rf "$VENV_DIR"Both ruff and pytest must pass with zero errors.
Ruff is configured in ruff.toml at the repo root:
- Line length: 120
- Rules: E (pycodestyle errors), F (pyflakes), W (pycodestyle warnings), I (isort)
- Do not add cross-tool imports
- Do not add dependencies to a shared/root requirements file
- Do not create tools that duplicate existing pyopenms CLI tools or OpenMS TOPP tools
- Do not pin pyopenms to a specific version
- Do not add
__init__.pyfiles - Do not add tools that don't actually use pyopenms (pure stats/math tools belong elsewhere)