Residue#

class pyopenms.Residue#

Bases: object

Representation of an amino acid residue

__init__() → None#
__init__(arg: pyopenms.Residue, /) → None
__init__(arg0: str, arg1: str, arg2: str, arg3: pyopenms.EmpiricalFormula, arg4: float, arg5: float, arg6: float, arg7: float, arg8: float, arg9: float, arg10: set[str], /) → None
__init__(name: str, three_letter_code: str, one_letter_code: str, formula: pyopenms.EmpiricalFormula) → None

Methods

__init__()

addLossFormula(formula)

Adds a neutral loss formula

addLossName(name)

Adds neutral loss molecule name

addNTermLossFormula(formula)

Adds N-terminal losses

addNTermLossName(name)

Adds a N-terminal loss name

addResidueSet(residue_sets)

Adds a residue set to the residue sets

addSynonym(synonym)

Adds a synonym

getAverageWeight(res_type)

Overloaded function.

getBackboneBasicityLeft()

Returns the backbone basicitiy if located in N-terminal direction

getBackboneBasicityRight()

Returns the C-terminal direction backbone basicitiy

getFormula(res_type)

Overloaded function.

getHydrophobicity(scale)

Returns the hydrophobicity value of the residue for the given scale (throws for non-standard residues)

getInternalToAIon()

getInternalToBIon()

getInternalToCIon()

getInternalToCTerm()

getInternalToFull()

getInternalToNTerm()

getInternalToXIon()

getInternalToYIon()

getInternalToZIon()

getLossFormulas()

Returns the neutral loss formulas

getLossNames()

Gets neutral loss name (if there is one, else returns an empty string)

getLowMassIons()

Returns a vector of formulas with the low mass markers of the residue

getModification()

Returns a copy of the modification, or None if unmodified

getModificationName()

Returns the name of the modification to the modification

getMonoWeight(res_type)

Overloaded function.

getNTermLossFormulas()

Returns N-terminal loss formulas

getNTermLossNames()

Returns the N-terminal loss names

getName()

Returns the name of the residue

getOneLetterCode()

Returns the name as one letter code

getPiValue()

Calculates the isoelectric point using the pk values

getPka()

Returns the pka of the residue

getPkb()

Returns the pkb of the residue

getPkc()

Returns the pkc of the residue if it exists otherwise -1

getResidueSets()

Returns the residue sets this residue is contained in

getResidueTypeName(res_type)

Returns the ion name given as a residue type

getSatelliteLossFormula([subtype])

Returns the formula of the satellite side-chain loss (for d/w ions)

getSideChainBasicity()

Returns the side chain basicity

getSynonyms()

Returns the sysnonyms

getThreeLetterCode()

Returns the name of the residue as three letter code

getVLossFormula()

Returns the formula lost in v-ion formation (internal_formula - C2HNO)

hasNTermNeutralLosses()

True if N-terminal neutral losses are set

hasNeutralLoss()

True if the residue has neutral loss

hasSatelliteLoss([subtype])

True if the residue has a beta-gamma satellite loss (for d/w ions)

hasVLoss()

True if the residue can produce a v-ion via complete side-chain loss

isInResidueSet(residue_set)

True if the residue is contained in the set

isModified()

True if the residue is a modified one

residueTypeToIonLetter(res_type)

Helper for mapping residue types to letters for Text annotations and labels

setAverageWeight(weight)

Sets average weight of the residue (must be full, with N and C-terminus)

setBackboneBasicityLeft(gb_bb_l)

Sets the N-terminal direction backbone basicitiy

setBackboneBasicityRight(gb_bb_r)

Sets the C-terminal direction backbone basicity

setFormula(formula)

Sets empirical formula of the residue (must be full, with N and C-terminus)

setLossFormulas(formulas)

Sets the neutral loss formulas

setLossNames(name)

Sets the neutral loss molecule name

setLowMassIons(low_mass_ions)

Sets the low mass marker ions as a vector of formulas

setModification(name)

Overloaded function.

setModificationByDiffMonoMass(diffMonoMass)

Sets the modification by monoisotopic mass difference in Da; checks if present in ModificationsDB with tolerance and adds a "user-defined" modification if not (for later lookups).

setMonoWeight(weight)

Sets monoisotopic weight of the residue (must be full, with N and C-terminus)

setNTermLossFormulas(formulas)

Sets the N-terminal losses

setNTermLossNames(name)

Sets the N-terminal loss names

setName(name)

Sets the name of the residue

setOneLetterCode(one_letter_code)

Sets the name as one letter code

setPka(value)

Sets the pka of the residue

setPkb(value)

Sets the pkb of the residue

setPkc(value)

