Modifications

The modifications modules provide lookups for post-translational modifications from various databases.

Unimod

UnimodLookup (singleton UNIMOD_LOOKUP): id/name/mass lookup over the UNIMOD ontology.

class tacular.unimod.lookup.UnimodLookup(data, version)[source]

Bases: OntologyLookup[UnimodInfo]

Parameters:

UnimodInfo: a UNIMOD ontology entry.

class tacular.unimod.dclass.UnimodInfo(id, name, formula, monoisotopic_mass, average_mass, dict_composition)[source]

Bases: OboEntity

Class to store information about a Unimod modification

Parameters:
  • id (str)

  • name (str)

  • formula (str | None)

  • monoisotopic_mass (float | None)

  • average_mass (float | None)

  • dict_composition (Mapping[str, int] | None)

property id_tag: str

id with leading zeros stripped, e.g. "042" -> "42". Same behavior as OboEntity.id_tag; UNIMOD ids have no extra prefix to strip.

PSI-MOD

PsimodLookup (singleton PSIMOD_LOOKUP): id/name/mass lookup over the PSI-MOD ontology.

class tacular.psimod.lookup.PsimodLookup(data, version)[source]

Bases: OntologyLookup[PsimodInfo]

Parameters:

PsimodInfo: a PSI-MOD ontology entry.

class tacular.psimod.dclass.PsimodInfo(id, name, formula, monoisotopic_mass, average_mass, dict_composition)[source]

Bases: OboEntity

Class to store information about a PSI-MOD modification

Parameters:
  • id (str)

  • name (str)

  • formula (str | None)

  • monoisotopic_mass (float | None)

  • average_mass (float | None)

  • dict_composition (Mapping[str, int] | None)

property id_tag: str

id with leading zeros stripped, e.g. "00007" -> "7". Same behavior as OboEntity.id_tag; PSI-MOD ids have no extra prefix to strip.

RESID

ResidLookup (singleton RESID_LOOKUP): id/name/mass lookup over the RESID ontology, with ids matched with or without the “AA” prefix.

class tacular.resid.lookup.ResidLookup(data, version)[source]

Bases: OntologyLookup[ResidInfo]

Parameters:

ResidInfo: a RESID ontology entry. id_tag strips the “AA” prefix used by RESID ids.

class tacular.resid.dclass.ResidInfo(id, name, formula, monoisotopic_mass, average_mass, dict_composition)[source]

Bases: OboEntity

Class to store information about a RESID modification

Parameters:
  • id (str)

  • name (str)

  • formula (str | None)

  • monoisotopic_mass (float | None)

  • average_mass (float | None)

  • dict_composition (Mapping[str, int] | None)

property id_tag: str

id with a leading “AA” prefix (if present) and leading zeros stripped, e.g. "AA0002" -> "2".

XLMOD

XlModLookup (singleton XLMOD_LOOKUP): id/name/mass lookup over the XLMOD ontology.

class tacular.xlmod.lookup.XlModLookup(data, version)[source]

Bases: OntologyLookup[XlModInfo]

Parameters:

XlModInfo: an XLMOD ontology entry.

class tacular.xlmod.dclass.XlModInfo(id, name, formula, monoisotopic_mass, average_mass, dict_composition)[source]

Bases: OboEntity

Class to store information about an XLMOD modification

Parameters:
  • id (str)

  • name (str)

  • formula (str | None)

  • monoisotopic_mass (float | None)

  • average_mass (float | None)

  • dict_composition (Mapping[str, int] | None)

property id_tag: str

id with leading zeros stripped, e.g. "01000" -> "1000". Same behavior as OboEntity.id_tag; XLMOD ids have no extra prefix to strip.

GNOme

GnoLookup (singleton GNO_LOOKUP): id/name/mass lookup over the GNO ontology.

class tacular.gno.lookup.GnoLookup(data, version)[source]

Bases: OntologyLookup[GnoInfo]

Parameters:
  • data (dict[str, GnoInfo])

  • version (str)

GnoInfo: a GNOme glycan entry. id_tag strips the leading “G” used by GNOme ids.

class tacular.gno.dclass.GnoInfo(id, name, formula, monoisotopic_mass, average_mass, dict_composition)[source]

Bases: OboEntity

Class to store information about a PSI-MOD modification

Parameters:
  • id (str)

  • name (str)

  • formula (str | None)

  • monoisotopic_mass (float | None)

  • average_mass (float | None)

  • dict_composition (Mapping[str, int] | None)

property id_tag: str

