Extract and evaluate MS1 isotope distributions from LC-MS/MS proteomics data
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ms1isotopes-0.3.0.tar.gz.
File metadata
- Download URL: ms1isotopes-0.3.0.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7468dd7a81944aa5efc7fa219917276de56f2c0a1534516bd3c212f36ebd725
|
|
| MD5 |
f978d89bdecadf26257e754a6ea69572
|
|
| BLAKE2b-256 |
86e9673a2dff8200704772ea8a9389d1eaf0053ecddf755aeaa7fdb0683ffff7
|
Provenance
The following attestation bundles were made for ms1isotopes-0.3.0.tar.gz:
Publisher:
publish.yml on VilenneFrederique/ms1isotopes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ms1isotopes-0.3.0.tar.gz -
Subject digest:
d7468dd7a81944aa5efc7fa219917276de56f2c0a1534516bd3c212f36ebd725 - Sigstore transparency entry: 1203445506
- Sigstore integration time:
-
Permalink:
VilenneFrederique/ms1isotopes@7e3ca0bf6d286e7bcef5ad3a4dcf5759a4c55a16 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/VilenneFrederique
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7e3ca0bf6d286e7bcef5ad3a4dcf5759a4c55a16 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ms1isotopes-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ms1isotopes-0.3.0-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
122411e4fd4f681c4fffaa9ae1a5d8003fb94ca2f8c14c0681dc9bfb449156e1
|
|
| MD5 |
28efddc2f2398079772706b3e56f9b6f
|
|
| BLAKE2b-256 |
4f2adb746cbdb785483e7753606a5b93573d6a466f0e5d484d48fb561420d264
|
Provenance
The following attestation bundles were made for ms1isotopes-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on VilenneFrederique/ms1isotopes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ms1isotopes-0.3.0-py3-none-any.whl -
Subject digest:
122411e4fd4f681c4fffaa9ae1a5d8003fb94ca2f8c14c0681dc9bfb449156e1 - Sigstore transparency entry: 1203445507
- Sigstore integration time:
-
Permalink:
VilenneFrederique/ms1isotopes@7e3ca0bf6d286e7bcef5ad3a4dcf5759a4c55a16 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/VilenneFrederique
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7e3ca0bf6d286e7bcef5ad3a4dcf5759a4c55a16 -
Trigger Event:
release
-
Statement type: