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:
data (dict[str, UnimodInfo])
version (str)
UnimodInfo: a UNIMOD ontology entry.
- class tacular.unimod.dclass.UnimodInfo(id, name, formula, monoisotopic_mass, average_mass, dict_composition)[source]
Bases:
OboEntityClass 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 asOboEntity.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:
data (dict[str, PsimodInfo])
version (str)
PsimodInfo: a PSI-MOD ontology entry.
- class tacular.psimod.dclass.PsimodInfo(id, name, formula, monoisotopic_mass, average_mass, dict_composition)[source]
Bases:
OboEntityClass 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 asOboEntity.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:
data (dict[str, ResidInfo])
version (str)
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:
OboEntityClass 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:
data (dict[str, XlModInfo])
version (str)
XlModInfo: an XLMOD ontology entry.
- class tacular.xlmod.dclass.XlModInfo(id, name, formula, monoisotopic_mass, average_mass, dict_composition)[source]
Bases:
OboEntityClass 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 asOboEntity.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:
OboEntityClass 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:
data (dict[str, UniprotPtmInfo])
version (str)
- class tacular.uniprot_ptm.dclass.ModLocation(*values)[source]
Bases:
StrEnumEnum 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:
OboEntityA UniProt PTM entry (one
ptmlist.txtrecord).Adds UniProt-specific fields on top of
OboEntity’s id/name/ formula/mass/composition; seelocationandresiduefor derived single-value views ofposition_polypeptideandtarget.- 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.". Seehas_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_dictrepresentation.Extends the base id/name/formula/mass/composition fields (see
OboEntity.from_dict()) with this ontology’s extra fields, so a value round-tripped throughtacular._cachekeeps them.- Return type:
Self- Parameters:
data (Mapping[str, Any])
- get_psimod()[source]
The cross-referenced
PsimodInfo, orNoneif not cross-referenced (or the referenced id no longer resolves).- Return type:
PsimodInfo|None
- get_unimod()[source]
The cross-referenced
UnimodInfo, orNoneif 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_polypeptideas aModLocation, orNoneif 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). Seelocation.
- property residue: AminoAcid | None
targetas a singleAminoAcid, orNoneif unset or not one of the 20 standard residues (e.g. an ambiguous"Asparagine or Aspartate."or a crosslink’s compound target).
- 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 (seefrom_dict()for the inverse).Note
Calls
OboEntity.to_dict(self, ...)explicitly rather than zero-argsuper():@dataclass(slots=True)rebuilds the class object, which leaves zero-argsuper()referencing a stale__class__cell and raisesTypeError: super(type, obj): obj must be an instance or subtype of type.- Return type:
dict[str,object]- Parameters:
float_precision (int | None)