ms1isotopes
A Python package for extracting and evaluating MS1 isotope distributions from LC-MS/MS proteomics data.
What it does
Given an mzML file and a list of peptide identifications, ms1isotopes:
- Extracts experimental isotope envelopes (m/z + intensity for up to 6 peaks) across the chromatographic elution window
- Computes theoretical isotope distributions using the
BRAIN algorithm (via
brainpy) - Scores similarity between experimental and theoretical distributions using the spectral angle
- Outputs annotated results in Excel, TSV, or hierarchical JSON
Installation
pip install ms1isotopes
Dependencies
- Python ≥ 3.9
- numpy, pandas, numba
- pyteomics (for mzML parsing)
- lxml (XML backend for pyteomics)
- brainpy (brain-isotopic-distribution)
- openpyxl (for Excel I/O)
Quick start
Command line
ms1isotopes extract \
-m sample.mzML \
-i identifications.xlsx \
-o results \
--tolerance 5
This produces results.xlsx, results.tsv, and results.json.
Python API
import ms1isotopes
# Load input list (Excel, CSV, or TSV)
input_list = ms1isotopes.read_input_list("identifications.xlsx")
# Run extraction
results = ms1isotopes.extract_ms1_isotope_distributions(
mzml_path="sample.mzML",
input_list=input_list,
tolerance_ppm=5.0,
n_isotopes=6,
)
# Save results
ms1isotopes.results_to_excel(results, "output.xlsx")
ms1isotopes.results_to_json(results, "output.json")
Computing isotope distributions without mzML data
import ms1isotopes
import numpy as np
# Peptide → atomic composition
comp = ms1isotopes.sequence_to_composition(
"PEPTIDE", charge_state=2, n_carbamidomethyl=0
)
# → {'C': 34, 'H': 57, 'N': 7, 'O': 15, 'S': 0}
# Theoretical isotope distribution (via BRAIN)
mz_values, intensities = ms1isotopes.theoretical_isotope_distribution(comp, n_peaks=6)
# Spectral angle against experimental data
experimental = np.array([10000, 5500, 2000, 500, np.nan, np.nan])
sa = ms1isotopes.spectral_angle(intensities, experimental)
Input list format
The input list must contain these columns:
| Column | Description |
|---|---|
Peptide_Sequence |
Amino acid sequence (single-letter codes) |
Charge_State |
Precursor charge state |
Modifications |
PTMs, e.g. C(57.0214)M(15.9949) or empty |
RetentionTime |
PSM retention time (seconds) |
RetentionTimeWindowBefore |
Extraction window before RT (seconds) |
RetentionTimeWindowAfter |
Extraction window after RT (seconds) |
Optional columns: MZ (observed m/z), ErrorTolerance (ppm).
Output columns
The output DataFrame contains experimental isotope peaks, theoretical distributions from BRAIN, atomic composition, spectral angle, peak counts, and metadata. See the documentation for the full schema.
Testing
pip install ms1isotopes[dev]
pytest tests/
Citation
If you use ms1isotopes in your research, please cite:
[Work in progress]
License
GPLv3. See LICENSE for details.
Metadata
Release files for ms1isotopes 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ms1isotopes-0.6.0.tar.gz | 16.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ms1isotopes-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.1 kB
Release files / ms1isotopes-0.6.0.tar.gz
| Download URL | ms1isotopes-0.6.0.tar.gz |
|---|---|
| Size | 16.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
08660eeab7a93bf192d83361a13838f22d442f915e07697eec4a336ea171e95a
|
|
BLAKE2b-256 checksum How to use checksums |
9051ea21042e6965bb95023682547c7a8876d046528ec841a4e94b16109e759b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency logRelease files / ms1isotopes-0.6.0-py3-none-any.whl
| Download URL | ms1isotopes-0.6.0-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
356e010e18708e37c19e11e6e4f07d8a21ae2f5015c387fa5ce783cc4240ef6e
|
|
BLAKE2b-256 checksum How to use checksums |
87e3e060f9f4b1a6dcb764e5b8ca4c723c15dd5bd47bcf52ff7fd36490a5c942
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency log