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.1

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.1
File Size Uploaded
tacular-2.0.1.tar.gz 600.7 kB Details

Built distribution (wheel)

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

Total release size: 1.0 MB

Release files / tacular-2.0.1.tar.gz

Download URL tacular-2.0.1.tar.gz
Size 600.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9232d130729c650e603edf00364483068f8835d8e79b8e2b29cb9b76ef2e1c29
BLAKE2b-256 checksum
How to use checksums
75281e14125be2b5dac237d3718efd08d6bdf110b609b3c394b2d3b71be34731
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 8, 2026.

Transparency log

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

Download URL tacular-2.0.1-py3-none-any.whl
Size 443.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4014003b28c5548a549badec2ab402ea0dab822d3ce303beb8e685b863b31ac4
BLAKE2b-256 checksum
How to use checksums
9fb1fa0c73a16f82498629e22a07ded0fff17cda46b15af424a5f8c877f7b1ae
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 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.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