MSChromatogram

class pyopenms.MSChromatogram

Bases: object

Cython implementation of _MSChromatogram

Original C++ documentation is available here

– Inherits from [‘ChromatogramSettings’, ‘RangeManagerRtInt’]

The representation of a chromatogram. Raw data access is proved by get_peaks and set_peaks, which yields numpy arrays Iterations yields access to underlying peak objects but is slower Extra data arrays can be accessed through getFloatDataArrays / getIntegerDataArrays / getStringDataArrays See help(ChromatogramSettings) for information about meta-information

Usage:

__init__()

Overload:

__init__(self) None

Overload:

__init__(self, in_0: MSChromatogram) None

Methods

__init__

Overload:

clear(self, in_0)

Clears all data and meta data

clearMetaInfo(self)

Removes all meta values

clearRanges(self)

Resets all range dimensions as empty

findNearest(self, in_0)

Binary search for the peak nearest to a specific RT :note: Make sure the chromatogram is sorted with respect to RT! Otherwise the result is undefined

getAcquisitionInfo(self)

Returns the acquisition info

getChromatogramType(self)

Get the chromatogram type

getComment(self)

Returns the free-text comment

getDataProcessing(self)

Returns the description of the applied processing

getFloatDataArrays(self)

Returns a reference to the float meta data arrays

getInstrumentSettings(self)

Returns the instrument settings of the current spectrum

getIntegerDataArrays(self)

Returns a reference to the integer meta data arrays

getKeys(self, keys)

Fills the given vector with a list of all keys for which a value is set

getMZ(self)

Returns the mz of the product entry, makes sense especially for MRM scans

getMaxIntensity(self)

Returns the maximum intensity

getMaxRT(self)

Returns the maximum RT

getMetaValue(self, in_0)

Returns the value corresponding to a string, or

getMinIntensity(self)

Returns the minimum intensity

getMinRT(self)

Returns the minimum RT

getName(self)

Returns the name

getNativeID(self)

Returns the native identifier for the spectrum, used by the acquisition software.

getPrecursor(self)

Returns the precursors

getProduct(self)

Returns the product ion

getSourceFile(self)

Returns the source file

getStringDataArrays(self)

Returns a reference to the string meta data arrays

get_peaks

isMetaEmpty(self)

Returns if the MetaInfo is empty

isSorted(self)

Checks if all peaks are sorted with respect to ascending RT

metaRegistry(self)

Returns a reference to the MetaInfoRegistry

metaValueExists(self, in_0)

Returns whether an entry with the given name exists

push_back(self, in_0)

Append a peak

removeMetaValue(self, in_0)

Removes the DataValue corresponding to name if it exists

reserve(self, n)

resize(self, n)

Resize the peak array

setAcquisitionInfo(self, acquisition_info)

Sets the acquisition info

setChromatogramType(self, type)

Sets the chromatogram type

setComment(self, comment)

Sets the free-text comment

setDataProcessing(self, in_0)

Sets the description of the applied processing

setFloatDataArrays(self, fda)

Sets the float meta data arrays

setInstrumentSettings(self, instrument_settings)

Sets the instrument settings of the current spectrum

setIntegerDataArrays(self, ida)

Sets the integer meta data arrays

setMetaValue(self, in_0, in_1)

Sets the DataValue corresponding to a name

setName(self, in_0)

Sets the name

setNativeID(self, native_id)

Sets the native identifier for the spectrum, used by the acquisition software.

setPrecursor(self, precursor)

Sets the precursors

setProduct(self, p)

Sets the product ion

setSourceFile(self, source_file)

Sets the source file

setStringDataArrays(self, sda)

Sets the string meta data arrays

set_peaks

size(self)

sortByIntensity(self, reverse)

Lexicographically sorts the peaks by their intensity

sortByPosition(self)

Lexicographically sorts the peaks by their position

updateRanges(self)

clear(self, in_0: int) None

Clears all data and meta data

Parameters

clear_meta_data – If true, all meta data is cleared in addition to the data

clearMetaInfo(self) None

Removes all meta values

clearRanges(self) None

Resets all range dimensions as empty

findNearest(self, in_0: float) int

Binary search for the peak nearest to a specific RT :note: Make sure the chromatogram is sorted with respect to RT! Otherwise the result is undefined

