Peptacular
A Python package for peptide sequence analysis built around ProForma 2.1 notation. Calculate masses, generate fragments, predict isotopic patterns, and more. Peptacular uses type annotations extensively, so it is type safe.
Documentation/ Examples
Features
- ProForma 2.1 Parsing
- Modifiable ProFormaAnnotation Objects (Factory Pattern)
- Mass/Mz/Composition Calculations
- Predicted Isotopic Distributions
- Enzymatic Protein Digestion
- Fragment Ion Generation
- Physiochemical Property Calculations
- Streaming FASTA and Gzip Input
- Indexed Batch Results and Input Diagnostics
- Versioned JSON Serialization
- Optional Pyteomics, psm_utils, and AlphaBase Integrations
- Built-in Parallel Processing
Installation
pip install peptacular
Optional package adapters can be installed separately:
pip install "peptacular[pyteomics]"
pip install "peptacular[psm-utils]"
pip install "peptacular[alphabase]"
See the interoperability guide and JSON serialization guide for supported conversions and examples.
Quick Start (Object Based)
See docs for more detail.
import peptacular as pt
# Parse a sequence into a ProFormaAnnotation
peptide: pt.ProFormaAnnotation = pt.parse("PEM[Oxidation]TIDE")
# Calculate mass and m/z
mass: float = peptide.mass() # 849.343
mz: float = peptide.mz(charge=2) # 425.679
# Chained edits modify the annotation
print(peptide.set_charge(2).set_peptide_name("Peptacular").serialize())
# (>Peptacular)PEM[Oxidation]TIDE/2
Quick Start (Functional Based)
Small lists run sequentially. Larger lists automatically use parallel execution, with explicit backend and worker overrides available.
import peptacular as pt
peptides = ['[Acetyl]-PEPTIDES', '<13C>ARE', 'SICK/2']
# Calculate mass and m/z for all peptides
masses: list[float] = pt.mass(peptides) # [928.4026, 388.2384, 451.2454]
mzs: list[float] = pt.mz(peptides, charge=2) # [465.2086, 195.1265, 225.6227]
For streaming input, optional batch error collection, and operation diagnostics, see the streaming guide.
results = pt.batch("mass", ["PEPTIDE", "PEP[UnknownModification]TIDE"], errors="collect")
print(results[0].value)
print(results[1].error.code) # unresolved_modification
Local MCP integration
Peptacular includes 12 optional MCP tools for agents to inspect annotations,
calculate theoretical properties, digest protein sequences, and transform annotations.
Calls accept small inline batches and return results directly, with no stored data or job setup.
Install with pip install "peptacular[mcp]", then check the installation:
peptacular-mcp --check
See the local MCP guide for Claude Code setup, tool examples, limits, and the boundary with Spectacular's spectrum handling.
ProForma 2.1 Compliance
See PROFORMA_COMPLIANCE.md for detailed compliance status.
Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines on setting up the development environment, code style, testing, and submitting pull requests.
License
MIT
Citation
Working on a JOSS submission, but in the meantime use:
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 peptacular-4.0.0.tar.gz.
File metadata
- Download URL: peptacular-4.0.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5698bcad2af6b097600fbaee16e10e660825988adebc19a7afdeb3e8e77a48e6
|
|
| MD5 |
ed8e9056a12198ec093078c35be4e4b3
|
|
| BLAKE2b-256 |
8f559cd616fc0d9900bf24c8216e144285891d3cd5afefefbe98b94e9f85a669
|
File details
Details for the file peptacular-4.0.0-py3-none-any.whl.
File metadata
- Download URL: peptacular-4.0.0-py3-none-any.whl
- Upload date:
- Size: 213.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd08ed48bdf051f2202fa871c6cc308aa5c4b4e9f117f1113a86dcb3d8e88ba9
|
|
| MD5 |
45dcc8bb6c4e229212a7efcc51c9639d
|
|
| BLAKE2b-256 |
bd166d081980498b5bac330ed74e5ce1165d6e35931b088a062ad97bcfd20fff
|