MSChromatogram#
- class pyopenms.MSChromatogram(*args, **kwargs)#
Bases:
MSChromatogram
- __init__(*args, **kwargs)#
Overload:
- __init__(self) None
Overload:
- __init__(self, in_0: MSChromatogram) None
Methods
__init__
(*args, **kwargs)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_df
([export_meta_values])Returns a DataFrame representation of the MSChromatogram.
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
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
- 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: bytes | str | String) 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
- getNativeID(self) bytes | str | String #
Returns the native identifier for the spectrum, used by the acquisition software.
- getSourceFile(self) SourceFile #
Returns the source file
- getStringDataArrays(self) List[StringDataArray] #
Returns a reference to the string meta data arrays
- get_df(export_meta_values: bool = True) DataFrame #
Returns a DataFrame representation of the MSChromatogram.
time: The retention time (in seconds) of the chromatographic peaks. intensity: The intensity (abundance) of the signal at each time point. chromatogram_type: The type of chromatogram. precursor_mz: The mass-to-charge of the precursor ion. precursor_charge: The charge of the precursor ion. comment: A comment assigned to the chromatogram. native_id: The chromatogram native identifier.
- Args:
export_meta_values (bool): Whether to export meta values.
- Returns:
pd.DataFrame: DataFrame representation of the MSChromatogram.
- 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: 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: 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
- 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: bytes | str | String, in_1: int | float | bytes | str | List[int] | List[float] | List[bytes]) None #
Sets the DataValue corresponding to a name
- setNativeID(self, native_id: bytes | str | String) None #
Sets the native identifier for the spectrum, used by the acquisition software.
- 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 #