Skip to main content

ms1isotopes

PyPI License: GPL v3 Tests

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:

  1. Extracts experimental isotope envelopes (m/z + intensity for up to 6 peaks) across the chromatographic elution window
  2. Computes theoretical isotope distributions using the BRAIN algorithm (via brainpy)
  3. Scores similarity between experimental and theoretical distributions using the spectral angle
  4. 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)

Source distribution for ms1isotopes 0.6.0
File Size Uploaded
ms1isotopes-0.6.0.tar.gz 16.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ms1isotopes 0.6.0
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page