Sets the pkc of the residue

setResidueSets(residues_sets)

Sets the residue sets the amino acid is contained in

setSideChainBasicity(gb_sc)

Sets the side chain basicity

setSynonyms(synonyms)

Sets the synonyms

setThreeLetterCode(three_letter_code)

Sets the name of the residue as three letter code

toString()

Returns the residue as string (one letter code with optional modification)

Attributes

AIon = 4#
BIon = 5#
BIonMinusH20 = 13#
BIonMinusNH3 = 15#
CIon = 6#
CTerminal = 3#
DIon = 19#
Full = 0#
Internal = 1#
NTerminal = 2#
NonIdentified = 17#
Precursor = 12#
class ResidueType(*values)#

Bases: IntEnum

AIon = 4#
BIon = 5#
BIonMinusH20 = 13#
BIonMinusNH3 = 15#
CIon = 6#
CTerminal = 3#
DIon = 19#
Full = 0#
Internal = 1#
NTerminal = 2#
NonIdentified = 17#
Precursor = 12#
SizeOfResidueType = 22#
Unannotated = 18#
VIon = 20#
WIon = 21#
XIon = 7#
YIon = 8#
YIonMinusH20 = 14#
YIonMinusNH3 = 16#
ZIon = 9#
Zp1Ion = 10#
Zp2Ion = 11#
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.

SizeOfResidueType = 22#
Unannotated = 18#
VIon = 20#
WIon = 21#
XIon = 7#
YIon = 8#
YIonMinusH20 = 14#
YIonMinusNH3 = 16#
ZIon = 9#
Zp1Ion = 10#
Zp2Ion = 11#
addLossFormula(formula: pyopenms.EmpiricalFormula) → None#

Adds a neutral loss formula

addLossName(name: str) → None#

Adds neutral loss molecule name

addNTermLossFormula(formula: pyopenms.EmpiricalFormula) → None#

Adds N-terminal losses

addNTermLossName(name: str) → None#

Adds a N-terminal loss name

addResidueSet(residue_sets: str) → None#

Adds a residue set to the residue sets

addSynonym(synonym: str) → None#

Adds a synonym

getAverageWeight(res_type: pyopenms.Residue.ResidueType) → float#
getAverageWeight() → float

Overloaded function.

  1. getAverageWeight(res_type: pyopenms.Residue.ResidueType) -> float

  2. getAverageWeight() -> float

Returns the average weight of the full residue (ResidueType.Full)

getBackboneBasicityLeft() → float#

Returns the backbone basicitiy if located in N-terminal direction

getBackboneBasicityRight() → float#

Returns the C-terminal direction backbone basicitiy

getFormula(res_type: pyopenms.Residue.ResidueType) → pyopenms.EmpiricalFormula#
getFormula() → pyopenms.EmpiricalFormula

Overloaded function.

  1. getFormula(res_type: pyopenms.Residue.ResidueType) -> pyopenms.EmpiricalFormula

  2. getFormula() -> pyopenms.EmpiricalFormula

Returns the formula of the full residue (ResidueType.Full)

getHydrophobicity(scale: pyopenms.HydrophobicityScaleMethod) → float#

Returns the hydrophobicity value of the residue for the given scale (throws for non-standard residues)

static getInternalToAIon() → pyopenms.EmpiricalFormula#
static getInternalToBIon() → pyopenms.EmpiricalFormula#
static getInternalToCIon() → pyopenms.EmpiricalFormula#
static getInternalToCTerm() → pyopenms.EmpiricalFormula#
static getInternalToFull() → pyopenms.EmpiricalFormula#
static getInternalToNTerm() → pyopenms.EmpiricalFormula#
static getInternalToXIon() → pyopenms.EmpiricalFormula#
static getInternalToYIon() → pyopenms.EmpiricalFormula#
static getInternalToZIon() → pyopenms.EmpiricalFormula#
getLossFormulas() → list[pyopenms.EmpiricalFormula]#

Returns the neutral loss formulas

getLossNames() → list[str]#

Gets neutral loss name (if there is one, else returns an empty string)

getLowMassIons() → list[pyopenms.EmpiricalFormula]#

Returns a vector of formulas with the low mass markers of the residue

getModification() → pyopenms.ResidueModification | None#

Returns a copy of the modification, or None if unmodified

getModificationName() → str#

Returns the name of the modification to the modification

getMonoWeight(res_type: pyopenms.Residue.ResidueType) → float#
getMonoWeight() → float

Overloaded function.

  1. getMonoWeight(res_type: pyopenms.Residue.ResidueType) -> float

  2. getMonoWeight() -> float

Returns the monoisotopic weight of the full residue (ResidueType.Full)

