ModificationsDB#
- class pyopenms.ModificationsDB#
Bases:
object
Cython implementation of _ModificationsDB
Original C++ documentation is available here
- __init__(*args, **kwargs)#
Methods
__init__
(*args, **kwargs)addModification
(self, new_mod)Add a new modification to ModificationsDB.
findModificationIndex
(self, mod_name)Returns the index of the modification in the mods_ vector; a unique name must be given
getAllSearchModifications
(self, modifications)Collects all modifications that can be used for identification searches
getBestModificationByDiffMonoMass
(self, ...)Returns the best matching modification for the given delta mass and residue
Overload:
getNumberOfModifications
(self)Returns the number of modifications read from the unimod.xml file
has
(self, modification)Returns true if the modification exists
isInstantiated
(self)Check whether ModificationsDB was instantiated before
searchModifications
(self, mods, mod_name, ...)Collects all modifications which have the given name as synonym
searchModificationsByDiffMonoMass
(self, ...)Collects all modifications with delta mass inside a tolerance window
- addModification(self, new_mod: ResidueModification) ResidueModification #
Add a new modification to ModificationsDB. If the modification already exists (based on its fullID) it is not added. Returns the modification in the ModificationDB (which can differ from input if mod was already present).
- findModificationIndex(self, mod_name: bytes | str | String) int #
Returns the index of the modification in the mods_ vector; a unique name must be given
- getAllSearchModifications(self, modifications: List[bytes]) None #
Collects all modifications that can be used for identification searches
- getBestModificationByDiffMonoMass(self, mass: float, max_error: float, residue: bytes | str | String, term_spec: int) ResidueModification #
Returns the best matching modification for the given delta mass and residue
Query the modifications DB to get the best matching modification with the given delta mass at the given residue (NULL pointer means no result, maybe the maximal error tolerance needs to be increased). Possible input for CAM modification would be a delta mass of 57 and a residue of “C”.
Note: If there are multiple possible matches with equal masses, it will choose the _first_ match which defaults to the first matching UniMod entry.
- Parameters:
residue – The residue at which the modifications occurs
mass – The monoisotopic mass of the residue including the mass of the modification
max_error – The maximal mass error in the modification search
- Returns:
A pointer to the best matching modification (or NULL if none was found)
- getModification()#
Overload:
- getModification(self, index: int) ResidueModification
Returns the modification with the given index
Overload:
- getModification(self, mod_name: bytes | str | String) ResidueModification
Returns the modification with the given name
Overload:
- getModification(self, mod_name: bytes | str | String, residue: bytes | str | String, term_spec: int) ResidueModification
Returns the modification with the given arguments
- getNumberOfModifications(self) int #
Returns the number of modifications read from the unimod.xml file
- isInstantiated(self) bool #
Check whether ModificationsDB was instantiated before
- searchModifications(self, mods: Set[ResidueModification], mod_name: bytes | str | String, residue: bytes | str | String, term_spec: int) None #
Collects all modifications which have the given name as synonym
If residue is set, only modifications with matching residue of origin are considered If term_spec is set, only modifications with matching term specificity are considered The resulting set of modifications will be empty if no modification exists that fulfills the criteria