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.1.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 tacular 2.1.0
File Size Uploaded Provenance Actions
tacular-2.1.0.tar.gz 602.6 kB With provenance Details for tacular-2.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.0 MB

Release files / tacular-2.1.0.tar.gz

Download URL tacular-2.1.0.tar.gz
Size 602.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f36f66cbecc6b7674cf003bd90f4ace1f4b09c91b6fc18baac4fb129f5bd30bd
BLAKE2b-256 checksum
How to use checksums
897687dad39e8da779f6b5f5772a9dcd621e3687abe435110bb25e27ba574206
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 7, 2026.

Transparency log

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

Download URL tacular-2.1.0-py3-none-any.whl
Size 444.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02151bd3bde88663b8b98f804682fd515953a316bd81af4eb558ac7a9016e85e
BLAKE2b-256 checksum
How to use checksums
23815614662c6b8083f7d50ce240720761e6d491408287c959d8a5af0e6ce6d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 7, 2026.

Transparency log

Security for tacular 2.1.0

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tacular-2.1.0.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 Nov 7, 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