Precursor#

class pyopenms.Precursor#

Bases: CVTermList

Precursor meta information

This class contains precursor information:

  • isolation window

  • activation

  • selected ion (m/z, intensity, charge, possible charge states)

  • ion mobility drift time

__init__() → None#
__init__(arg: pyopenms.Precursor, /) → None

Methods

__init__()

activationMethodToShortString(m)

Convert an ActivationMethod enum to its short (abbreviated) name string

activationMethodToString(m)

Convert an ActivationMethod enum to its full name string

addCVTerm(term)

Adds a CV term

clearMetaInfo()

Removes all meta values

consumeCVTerms(cv_term_map)

Merges the given map into the member map, no duplicate checking

empty()

getActivationEnergy()

Returns the activation energy (in electronvolt)

getActivationMethods()

Returns the activation methods

getActivationMethodsAsShortString()

Returns the abbreviations (e.g., "CID") of the activation methods set on this instance

getActivationMethodsAsString()

Returns the full names (e.g., "Collision-induced dissociation") of the activation methods set on this instance

getAllNamesOfActivationMethods()

Returns the full names (e.g., "Collision-induced dissociation") of ALL possible activation methods, not just those set on this instance

getAllShortNamesOfActivationMethods()

Returns the abbreviations (e.g., "CID") of ALL possible activation methods, not just those set on this instance

getCVTerms()

Returns a copy of the CV terms, keyed by CV accession

getCharge()

Returns the charge

getDriftTime()

Returns the ion mobility drift time in milliseconds (-1 means it is not set)

getDriftTimeWindowLowerOffset()

Returns the lower offset from the target ion mobility in milliseconds

getDriftTimeWindowUpperOffset()

Returns the upper offset from the target ion mobility in milliseconds

getIntensity()

Overloaded function.

getIsolationWindowLowerOffset()

Returns the lower offset from the target m/z

getIsolationWindowUpperOffset()

Returns the upper offset from the target m/z

getKeys(keys)

Overloaded function.

getMZ()

Overloaded function.

getMetaValue(name)

Returns the value corresponding to a string, or DataValue::EMPTY if not found

getPos()

Overloaded function.

getPossibleChargeStates()

Returns the possible charge states

getUnchargedMass()

Returns the uncharged mass of the precursor, if charge is unknown, i.e. 0 best guess is its doubly charged.

hasCVTerm(accession)

isMetaEmpty()

Returns if the MetaInfo is empty

metaRegistry()

Returns a reference to the MetaInfoRegistry

metaValueExists(name)

Returns whether an entry with the given name exists

removeMetaValue(name)

Removes the DataValue corresponding to name if it exists

replaceCVTerm(cv_term)

Replaces the specified CV term

replaceCVTerms(cv_term_map)

setActivationEnergy(activation_energy)

Sets the activation energy (in electronvolt)

setActivationMethods(activation_methods)

Sets the activation methods

setCVTerms(terms)

Sets the CV terms from a vector

setCharge(charge)

Sets the charge

setDriftTime(drift_time)

Sets the ion mobility drift time in milliseconds

setDriftTimeWindowLowerOffset(drift_time)

Sets the lower offset from the target ion mobility

setDriftTimeWindowUpperOffset(drift_time)

Sets the upper offset from the target ion mobility

setIntensity(intensity)

Overloaded function.

setIsolationWindowLowerOffset(bound)

Sets the lower offset from the target m/z

setIsolationWindowUpperOffset(bound)

Sets the upper offset from the target m/z

setMZ(mz)

Overloaded function.

setMetaValue(name, value)

Sets the DataValue corresponding to a name

setPos(pos)

Overloaded function.

setPossibleChargeStates(possible_charge_states)

Sets the possible charge states

toActivationMethod(name)

Convert a string (full name or short name) to an ActivationMethod enum

class ActivationMethod(*values)#

Bases: Enum

BIRD = 4#
CID = 0#
ECD = 5#
ETD = 11#
ETciD = 12#
EThcD = 13#
HCD = 16#
HCID = 8#
IMD = 6#
INSOURCE = 17#
LCID = 9#
LIFT = 18#
PD = 2#
PHD = 10#
PQD = 14#
PSD = 1#
SID = 3#
SIZE_OF_ACTIVATIONMETHOD = 19#
SORI = 7#
TRAP = 15#
getMapping()#

Returns a dict mapping int values to enum member name strings.

static activationMethodToShortString(m: pyopenms.Precursor.ActivationMethod) → str#

Convert an ActivationMethod enum to its short (abbreviated) name string

static activationMethodToString(m: pyopenms.Precursor.ActivationMethod) → str#

Convert an ActivationMethod enum to its full name string

addCVTerm(term: pyopenms.CVTerm) → None#

Adds a CV term

clearMetaInfo() → None#

Removes all meta values

consumeCVTerms(cv_term_map: dict[str, collections.abc.Sequence[pyopenms.CVTerm]]) → None#

Merges the given map into the member map, no duplicate checking

empty() → bool#
getActivationEnergy() → float#

Returns the activation energy (in electronvolt)

getActivationMethods() → set[pyopenms.Precursor.ActivationMethod]#

