MRMFeature#

class pyopenms.MRMFeature#

Bases: Feature

OpenMS class MRMFeature

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

Methods

__init__()

addFeature(f, key)

Adds a transition feature to this MRM feature

addPrecursorFeature(f, key)

Adds a precursor feature to this MRM feature

clearMetaInfo()

Removes all meta values

clearUniqueId()

Clear the unique id.

encloses(rt, mz)

Checks if the feature's convex hulls enclose a given position

ensureUniqueId()

Assigns a valid unique id, but only if the present one is invalid.

getAnnotationState()

Returns the annotation state of the feature

getCharge()

Returns the charge state of the feature

getConvexHull()

Returns the overall convex hull of the feature

getConvexHulls()

Returns the convex hulls of individual mass traces

getFeature(key)

Retrieves a transition feature by its native ID

getFeatureIDs(output)

Overloaded function.

getFeatures()

Returns all transition features in this MRM feature

getIntensity()

Overloaded function.

getKeys(keys)

Overloaded function.

getMZ()

Overloaded function.

getMetaValue(name)

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

getOverallQuality()

Returns the overall quality score of the feature

getPeptideIdentifications()

Returns the peptide identifications associated with this feature

getPrecursorFeature(key)

Retrieves a precursor feature by its native ID

getPrecursorFeatureIDs()

Retrieves the native IDs of all precursor features

getQuality(index)

Returns the quality score in a specific dimension

getRT()

Overloaded function.

getScores()

Returns the peak group quality scores

getSubordinates()

Returns subordinate features (e.g., isotopic peaks)

getUniqueId()

Returns the unique id

getWidth()

Returns the width (FWHM) of the feature in RT dimension

hasInvalidUniqueId()

Returns whether the unique id is invalid.

hasValidUniqueId()

Returns whether the unique id is valid.

isMetaEmpty()

Returns if the MetaInfo is empty

isValid(unique_id)

Returns true if the unique_id is valid, false otherwise

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

setCharge(ch)

Sets the charge state of the feature

setConvexHulls(hulls)

Sets the convex hulls of individual mass traces

setIntensity(intensity)

Overloaded function.

setMZ(coordinate)

Overloaded function.

setMetaValue(name, value)

Sets the DataValue corresponding to a name

setOverallQuality(q)

Sets the overall quality score of the feature

setPeptideIdentifications(peptides)

Sets the peptide identifications associated with this feature

setQuality(index, q)

Sets the quality score for a specific dimension

setRT(coordinate)

Overloaded function.

setScores(s)

Sets the peak group quality scores

setSubordinates(rhs)

Sets the subordinate features

setUniqueId()

Overloaded function.

setWidth(fwhm)

Sets the width (FWHM) of the feature in RT dimension

Attributes

FEATURE_ID_MULTIPLE_DIVERGENT = 3#
FEATURE_ID_MULTIPLE_SAME = 2#
FEATURE_ID_NONE = 0#
FEATURE_ID_SINGLE = 1#
SIZE_OF_ANNOTATIONSTATE = 4#
addFeature(f: pyopenms.Feature, key: str) → None#

Adds a transition feature to this MRM feature

Parameters:
  • f – A Feature object representing the signal from a single transition chromatogram

  • key – The native ID for this transition (should match the transition ID from your method)

Each transition in an MRM experiment produces one chromatogram, which is represented as a Feature

addPrecursorFeature(f: pyopenms.Feature, key: str) → None#

Adds a precursor feature to this MRM feature

Parameters:
  • f – A Feature object representing the MS1 precursor signal

  • key – The native ID for this precursor

Precursor features are optional and represent MS1-level information

clearMetaInfo() → None#

Removes all meta values

clearUniqueId() → int#

Clear the unique id. The new unique id will be invalid. Returns 1 if the unique id was changed, 0 otherwise

encloses(rt: float, mz: float) → bool#

Checks if the feature’s convex hulls enclose a given position

Parameters:
  • rt – Retention time in seconds

  • mz – Mass-to-charge ratio

Returns:

True if the position (rt, mz) is within the feature’s convex hulls, False otherwise

This uses the feature’s convex hull representation to determine spatial containment

ensureUniqueId() → int#

Assigns a valid unique id, but only if the present one is invalid. Returns 1 if the unique id was changed, 0 otherwise

getAnnotationState() → pyopenms.BaseFeature.AnnotationState#

Returns the annotation state of the feature

Returns:

Enum indicating the annotation status of this feature

getCharge() → int#

Returns the charge state of the feature

Returns:

Charge state (e.g., 2 for doubly charged ions, 0 if unknown)

getConvexHull() → pyopenms.ConvexHull2D#

Returns the overall convex hull of the feature

Returns:

The overall 2D convex hull encompassing all mass traces

This is the union of all individual mass trace convex hulls

getConvexHulls() → list[pyopenms.ConvexHull2D]#

Returns the convex hulls of individual mass traces

Returns:

List of convex hulls, one for each isotopic mass trace

Each isotopic peak typically has its own convex hull in RT-m/z space

getFeature(key: str) → pyopenms.Feature#

Retrieves a transition feature by its native ID

Parameters:

key – The native ID of the transition (e.g., “transition_1” or a TRAML identifier)

Returns:

The Feature object corresponding to this transition

Raises an exception if the key is not found

