CycloBranch
cPeaksList.h File Reference

The representation of a peak list. More...

#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include "core/cPeak.h"
#include "core/cMzML.h"
#include "core/cImzML.h"

Go to the source code of this file.

Classes

class  cPeaksList
 The class representing a peak list. More...
 

Functions

bool compareRelativePeakIntensitiesDesc (const cPeak &a, const cPeak &b)
 Compare two peaks by relative intensities. More...
 
bool isInPpmMassErrorTolerance (double experimentalmass, double theoreticalmass, double tolerance)
 Check whether two masses are inside a ppm mass error tolerance. More...
 
double ppmError (double experimentalmass, double theoreticalmass)
 Compute a ppm error between two masses. More...
 
bool searchHint (double mzratio, cPeaksList &experimentalpeaks, double fragmentmasserrortolerance)
 Check if an m/z ratio exists in an experimental spectrum. More...
 
 Q_DECLARE_METATYPE (cPeaksList)
 Register cPeaksList by Qt.
 

Detailed Description

The representation of a peak list.

Function Documentation

◆ compareRelativePeakIntensitiesDesc()

bool compareRelativePeakIntensitiesDesc ( const cPeak a,
const cPeak b 
)

Compare two peaks by relative intensities.

Parameters
afirst peak
bsecond peak
Return values
booltrue when the relative intensity of the peak a is bigger than the relative intensity of the peak b

◆ isInPpmMassErrorTolerance()

bool isInPpmMassErrorTolerance ( double  experimentalmass,
double  theoreticalmass,
double  tolerance 
)

Check whether two masses are inside a ppm mass error tolerance.

Parameters
experimentalmassfirst mass
theoreticalmasssecond mass
tolerancefragment mass error tolerance
Return values
booltrue when masses are inside a mass tolerance

◆ ppmError()

double ppmError ( double  experimentalmass,
double  theoreticalmass 
)

Compute a ppm error between two masses.

Parameters
experimentalmassfirst mass
theoreticalmasssecond mass
Return values
doubleppm error

◆ searchHint()

bool searchHint ( double  mzratio,
cPeaksList experimentalpeaks,
double  fragmentmasserrortolerance 
)

Check if an m/z ratio exists in an experimental spectrum.

Parameters
mzratiotheoretical m/z ratio
experimentalpeaksan input experimental spectrum (sorted in ascending order)
fragmentmasserrortolerancem/z error tolerance
Return values
trueif the theoretical m/z ratio was mathed; false otherwise