SpectrumMetaDataLookup

class pyopenms.SpectrumMetaDataLookup

Bases: object

Cython implementation of _SpectrumMetaDataLookup

Original C++ documentation is available here

– Inherits from [‘SpectrumLookup’]

__init__(self) None

Methods

__init__(self)

addMissingRTsToPeptideIDs

__static_SpectrumMetaDataLookup_addMissingRTsToPeptideIDs(in_0: List[PeptideIdentification] , filename: Union[bytes, str, String] , stop_on_error: bool ) -> bool

addMissingSpectrumReferences

__static_SpectrumMetaDataLookup_addMissingSpectrumReferences(in_0: List[PeptideIdentification] , filename: Union[bytes, str, String] , stop_on_error: bool , override_spectra_data: bool , override_spectra_references: bool , proteins: List[ProteinIdentification] ) -> bool

addReferenceFormat(self, regexp)

Register a possible format for a spectrum reference

empty(self)

Check if any spectra were set

extractScanNumber(self, native_id, ...)

findByIndex(self, index, count_from_one)

Look up spectrum by index (position in the vector of spectra)

findByNativeID(self, native_id)

Look up spectrum by native ID

findByRT(self, rt)

Look up spectrum by retention time (RT)

findByReference(self, spectrum_ref)

Look up spectrum by reference

findByScanNumber(self, scan_number)

Look up spectrum by scan number (extracted from the native ID)

getSpectrumMetaData

__static_SpectrumMetaDataLookup_getSpectrumMetaData(spectrum: MSSpectrum , meta: SpectrumMetaData ) -> None

readSpectra

Overload:

setSpectraDataRef(self, spectra_data)

addMissingRTsToPeptideIDs()

__static_SpectrumMetaDataLookup_addMissingRTsToPeptideIDs(in_0: List[PeptideIdentification] , filename: Union[bytes, str, String] , stop_on_error: bool ) -> bool

addMissingSpectrumReferences()

__static_SpectrumMetaDataLookup_addMissingSpectrumReferences(in_0: List[PeptideIdentification] , filename: Union[bytes, str, String] , stop_on_error: bool , override_spectra_data: bool , override_spectra_references: bool , proteins: List[ProteinIdentification] ) -> bool

addReferenceFormat(self, regexp: Union[bytes, str, String]) None

Register a possible format for a spectrum reference

Parameters

regexp – Regular expression defining the format

empty(self) bool

Check if any spectra were set

extractScanNumber(self, native_id: Union[bytes, str, String], native_id_type_accession: Union[bytes, str, String]) int
findByIndex(self, index: int, count_from_one: bool) int

Look up spectrum by index (position in the vector of spectra)

Parameters
  • index – Index to look up

  • count_from_one – Do indexes start counting at one (default zero)?

Returns

Index of the spectrum that matched

findByNativeID(self, native_id: Union[bytes, str, String]) int

Look up spectrum by native ID

Parameters

native_id – Native ID to look up

Returns

Index of the spectrum that matched

findByRT(self, rt: float) int

Look up spectrum by retention time (RT)

Parameters

rt – Retention time to look up

Returns

Index of the spectrum that matched

findByReference(self, spectrum_ref: Union[bytes, str, String]) int

Look up spectrum by reference

Parameters

spectrum_ref – Spectrum reference to parse

Returns

Index of the spectrum that matched

findByScanNumber(self, scan_number: int) int

Look up spectrum by scan number (extracted from the native ID)

Parameters

scan_number – Scan number to look up

Returns

Index of the spectrum that matched

getSpectrumMetaData()

__static_SpectrumMetaDataLookup_getSpectrumMetaData(spectrum: MSSpectrum , meta: SpectrumMetaData ) -> None

readSpectra()

Overload:

readSpectra(self, spectra: MSExperiment, scan_regexp: Union[bytes, str, String], get_precursor_rt: bool) None

Read spectra and store their meta data

Parameters
  • SpectrumContainer – Spectrum container class, must support size and operator[]

  • spectra – Container of spectra

  • scan_regexp – Regular expression for matching scan numbers in spectrum native IDs (must contain the named group “?<SCAN>”)

  • get_precursor_rt – Assign precursor retention times? (This relies on all precursor spectra being present and in the right order.)

Overload:

readSpectra(self, spectra: MSExperiment, scan_regexp: Union[bytes, str, String]) None

Read and index spectra for later look-up

Parameters
  • spectra – Container of spectra

  • scan_regexp – Regular expression for matching scan numbers in spectrum native IDs (must contain the named group “?<SCAN>”. For example, “scan=(?<SCAN>d+)”).

setSpectraDataRef(self, spectra_data: Union[bytes, str, String]) None