Parameters

rt – The searched for mass-to-charge ratio searched

Returns

Returns the index of the peak.

Raises

Exception: Precondition is thrown if the chromatogram is empty (not only in debug mode)

getAcquisitionInfo(self) AcquisitionInfo

Returns the acquisition info

getChromatogramType(self) int

Get the chromatogram type

getComment(self) Union[bytes, str, String]

Returns the free-text comment

getDataProcessing(self) List[DataProcessing]

Returns the description of the applied processing

getFloatDataArrays(self) List[FloatDataArray]

Returns a reference to the float meta data arrays

getInstrumentSettings(self) InstrumentSettings

Returns the instrument settings of the current spectrum

getIntegerDataArrays(self) List[IntegerDataArray]

Returns a reference to the integer meta data arrays

getKeys(self, keys: List[bytes]) None

Fills the given vector with a list of all keys for which a value is set

getMZ(self) float

Returns the mz of the product entry, makes sense especially for MRM scans

getMaxIntensity(self) float

Returns the maximum intensity

getMaxRT(self) float

Returns the maximum RT

getMetaValue(self, in_0: Union[bytes, str, String]) Union[int, float, bytes, str, List[int], List[float], List[bytes]]

Returns the value corresponding to a string, or

getMinIntensity(self) float

Returns the minimum intensity

getMinRT(self) float

Returns the minimum RT

getName(self) Union[bytes, str, String]

Returns the name

getNativeID(self) Union[bytes, str, String]

Returns the native identifier for the spectrum, used by the acquisition software.

getPrecursor(self) Precursor

Returns the precursors

getProduct(self) Product

Returns the product ion

getSourceFile(self) SourceFile

Returns the source file

getStringDataArrays(self) List[StringDataArray]

Returns a reference to the string meta data arrays

get_peaks()
isMetaEmpty(self) bool

Returns if the MetaInfo is empty

isSorted(self) bool

Checks if all peaks are sorted with respect to ascending RT

metaRegistry(self) MetaInfoRegistry

Returns a reference to the MetaInfoRegistry

metaValueExists(self, in_0: Union[bytes, str, String]) bool

Returns whether an entry with the given name exists

push_back(self, in_0: ChromatogramPeak) None

Append a peak

removeMetaValue(self, in_0: Union[bytes, str, String]) None

Removes the DataValue corresponding to name if it exists

reserve(self, n: int) None
resize(self, n: int) None

Resize the peak array

setAcquisitionInfo(self, acquisition_info: AcquisitionInfo) None

Sets the acquisition info

setChromatogramType(self, type: int) None

Sets the chromatogram type

setComment(self, comment: Union[bytes, str, String]) None

Sets the free-text comment

setDataProcessing(self, in_0: List[DataProcessing]) None

Sets the description of the applied processing

setFloatDataArrays(self, fda: List[FloatDataArray]) None

Sets the float meta data arrays

setInstrumentSettings(self, instrument_settings: InstrumentSettings) None

Sets the instrument settings of the current spectrum

setIntegerDataArrays(self, ida: List[IntegerDataArray]) None

Sets the integer meta data arrays

setMetaValue(self, in_0: Union[bytes, str, String], in_1: Union[int, float, bytes, str, List[int], List[float], List[bytes]]) None

Sets the DataValue corresponding to a name

setName(self, in_0: Union[bytes, str, String]) None

Sets the name

setNativeID(self, native_id: Union[bytes, str, String]) None

Sets the native identifier for the spectrum, used by the acquisition software.

setPrecursor(self, precursor: Precursor) None

Sets the precursors

setProduct(self, p: Product) None

Sets the product ion

setSourceFile(self, source_file: SourceFile) None

Sets the source file

setStringDataArrays(self, sda: List[StringDataArray]) None

Sets the string meta data arrays

set_peaks()
size(self) int
sortByIntensity(self, reverse: bool) None

Lexicographically sorts the peaks by their intensity

Sorts the peaks according to ascending intensity. Meta data arrays will be sorted accordingly

sortByPosition(self) None

Lexicographically sorts the peaks by their position

The chromatogram is sorted with respect to position. Meta data arrays will be sorted accordingly

updateRanges(self) None