PScore#
- class pyopenms.PScore#
Bases:
objectOpenMS class PScore
- __init__() None#
- __init__(arg: pyopenms.PScore, /) None
Methods
__init__()calculateIntensityRankInMZWindow(mz, ...)Calculate local (windowed) peak ranks
calculatePeakLevelSpectra(spec, ranks, ...)Calculates spectra for peak level between min_level to max_level and stores them in the map
calculateRankMap(peak_map, mz_window)Precalculated, windowed peak ranks for a whole experiment
computePScore(fragment_mass_tolerance, ...)Overloaded function.
- static calculateIntensityRankInMZWindow(mz: collections.abc.Sequence[float], intensities: collections.abc.Sequence[float], mz_window: float) list[int]#
Calculate local (windowed) peak ranks
The peak rank is defined as the number of neighboring peaks in +/- (mz_window/2) that have higher intensity The result can be used to efficiently filter spectra for top 1..n peaks in mass windows
- Parameters:
mz – The m/z positions of the peaks
intensities – The intensities of the peaks
mz_window – The window in Thomson centered at each peak
- static calculatePeakLevelSpectra(spec: pyopenms.MSSpectrum, ranks: collections.abc.Sequence[int], min_level: int, max_level: int) dict[int, pyopenms.MSSpectrum]#
Calculates spectra for peak level between min_level to max_level and stores them in the map
A spectrum of peak level n retains the (n+1) top intensity peaks in a sliding mz_window centered at each peak
- static calculateRankMap(peak_map: pyopenms.MSExperiment, mz_window: float) list[list[int]]#
Precalculated, windowed peak ranks for a whole experiment
The peak rank is defined as the number of neighboring peaks in +/- (mz_window/2) that have higher intensity
- Parameters:
peak_map – Fragment spectra used for rank calculation. Typically a peak map after removal of all MS1 spectra
mz_window – Window in Thomson centered at each peak
- static computePScore(fragment_mass_tolerance: float, fragment_mass_tolerance_unit_ppm: bool, peak_level_spectra: collections.abc.Mapping[int, pyopenms.MSSpectrum], theo_spectra: collections.abc.Sequence[pyopenms.MSSpectrum], mz_window: float = 100.0) float#
- static computePScore(fragment_mass_tolerance: float, fragment_mass_tolerance_unit_ppm: bool, peak_level_spectra: collections.abc.Mapping[int, pyopenms.MSSpectrum], theo_spectrum: pyopenms.MSSpectrum, mz_window: float = 100.0) float
Overloaded function.
computePScore(fragment_mass_tolerance: float, fragment_mass_tolerance_unit_ppm: bool, peak_level_spectra: collections.abc.Mapping[int, pyopenms.MSSpectrum], theo_spectra: collections.abc.Sequence[pyopenms.MSSpectrum], mz_window: float = 100.0) -> float
Compute the PScore for a vector of theoretical spectra
computePScore(fragment_mass_tolerance: float, fragment_mass_tolerance_unit_ppm: bool, peak_level_spectra: collections.abc.Mapping[int, pyopenms.MSSpectrum], theo_spectrum: pyopenms.MSSpectrum, mz_window: float = 100.0) -> float
Compute the PScore for a single theoretical spectrum