ResidueModification#
- class pyopenms.ResidueModification#
Bases:
objectRepresentation of a modification on an amino acid residue
- __init__() None#
- __init__(arg: pyopenms.ResidueModification, /) None
Methods
__init__()addSynonym(synonym)Adds a synonym to the unique list
Returns the average mass if set
Returns the difference average mass, or 0.0 if not set
Returns the diff formula if one was set
Returns the diff monoisotopic mass, or 0.0 if not set
Returns the chemical formula if set
Returns the full name of the modification
getId()Returns the identifier of the modification
Return the monoisotopic mass, or 0.0 if not set
getName()Returns the PSI-MS-label if available; e.g. Mascot uses this name.
Returns the neutral loss average weight
Returns the neutral loss diff formula (if available)
Returns the neutral loss mono weight
Returns the origin (i.e. modified amino acid).
Returns the PSI-MOD accession if available
Returns where the definition of this modification came from
Returns the source classification, if none was set, it is unspecific
getSourceClassificationName(classification)Returns the classification
Returns the set of synonyms
Returns terminal specificity
getTermSpecificityName(term_spec)Returns the name of the terminal specificity
Returns the unimod accession if available
Gets the unimod record id
Returns true if a neutral loss formula is set
Returns true if it is a user-defined modification (empty id)
setAverageMass(mass)Sets the average mass
setDiffAverageMass(mass)Sets the difference average mass
setDiffFormula(diff_formula)Sets diff formula (no masses will be changed)
setDiffMonoMass(mass)Sets the difference monoisotopic mass
setFormula(composition)Sets the formula (no masses will be changed)
setFullId([full_id])Sets the full identifier (Unimod Accession + origin, if available)
setFullName(full_name)Sets the full name of the modification; must NOT contain the origin (or .
setId(id)Sets the identifier of the modification
setMonoMass(mass)Sets the monoisotopic mass (this must include the weight of the residue itself!)
setName(name)Sets the name of modification
setNeutralLossAverageMasses(average_masses)Sets the neutral loss average weight
setNeutralLossDiffFormulas(diff_formulas)Sets the neutral loss formula
setNeutralLossMonoMasses(mono_masses)Sets the neutral loss mono weight
setOrigin(origin)Sets the origin (i.e. modified amino acid).
Sets the MOD-XXXXX accession of PSI-MOD
setProvenance(provenance)Sets where the definition of this modification came from
setSourceClassification(classification)Overloaded function.
setSynonyms(synonyms)Sets the synonyms of that modification
setTermSpecificity(term_spec)Overloaded function.
Sets the unimod record id
Attributes
- AA_SUBSTITUTION = 10#
- ANYWHERE = 0#
- ARTIFACT = 0#
- CHEMICAL_DERIVATIVE = 5#
- COTRANSLATIONAL = 13#
- CV = 1#
- C_TERM = 1#
- DEFINED = 0#
- HYPOTHETICAL = 1#
- ISOTOPIC_LABEL = 6#
- MASS_ONLY = 2#
- MULTIPLE = 4#
- NATURAL = 2#
- NLINKED_GLYCOSYLATION = 9#
- NONSTANDARD_RESIDUE = 12#
- NUMBER_OF_PROVENANCE = 3#
- NUMBER_OF_SOURCE_CLASSIFICATIONS = 16#
- NUMBER_OF_TERM_SPECIFICITY = 5#
- N_TERM = 2#
- OLINKED_GLYCOSYLATION = 14#
- OTHER = 11#
- OTHER_GLYCOSYLATION = 8#
- POSTTRANSLATIONAL = 3#
- PRETRANSLATIONAL = 7#
- PROTEIN_C_TERM = 3#
- PROTEIN_N_TERM = 4#
- class Provenance(*values)#
Bases:
IntEnum- CV = 1#
- DEFINED = 0#
- MASS_ONLY = 2#
- NUMBER_OF_PROVENANCE = 3#
- as_integer_ratio()#
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()#
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()#
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()#
Returns self, the complex conjugate of any int.
- denominator#
the denominator of a rational number in lowest terms
- classmethod from_bytes(bytes, byteorder='big', *, signed=False)#
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- getMapping()#
Returns a dict mapping int values to enum member name strings.
- imag#
the imaginary part of a complex number
- is_integer()#
Returns True. Exists for duck type compatibility with float.is_integer.
- numerator#
the numerator of a rational number in lowest terms
- real#
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)#
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- class SourceClassification(*values)#
Bases:
IntEnum- AA_SUBSTITUTION = 10#
- ARTIFACT = 0#
- CHEMICAL_DERIVATIVE = 5#
- COTRANSLATIONAL = 13#
- HYPOTHETICAL = 1#
- ISOTOPIC_LABEL = 6#
- MULTIPLE = 4#
- NATURAL = 2#
- NLINKED_GLYCOSYLATION = 9#
- NONSTANDARD_RESIDUE = 12#
- NUMBER_OF_SOURCE_CLASSIFICATIONS = 16#
- OLINKED_GLYCOSYLATION = 14#
- OTHER = 11#
- OTHER_GLYCOSYLATION = 8#
- POSTTRANSLATIONAL = 3#
- PRETRANSLATIONAL = 7#
- UNKNOWN = 15#
- as_integer_ratio()#
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()#
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()#
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()#
Returns self, the complex conjugate of any int.
- denominator#
the denominator of a rational number in lowest terms
- classmethod from_bytes(bytes, byteorder='big', *, signed=False)#
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- getMapping()#
Returns a dict mapping int values to enum member name strings.
- imag#
the imaginary part of a complex number
- is_integer()#
Returns True. Exists for duck type compatibility with float.is_integer.
- numerator#
the numerator of a rational number in lowest terms
- real#
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)#
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- class TermSpecificity(*values)#
Bases:
IntEnum- ANYWHERE = 0#
- C_TERM = 1#
- NUMBER_OF_TERM_SPECIFICITY = 5#
- N_TERM = 2#
- PROTEIN_C_TERM = 3#
- PROTEIN_N_TERM = 4#
- as_integer_ratio()#
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()#
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()#
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()#
Returns self, the complex conjugate of any int.
- denominator#
the denominator of a rational number in lowest terms
- classmethod from_bytes(bytes, byteorder='big', *, signed=False)#
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- getMapping()#
Returns a dict mapping int values to enum member name strings.
- imag#
the imaginary part of a complex number
- is_integer()#
Returns True. Exists for duck type compatibility with float.is_integer.
- numerator#
the numerator of a rational number in lowest terms
- real#
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)#
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- UNKNOWN = 15#
- addSynonym(synonym: str) None#
Adds a synonym to the unique list
- getAverageMass() float#
Returns the average mass if set
- getDiffAverageMass() float#
Returns the difference average mass, or 0.0 if not set
- getDiffFormula() pyopenms.EmpiricalFormula#
Returns the diff formula if one was set
- getDiffMonoMass() float#
Returns the diff monoisotopic mass, or 0.0 if not set
- getFormula() str#
Returns the chemical formula if set
- getFullId() str#
- getFullName() str#
Returns the full name of the modification
- getId() str#
Returns the identifier of the modification
- getMonoMass() float#
Return the monoisotopic mass, or 0.0 if not set
- getName() str#
Returns the PSI-MS-label if available; e.g. Mascot uses this name
- getNeutralLossAverageMasses() list[float]#
Returns the neutral loss average weight
- getNeutralLossDiffFormulas() list[pyopenms.EmpiricalFormula]#
Returns the neutral loss diff formula (if available)
- getNeutralLossMonoMasses() list[float]#
Returns the neutral loss mono weight
- getOrigin() str#
Returns the origin (i.e. modified amino acid)
- getPSIMODAccession() str#
Returns the PSI-MOD accession if available
- getProvenance() pyopenms.ResidueModification.Provenance#
Returns where the definition of this modification came from
- getSourceClassification() pyopenms.ResidueModification.SourceClassification#
Returns the source classification, if none was set, it is unspecific
- getSourceClassificationName(classification: pyopenms.ResidueModification.SourceClassification) str#
Returns the classification
- getSynonyms() set[str]#
Returns the set of synonyms
- getTermSpecificity() pyopenms.ResidueModification.TermSpecificity#
Returns terminal specificity
- getTermSpecificityName(term_spec: pyopenms.ResidueModification.TermSpecificity) str#
Returns the name of the terminal specificity
- getUniModAccession() str#
Returns the unimod accession if available
- getUniModRecordId() int#
Gets the unimod record id
- hasNeutralLoss() bool#
Returns true if a neutral loss formula is set
- isUserDefined() bool#
Returns true if it is a user-defined modification (empty id)
- setAverageMass(mass: float) None#
Sets the average mass
- setDiffAverageMass(mass: float) None#
Sets the difference average mass
- setDiffFormula(diff_formula: pyopenms.EmpiricalFormula) None#
Sets diff formula (no masses will be changed)
- setDiffMonoMass(mass: float) None#
Sets the difference monoisotopic mass
- setFormula(composition: str) None#
Sets the formula (no masses will be changed)
- setFullId(full_id: str = '') None#
Sets the full identifier (Unimod Accession + origin, if available)
- setFullName(full_name: str) None#
Sets the full name of the modification; must NOT contain the origin (or . for terminals!)
- setId(id: str) None#
Sets the identifier of the modification
- setMonoMass(mass: float) None#
Sets the monoisotopic mass (this must include the weight of the residue itself!)
- setName(name: str) None#
Sets the name of modification
- setNeutralLossAverageMasses(average_masses: collections.abc.Sequence[float]) None#
Sets the neutral loss average weight
- setNeutralLossDiffFormulas(diff_formulas: collections.abc.Sequence[pyopenms.EmpiricalFormula]) None#
Sets the neutral loss formula
- setNeutralLossMonoMasses(mono_masses: collections.abc.Sequence[float]) None#
Sets the neutral loss mono weight
- setOrigin(origin: str) None#
Sets the origin (i.e. modified amino acid)
- setPSIMODAccession(id: str) None#
Sets the MOD-XXXXX accession of PSI-MOD
- setProvenance(provenance: pyopenms.ResidueModification.Provenance) None#
Sets where the definition of this modification came from
- setSourceClassification(classification: str) None#
- setSourceClassification(classification: pyopenms.ResidueModification.SourceClassification) None
Overloaded function.
setSourceClassification(classification: str) -> None
Classification as defined by the PSI-MOD
setSourceClassification(classification: pyopenms.ResidueModification.SourceClassification) -> None
Sets the source classification
- setSynonyms(synonyms: set[str]) None#
Sets the synonyms of that modification
- setTermSpecificity(term_spec: pyopenms.ResidueModification.TermSpecificity) None#
- setTermSpecificity(name: str) None
Overloaded function.
setTermSpecificity(term_spec: pyopenms.ResidueModification.TermSpecificity) -> None
Sets the term specificity
setTermSpecificity(name: str) -> None
Sets the terminal specificity using a name
- setUniModRecordId(id: int) None#
Sets the unimod record id