getNTermLossFormulas() → list[pyopenms.EmpiricalFormula]#

Returns N-terminal loss formulas

getNTermLossNames() → list[str]#

Returns the N-terminal loss names

getName() → str#

Returns the name of the residue

getOneLetterCode() → str#

Returns the name as one letter code

getPiValue() → float#

Calculates the isoelectric point using the pk values

getPka() → float#

Returns the pka of the residue

getPkb() → float#

Returns the pkb of the residue

getPkc() → float#

Returns the pkc of the residue if it exists otherwise -1

getResidueSets() → set[str]#

Returns the residue sets this residue is contained in

static getResidueTypeName(res_type: pyopenms.Residue.ResidueType) → str#

Returns the ion name given as a residue type

getSatelliteLossFormula(subtype: str = '') → pyopenms.EmpiricalFormula#

Returns the formula of the satellite side-chain loss (for d/w ions)

getSideChainBasicity() → float#

Returns the side chain basicity

getSynonyms() → set[str]#

Returns the sysnonyms

getThreeLetterCode() → str#

Returns the name of the residue as three letter code

getVLossFormula() → pyopenms.EmpiricalFormula#

Returns the formula lost in v-ion formation (internal_formula - C2HNO)

hasNTermNeutralLosses() → bool#

True if N-terminal neutral losses are set

hasNeutralLoss() → bool#

True if the residue has neutral loss

hasSatelliteLoss(subtype: str = '') → bool#

True if the residue has a beta-gamma satellite loss (for d/w ions)

hasVLoss() → bool#

True if the residue can produce a v-ion via complete side-chain loss

isInResidueSet(residue_set: str) → bool#

True if the residue is contained in the set

isModified() → bool#

True if the residue is a modified one

static residueTypeToIonLetter(res_type: pyopenms.Residue.ResidueType) → str#

Helper for mapping residue types to letters for Text annotations and labels

setAverageWeight(weight: float) → None#

Sets average weight of the residue (must be full, with N and C-terminus)

setBackboneBasicityLeft(gb_bb_l: float) → None#

Sets the N-terminal direction backbone basicitiy

setBackboneBasicityRight(gb_bb_r: float) → None#

Sets the C-terminal direction backbone basicity

setFormula(formula: pyopenms.EmpiricalFormula) → None#

Sets empirical formula of the residue (must be full, with N and C-terminus)

setLossFormulas(formulas: collections.abc.Sequence[pyopenms.EmpiricalFormula]) → None#

Sets the neutral loss formulas

setLossNames(name: list[str]) → None#

Sets the neutral loss molecule name

setLowMassIons(low_mass_ions: collections.abc.Sequence[pyopenms.EmpiricalFormula]) → None#

Sets the low mass marker ions as a vector of formulas

setModification(name: str) → None#
setModification(mod: pyopenms.ResidueModification) → None
setModification(mod: pyopenms.ResidueModification) → None

Overloaded function.

  1. setModification(name: str) -> None

Sets the modification by name; the mod should be present in ModificationsDB

  1. setModification(mod: pyopenms.ResidueModification) -> None

Sets the modification. The modification is interned into ModificationsDB, so a copy is stored rather than the object passed in

  1. setModification(mod: pyopenms.ResidueModification) -> None

Sets the modification by a ResidueModification object; checks if present in ModificationsDB and adds if not.

setModificationByDiffMonoMass(diffMonoMass: float) → None#

Sets the modification by monoisotopic mass difference in Da; checks if present in ModificationsDB with tolerance and adds a “user-defined” modification if not (for later lookups).

setMonoWeight(weight: float) → None#

Sets monoisotopic weight of the residue (must be full, with N and C-terminus)

setNTermLossFormulas(formulas: collections.abc.Sequence[pyopenms.EmpiricalFormula]) → None#

Sets the N-terminal losses

setNTermLossNames(name: list[str]) → None#

Sets the N-terminal loss names

setName(name: str) → None#

Sets the name of the residue

setOneLetterCode(one_letter_code: str) → None#

Sets the name as one letter code

setPka(value: float) → None#

Sets the pka of the residue

setPkb(value: float) → None#

Sets the pkb of the residue

setPkc(value: float) → None#

Sets the pkc of the residue

setResidueSets(residues_sets: set[str]) → None#

Sets the residue sets the amino acid is contained in

setSideChainBasicity(gb_sc: float) → None#

Sets the side chain basicity

setSynonyms(synonyms: set[str]) → None#

Sets the synonyms

setThreeLetterCode(three_letter_code: str) → None#

Sets the name of the residue as three letter code

toString() → str#

Returns the residue as string (one letter code with optional modification)