id with a leading “G” (if present) and then leading zeros stripped, e.g. "G00008BG" -> "8BG".

UniProt-PTM

UniprotPtmLookup (singleton UNIPROT_PTM_LOOKUP): id/name/mass lookup over UniProt’s PTM list.

class tacular.uniprot_ptm.lookup.UniprotPtmLookup(data, version)[source]

Bases: OntologyLookup[UniprotPtmInfo]

Parameters:
class tacular.uniprot_ptm.dclass.ModLocation(*values)[source]

Bases: StrEnum

Enum for the polypeptide-position values (“PP” field) used by UniProt PTM entries.

ANYWHERE = 'Anywhere.'
CTERM = 'C-terminal.'
NTERM = 'N-terminal.'
PROTEIN_CORE = 'Protein core.'
class tacular.uniprot_ptm.dclass.UniprotPtmInfo(id, name, formula, monoisotopic_mass, average_mass, dict_composition, feature_key=None, target=None, position_aa=None, position_polypeptide=None, cellular_location=None, taxonomic_range=(), keywords=(), cross_references=())[source]

Bases: OboEntity

A UniProt PTM entry (one ptmlist.txt record).

Adds UniProt-specific fields on top of OboEntity’s id/name/ formula/mass/composition; see location and residue for derived single-value views of position_polypeptide and target.

Parameters:
  • id (str)

  • name (str)

  • formula (str | None)

  • monoisotopic_mass (float | None)

  • average_mass (float | None)

  • dict_composition (Mapping[str, int] | None)

  • feature_key (str | None)

  • target (str | None)

  • position_aa (str | None)

  • position_polypeptide (str | None)

  • cellular_location (str | None)

  • taxonomic_range (tuple[str, ...])

  • keywords (tuple[str, ...])

  • cross_references (tuple[str, ...])

cellular_location: str | None

Cellular location (LC), if given.

cross_references: tuple[str, ...]

Cross-reference entries (DR), e.g. "PSI-MOD; MOD:01624.". See has_psimod/get_psimod().

feature_key: str | None

UniProt feature key (FT), e.g. "MOD_RES", "CARBOHYD", "LIPID".

classmethod from_dict(data)[source]

Reconstruct a UniprotPtmInfo from its to_dict representation.

Extends the base id/name/formula/mass/composition fields (see OboEntity.from_dict()) with this ontology’s extra fields, so a value round-tripped through tacular._cache keeps them.

Return type:

Self

Parameters:

data (Mapping[str, Any])

get_psimod()[source]

The cross-referenced PsimodInfo, or None if not cross-referenced (or the referenced id no longer resolves).

Return type:

PsimodInfo | None

get_unimod()[source]

The cross-referenced UnimodInfo, or None if not cross-referenced (or the referenced id no longer resolves).

Return type:

UnimodInfo | None

property has_psimod: bool

Whether this entry cross-references a PSI-MOD id.

property has_unimod: bool

Whether this entry cross-references a UNIMOD id.

property id_tag: str

id with leading zeros stripped, e.g. "0450" -> "450".

keywords: tuple[str, ...]

Keyword entries (KW), one per occurrence.

property location: ModLocation | None

position_polypeptide as a ModLocation, or None if unset or not a single recognized value (e.g. a crosslink’s compound "Anywhere-Protein core.").

position_aa: str | None

Position of the modification on the amino acid (PA), e.g. "Amino acid side chain.".

position_polypeptide: str | None

Position of the modification in the polypeptide (PP). See location.

property residue: AminoAcid | None

target as a single AminoAcid, or None if unset or not one of the 20 standard residues (e.g. an ambiguous "Asparagine or Aspartate." or a crosslink’s compound target).

target: str | None

Target amino acid name (TG), e.g. "Serine.". See residue.

taxonomic_range: tuple[str, ...]

Taxonomic range entries (TR), one per occurrence.

to_dict(float_precision=6)[source]

Convert to a dictionary, extending OboEntity.to_dict() with this ontology’s extra fields (see from_dict() for the inverse).

Note

Calls OboEntity.to_dict(self, ...) explicitly rather than zero-arg super(): @dataclass(slots=True) rebuilds the class object, which leaves zero-arg super() referencing a stale __class__ cell and raises TypeError: super(type, obj): obj must be an instance or subtype of type.

Return type:

dict[str, object]

Parameters:

float_precision (int | None)

update(**kwargs)[source]

Return a new instance with updated fields.

Return type:

Self

Parameters:

kwargs (Any)