getFeatureIDs(output: list) → None#
getFeatureIDs() → list[str]

Overloaded function.

  1. getFeatureIDs(output: list) -> None

Get feature IDs (fills the provided list)

  1. getFeatureIDs() -> list[str]

Retrieves the native IDs of all transition features

Returns:

The native IDs of all transitions

getFeatures() → list[pyopenms.Feature]#

Returns all transition features in this MRM feature

Returns:

A list of all transition features that have been added to this peak group

getIntensity() → float#
getIntensity() → float

Overloaded function.

  1. getIntensity() -> float

Returns the data point intensity (height)

  1. getIntensity() -> float

Returns the intensity

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 coordinate (index 1)

  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

getOverallQuality() → float#

Returns the overall quality score of the feature

Returns:

Overall quality score (typically 0-1, where 1 is highest quality)

This score represents the overall confidence in the feature detection

getPeptideIdentifications() → pyopenms.PeptideIdentificationList#

Returns the peptide identifications associated with this feature

Returns:

List of peptide identifications from database search

Only relevant for peptide features. Contains results from peptide identification tools

getPrecursorFeature(key: str) → pyopenms.Feature#

Retrieves a precursor feature by its native ID

Parameters:

key – The native ID of the precursor

Returns:

The Feature object for the precursor (MS1 signal)

Precursor features represent the MS1 signal for the peptide, if available

getPrecursorFeatureIDs() → list[str]#

Retrieves the native IDs of all precursor features

Returns:

The native IDs of all precursor features

getQuality(index: int) → float#

Returns the quality score in a specific dimension

Parameters:

index – The dimension index (0 for RT, 1 for m/z)

Returns:

Quality score for the specified dimension (typically 0-1 range)

getRT() → float#
getRT() → float

Overloaded function.

  1. getRT() -> float

Returns the RT coordinate (index 0)

  1. getRT() -> float

Returns the retention time

getScores() → pyopenms.OpenSwath_Scores#

Returns the peak group quality scores

Returns:

An object containing various quality metrics for the peak group, such as library correlation, signal-to-noise ratio, and other OpenSWATH scoring metrics

getSubordinates() → list[pyopenms.Feature]#

Returns subordinate features (e.g., isotopic peaks)

Returns:

List of subordinate features associated with this feature

Subordinate features often represent individual isotopic peaks of the same compound

getUniqueId() → int#

Returns the unique id

getWidth() → float#

Returns the width (FWHM) of the feature in RT dimension

Returns:

Full Width at Half Maximum (FWHM) in seconds

Represents the elution peak width

hasInvalidUniqueId() → int#

Returns whether the unique id is invalid. Returns 1 if the unique id is invalid, 0 otherwise

hasValidUniqueId() → int#

Returns whether the unique id is valid. Returns 1 if the unique id is valid, 0 otherwise

isMetaEmpty() → bool#

Returns if the MetaInfo is empty

static isValid(unique_id: int) → bool#

Returns true if the unique_id is valid, false otherwise

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

setCharge(ch: int) → None#

Sets the charge state of the feature

Parameters:

ch – Charge state (e.g., 2 for doubly charged ions)

setConvexHulls(hulls: collections.abc.Sequence[pyopenms.ConvexHull2D]) → None#

Sets the convex hulls of individual mass traces

Parameters:

hulls – List of convex hulls to associate with this feature

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

Overloaded function.

  1. setIntensity(intensity: float) -> None

Sets the data point intensity (height)

  1. setIntensity(intensity: float) -> None

Sets the intensity

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

Overloaded function.

  1. setMZ(coordinate: float) -> None

Sets the m/z coordinate (index 1)

  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

setOverallQuality(q: float) → None#

Sets the overall quality score of the feature

Parameters:

q – Overall quality score (typically 0-1, where 1 is highest quality)

setPeptideIdentifications(peptides: pyopenms.PeptideIdentificationList) → None#

Sets the peptide identifications associated with this feature

Parameters:

peptides – List of peptide identifications to associate with this feature

setQuality(index: int, q: float) → None#

Sets the quality score for a specific dimension

Parameters:
  • index – The dimension index (0 for RT, 1 for m/z)

  • q – Quality score to set (typically 0-1 range)

setRT(coordinate: float) → None#
setRT(rt: float) → None

Overloaded function.

  1. setRT(coordinate: float) -> None

Sets the RT coordinate (index 0)

  1. setRT(rt: float) -> None

Sets the retention time

setScores(s: pyopenms.OpenSwath_Scores) → None#

Sets the peak group quality scores

Parameters:

s – An OpenSwath_Scores object containing quality metrics for this peak group

setSubordinates(rhs: collections.abc.Sequence[pyopenms.Feature]) → None#

Sets the subordinate features

Parameters:

rhs – List of subordinate features to associate with this feature

setUniqueId() → int#
setUniqueId(rhs: int) → None
setUniqueId(rhs: str) → None

Overloaded function.

  1. setUniqueId() -> int

Assigns a new, valid unique id. Always returns 1

  1. setUniqueId(rhs: int) -> None

Assigns the given unique id

  1. setUniqueId(rhs: str) -> None

Assigns a unique id from a string (extracts UInt64 after last underscore)

setWidth(fwhm: float) → None#

Sets the width (FWHM) of the feature in RT dimension

Parameters:

fwhm – Full Width at Half Maximum in seconds