Returns the activation methods

getActivationMethodsAsShortString() → list[str]#

Returns the abbreviations (e.g., “CID”) of the activation methods set on this instance

getActivationMethodsAsString() → list[str]#

Returns the full names (e.g., “Collision-induced dissociation”) of the activation methods set on this instance

static getAllNamesOfActivationMethods() → list[str]#

Returns the full names (e.g., “Collision-induced dissociation”) of ALL possible activation methods, not just those set on this instance

static getAllShortNamesOfActivationMethods() → list[str]#

Returns the abbreviations (e.g., “CID”) of ALL possible activation methods, not just those set on this instance

getCVTerms() → dict[str, list[pyopenms.CVTerm]]#

Returns a copy of the CV terms, keyed by CV accession

getCharge() → int#

Returns the charge

getDriftTime() → float#

Returns the ion mobility drift time in milliseconds (-1 means it is not set)

getDriftTimeWindowLowerOffset() → float#

Returns the lower offset from the target ion mobility in milliseconds

getDriftTimeWindowUpperOffset() → float#

Returns the upper offset from the target ion mobility in milliseconds

getIntensity() → float#
getIntensity() → float

Overloaded function.

  1. getIntensity() -> float

Returns the intensity (height) of the peak

  1. getIntensity() -> float

Returns the intensity

getIsolationWindowLowerOffset() → float#

Returns the lower offset from the target m/z

getIsolationWindowUpperOffset() → float#

Returns the upper offset from the target m/z

getKeys(keys: list) → None#
getKeys() → list

Overloaded function.

  1. getKeys(keys: list) -> None

Fills the given list with all meta value keys

  1. getKeys() -> list

Returns all meta value keys as a list

getMZ() → float#
getMZ() → float

Overloaded function.

  1. getMZ() -> float

Returns the m/z (mass-to-charge) value of the peak

  1. getMZ() -> float

Returns the m/z

getMetaValue(name: str) → None | int | float | str | bytes | list[str] | list[int] | list[float]#

Returns the value corresponding to a string, or DataValue::EMPTY if not found

getPos() → float#
getPos() → float

Overloaded function.

  1. getPos() -> float

Returns the position (alias for getMZ)

  1. getPos() -> float

Returns the position (m/z)

getPossibleChargeStates() → list[int]#

Returns the possible charge states

getUnchargedMass() → float#

Returns the uncharged mass of the precursor, if charge is unknown, i.e. 0 best guess is its doubly charged

hasCVTerm(accession: str) → bool#
isMetaEmpty() → bool#

Returns if the MetaInfo is empty

static metaRegistry() → pyopenms.MetaInfoRegistry#

Returns a reference to the MetaInfoRegistry

metaValueExists(name: str) → bool#

Returns whether an entry with the given name exists

removeMetaValue(name: str) → None#

Removes the DataValue corresponding to name if it exists

replaceCVTerm(cv_term: pyopenms.CVTerm) → None#

Replaces the specified CV term

replaceCVTerms(cv_term_map: dict[str, collections.abc.Sequence[pyopenms.CVTerm]]) → None#
setActivationEnergy(activation_energy: float) → None#

Sets the activation energy (in electronvolt)

setActivationMethods(activation_methods: collections.abc.Set[pyopenms.Precursor.ActivationMethod]) → None#

Sets the activation methods

setCVTerms(terms: collections.abc.Sequence[pyopenms.CVTerm]) → None#

Sets the CV terms from a vector

setCharge(charge: int) → None#

Sets the charge

setDriftTime(drift_time: float) → None#

Sets the ion mobility drift time in milliseconds

setDriftTimeWindowLowerOffset(drift_time: float) → None#

Sets the lower offset from the target ion mobility

setDriftTimeWindowUpperOffset(drift_time: float) → None#

Sets the upper offset from the target ion mobility

setIntensity(intensity: float) → None#
setIntensity(intensity: float) → None

Overloaded function.

  1. setIntensity(intensity: float) -> None

Sets the intensity (height) of the peak

  1. setIntensity(intensity: float) -> None

Sets the intensity

setIsolationWindowLowerOffset(bound: float) → None#

Sets the lower offset from the target m/z

setIsolationWindowUpperOffset(bound: float) → None#

Sets the upper offset from the target m/z

setMZ(mz: float) → None#
setMZ(mz: float) → None

Overloaded function.

  1. setMZ(mz: float) -> None

Sets the m/z (mass-to-charge) value of the peak

  1. setMZ(mz: float) -> None

Sets the m/z

setMetaValue(name: str, value: None | int | float | str | bytes | list[str] | list[int] | list[float]) → None#

Sets the DataValue corresponding to a name

setPos(pos: float) → None#
setPos(pos: float) → None

Overloaded function.

  1. setPos(pos: float) -> None

Sets the position (alias for setMZ)

  1. setPos(pos: float) -> None

Sets the position (m/z)

setPossibleChargeStates(possible_charge_states: collections.abc.Sequence[int]) → None#

Sets the possible charge states

static toActivationMethod(name: str) → pyopenms.Precursor.ActivationMethod#

Convert a string (full name or short name) to an ActivationMethod enum