Skip to main content

tacular

tacular Logo

Python package codecov Documentation Status PyPI version Python 3.12+ License DOI

tacular is a lookup library for the reference data every mass-spec/proteomics tool needs: amino acids, elements and isotopes, and post-translational modification ontologies (UNIMOD, PSI-MOD, RESID, XLMOD, GNOme, UniProt-PTM). It has no runtime dependencies, so it's an easy way to add "what modification has a delta mass of X" or "what's the monoisotopic mass of alanine" to any Python project. It's also the shared data layer behind peptacular (ProForma peptide sequences) and paftacular (mzPAF fragment annotations).

Why tacular?

  • Six PTM ontologies in one interface — UNIMOD, PSI-MOD, RESID, XLMOD, GNOme, and UniProt-PTM, all queryable by id, name, or approximate mass.
  • Amino acid, element, ion-type, neutral-loss, protease, and mzPAF reference molecule lookups, through the same simple LOOKUP[key] interface.
  • No runtime dependencies.
  • Refreshable without reinstalling: data ships baked into the package, and the tacular update CLI can pull the latest ontology release into a per-user cache on demand.
  • Typed (py.typed) dataclasses for every entry.

Install

pip install tacular

Quick example

import tacular as t

# Look up amino acids and elements by code or name
alanine = t.AA_LOOKUP["A"]
print(alanine.monoisotopic_mass)  # 71.0371137851

carbon_13 = t.ELEMENT_LOOKUP["13C"]
print(carbon_13.mass)  # 13.00335483507

# Identify a modification from an observed mass shift
hits = t.UNIMOD_LOOKUP.query_mass(79.9663, tolerance=0.001)
print(hits[0].name)  # Phospho
print([m.name for m in t.UNIMOD_LOOKUP.query_mass(79.9663, tolerance=10, tolerance_unit="ppm")])  # ['Phospho']

# Mass tolerance helpers (units are "da" or "ppm")
print(round(t.ppm_error(1000.01, 1000.0), 6))  # 10.0
print(t.within_tolerance(1000.005, 1000.0, 10, tolerance_unit="ppm"))  # True

Every lookup has the same interface: LOOKUP[key], .get(key, default), in, len, .keys(), .values() and .items(). A miss raises tacular.TacularKeyError, which is both a KeyError and a ValueError. Physical constants such as PROTON_MASS are in tacular.constants.

What else it can do

  • Query PSI-MOD, RESID, XLMOD, GNOme, and UniProt-PTM the same way as UNIMOD above.

  • Convert and compare mass errors: ppm_error, da_to_ppm, ppm_to_da, tolerance_window and within_tolerance (tacular.tolerance).

  • Isobaric tags and SILAC labels: t.ISOBARIC_TAG_LOOKUP["TMT10"].reporter_mzs, t.SILAC_LOOKUP.get_set("heavy"), with UNIMOD ids and masses computed from the element table.

  • Look up fragment ion types, common neutral losses, mzPAF reference molecules, and protease cleavage patterns.

  • Refresh any ontology to its latest upstream release without reinstalling:

    tacular update                 # refresh all six ontologies (includes GNOme, a ~129 MB download)
    tacular update unimod xlmod    # refresh a subset (skips GNOme unless named)
    tacular status                 # show bundled vs. cached versions
    tacular clear                  # revert to the bundled data
    

    The refresh takes effect the first time a Python process uses that ontology (e.g. t.UNIMOD_LOOKUP); an ontology already loaded in a running process keeps its data. See the docs for the full CLI reference (including --offline, verbosity flags, and cache environment variables) and the complete lookup API.

Documentation

Funding

Supported by NIH grants R01AG077046, R01MH132570, R01MH100175, R01HL165168 and U01AG088679.

Metadata

Release files for tacular 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tacular 2.0.2
File Size Uploaded Provenance Actions
tacular-2.0.2.tar.gz 600.8 kB With provenance Details for tacular-2.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tacular 2.0.2
File Interpreter ABI Platform Actions
tacular-2.0.2-py3-none-any.whl Python 3 none any Details for tacular-2.0.2-py3-none-any.whl

Total release size: 1.0 MB

Release files / tacular-2.0.2.tar.gz

Download URL tacular-2.0.2.tar.gz
Size 600.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c185999e75db6099b3778058baf32bc38d03f29f7db5c9b0da77fd1da9741cdc
BLAKE2b-256 checksum
How to use checksums
ef0f8095f57d1aea8e50c9e076b8aa9251acce53c57ea748155ef46450079fec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 28, 2026.

Transparency log

Release files / tacular-2.0.2-py3-none-any.whl

Download URL tacular-2.0.2-py3-none-any.whl
Size 443.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79b194fa9b1a667e4dee3ed93a4b16cc860e8003ac56101bb92890031145b211
BLAKE2b-256 checksum
How to use checksums
ca6a0d370adc6a7e72c999009dd89274bad26c5f4a4591e4a02347e37975b93a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 28, 2026.

Transparency log

Security for tacular 2.0.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tacular-2.0.2.tar.gz

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 Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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