#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/IsotopeWaveletTransform.h>
Public Types | |
typedef std::multimap< UInt, BoxElement_ > | Box_ |
Key: RT index, value: BoxElement_. | |
Public Member Functions | |
IsotopeWaveletTransform (const DoubleReal min_mz, const DoubleReal max_mz, const UInt max_charge) throw () | |
Constructor. | |
virtual | ~IsotopeWaveletTransform () throw () |
Destructor. | |
virtual void | getTransforms (const MSSpectrum< PeakType > &scan, std::vector< MSSpectrum< PeakType > > &transforms, const UInt max_charge, const Int mode) throw () |
Computes the discrete-time continuous wavelet transform simultaneously for several charges. | |
virtual void | identifyCharges (const std::vector< MSSpectrum< PeakType > > &candidates, const MSSpectrum< PeakType > &ref, const UInt scan_index, const DoubleReal ampl_cutoff=0) throw () |
Given an isotope wavelet transformed spectrum candidates , this function assigns to every significant pattern its corresponding charge state and a score indicating the reliability of the prediction. The result of this process is stored internally. Important: Before calling this function, apply updateRanges() to the original map. | |
void | updateBoxStates (const UInt scan_index, const UInt RT_interleave, const UInt RT_votes_cutoff) throw () |
A function keeping track of currently open and closed sweep line boxes. This function is used by the isotope wavelet feature finder and must be called for each processed scan. | |
FeatureMap< Feature > | mapSeeds2Features (const MSExperiment< PeakType > &map, const UInt max_charge, const UInt RT_votes_cutoff) throw () |
Filters the candidates further more and maps the internally used data structures to the OpenMS framework. | |
virtual std::multimap < DoubleReal, Box_ > | getClosedBoxes () throw () |
Returns the closed boxes. | |
Protected Member Functions | |
IsotopeWaveletTransform () throw () | |
Default Constructor. | |
void | estimatePeakCutOffs_ (const DoubleReal min_mz, const DoubleReal max_mz, const UInt max_charge) throw () |
void | sampleTheWavelet_ (const MSSpectrum< PeakType > &scan, const UInt wavelet_length, const UInt mz_index, const DoubleReal offset, const UInt charge, const UInt peak_cutoff, const Int mode=+1) throw () |
Samples the wavelet at discrete time points, s.t. they match automatically the m/z positions provided in scan . The discrete values of psi are stored in the member variable psi_. | |
virtual DoubleReal | scoreThis_ (const MSSpectrum< PeakType > &candidate, const UInt peak_cutoff, const DoubleReal seed_mz, const UInt c, const DoubleReal intens, const DoubleReal ampl_cutoff=0) throw () |
Given a candidate for an isotopic pattern, this function computes the corresponding score. | |
virtual void | checkPosition_ (const MSSpectrum< PeakType > &candidate, const MSSpectrum< PeakType > &ref, const DoubleReal seed_mz, const UInt c, const UInt scan_index) throw () |
A ugly but necessary function to handle "off-by-1-Dalton predictions" due to idiosyncrasies of the data set (in comparison to the averagine model). | |
DoubleReal | getAvIntens_ (const MSSpectrum< PeakType > &scan) throw () |
Computes the average intensity (neglecting negative values) of scan . | |
DoubleReal | getSdIntens_ (const MSSpectrum< PeakType > &scan, const DoubleReal mean) throw () |
Computes the standard deviation (neglecting negative values) of the intensity of scan . | |
DoubleReal | getCubicInterpolatedValue_ (const std::vector< DoubleReal > &x, const DoubleReal xi, const std::vector< DoubleReal > &y) throw () |
A wrapper function to the GSL interpolation routine. | |
std::pair< Int, Int > | getNearBys_ (const MSSpectrum< PeakType > &signal, const DoubleReal mz, const UInt start=0) const throw () |
A function to map m/z values to m/z indices. In particular useful if you know already the approximate position of the corresponding entry which can be indicated by start . | |
virtual void | push2Box_ (const DoubleReal mz, const UInt scan, UInt charge, const DoubleReal score, const DoubleReal intens, const DoubleReal rt, const UInt MZ_begin, const UInt MZ_end) throw () |
Inserts a potential isotopic pattern into an open box or - if no such box exists - creates a new one. | |
virtual void | push2TmpBox_ (const DoubleReal mz, const UInt scan, UInt charge, const DoubleReal score, const DoubleReal intens, const DoubleReal rt, const UInt MZ_begin, const UInt MZ_end) throw () |
Essentially the same function as. | |
DoubleReal | getAvMZSpacing_ (const MSSpectrum< PeakType > &scan, Int start_index=0, Int end_index=-1) throw () |
Computes the average MZ spacing of scan in the range start_index to end_index . | |
DoubleReal | chordTrapezoidRule_ (const DoubleReal a, const DoubleReal b, const DoubleReal fa, const DoubleReal fb) throw () |
The trapezoid rule for integration. | |
DoubleReal | chordTrapezoidRule_ (const std::vector< DoubleReal > &x, const std::vector< DoubleReal > &y) throw () |
The trapezoid rule for integration. | |
UInt | getPeakCutOff_ (const DoubleReal mass, const UInt z) |
Estimates the number of peaks of an isotopic pattern at mass mass and charge state z . | |
void | clusterSeeds_ (const std::vector< MSSpectrum< PeakType > > &candidates, const MSSpectrum< PeakType > &ref, const UInt scan_index, const UInt max_charge) throw () |
Clusters the seeds stored by push2TmpBox_. | |
Protected Attributes | |
std::multimap< DoubleReal, Box_ > | open_boxes_ |
std::multimap< DoubleReal, Box_ > | closed_boxes_ |
std::vector< std::multimap < DoubleReal, Box_ > > * | tmp_boxes_ |
gsl_interp_accel * | acc_ |
gsl_spline * | spline_ |
DoubleReal | av_MZ_spacing_ |
DoubleReal | peak_cutoff_intercept_ |
DoubleReal | peak_cutoff_slope_ |
std::vector< DoubleReal > | c_mzs_ |
std::vector< DoubleReal > | c_spacings_ |
std::vector< DoubleReal > | psi_ |
std::vector< DoubleReal > | prod_ |
std::vector< DoubleReal > | xs_ |
Classes | |
struct | BoxElement_ |
Internally used data structure. More... |
typedef std::multimap<UInt, BoxElement_> Box_ |
Key: RT index, value: BoxElement_.
IsotopeWaveletTransform | ( | const DoubleReal | min_mz, | |
const DoubleReal | max_mz, | |||
const UInt | max_charge | |||
) | throw () [inline] |
Constructor.
min_mz | The smallest m/z value occurring in your map. | |
max_mz | The largest m/z value occurring in your map. | |
max_charge | The highest charge state you would like to consider. |
~IsotopeWaveletTransform | ( | ) | throw () [inline, virtual] |
Destructor.
IsotopeWaveletTransform | ( | ) | throw () [inline, protected] |
Default Constructor.
void getTransforms | ( | const MSSpectrum< PeakType > & | scan, | |
std::vector< MSSpectrum< PeakType > > & | transforms, | |||
const UInt | max_charge, | |||
const Int | mode | |||
) | throw () [inline, virtual] |
Computes the discrete-time continuous wavelet transform simultaneously for several charges.
The function computes the isotope wavelet transformed versions of scan
. The transform is determined for several charge states (up to charge max_charge
) at the same time. Hence, the user has to ensure that the size of transforms
equals to max_charge
and that each spectrum in transforms
has the same length as scan
.
scan | The MS scan you wish to transform. | |
transforms | A vector (with indices running from 0 to max_charge-1 ) of MS spectra (each of the size of scan ). The code will NOT check the allocated memory (the sizes) for transforms and its entries. | |
max_charge | The maximal charge state that is considered. | |
mode | The recording mode of the mass spectrometer (+1 or -1). |
void identifyCharges | ( | const std::vector< MSSpectrum< PeakType > > & | candidates, | |
const MSSpectrum< PeakType > & | ref, | |||
const UInt | scan_index, | |||
const DoubleReal | ampl_cutoff = 0 | |||
) | throw () [inline, virtual] |
Given an isotope wavelet transformed spectrum candidates
, this function assigns to every significant pattern its corresponding charge state and a score indicating the reliability of the prediction. The result of this process is stored internally. Important: Before calling this function, apply updateRanges() to the original map.
candidates | A isotope wavelet transformed spectrum. Entry "number i" in this vector must correspond to the charge-"(i-1)"-transform of its mass signal. (This is exactly the output of the function |
ref | The reference scan (the untransformed raw data) corresponding to candidates . | |
scan_index | The index of the scan (w.r.t. to some map) currently under consideration. | |
ampl_cutoff | The thresholding parameter. This parameter is the only (and hence a really important) parameter of the isotope wavelet transform. On the basis of ampl_cutoff the program tries to distinguish between noise and signal. Please note that it is not a "simple" hard thresholding parameter in the sense of drawing a virtual line in the spectrum, which is then used as a guillotine cut. Maybe you should play around a bit with this parameter to get a feeling about its range. For peptide mass fingerprints on small data sets (like single MALDI-scans e.g.), it makes sense to start ampl_cutoff=0 or even ampl_cutoff=-1 , indicating no thresholding at all. Note that also ampl_cutoff=0 triggers (a moderate) thresholding based on the average intensity in the wavelet transform. |
void updateBoxStates | ( | const UInt | scan_index, | |
const UInt | RT_interleave, | |||
const UInt | RT_votes_cutoff | |||
) | throw () [inline] |
A function keeping track of currently open and closed sweep line boxes. This function is used by the isotope wavelet feature finder and must be called for each processed scan.
scan_index | The index of the scan currently under consideration w.r.t. its MS map. This information is necessary to sweep across the map after each scan has been evaluated. | |
RT_interleave | See the IsotopeWaveletFF class. | |
RT_votes_cutoff | See the IsotopeWaveletFF class. |
FeatureMap< Feature > mapSeeds2Features | ( | const MSExperiment< PeakType > & | map, | |
const UInt | max_charge, | |||
const UInt | RT_votes_cutoff | |||
) | throw () [inline] |
Filters the candidates further more and maps the internally used data structures to the OpenMS framework.
map | The original map containing the data set to be analyzed. | |
max_charge | The maximal charge state under consideration. | |
RT_votes_cutoff | See the IsotopeWaveletFF class. |
virtual std::multimap<DoubleReal, Box_> getClosedBoxes | ( | ) | throw () [inline, virtual] |
Returns the closed boxes.
void estimatePeakCutOffs_ | ( | const DoubleReal | min_mz, | |
const DoubleReal | max_mz, | |||
const UInt | max_charge | |||
) | throw () [inline, protected] |
void sampleTheWavelet_ | ( | const MSSpectrum< PeakType > & | scan, | |
const UInt | wavelet_length, | |||
const UInt | mz_index, | |||
const DoubleReal | offset, | |||
const UInt | charge, | |||
const UInt | peak_cutoff, | |||
const Int | mode = +1 | |||
) | throw () [inline, protected] |
Samples the wavelet at discrete time points, s.t. they match automatically the m/z positions provided in scan
. The discrete values of psi are stored in the member variable psi_.
scan | Provides the sampling positions. | |
wavelet_length | The number of sampling points for the wavelet. | |
mz_index | The start index of scan for which the wavelet should be adapted. | |
offset | The offset the wavelet function needs to be aligned with a signal point. | |
charge | The charge (not the index c!) the wavelet function should adapt (corresponds to z in the paper). | |
peak_cutoff | The number of peaks we will consider for the isotopic pattern. | |
mode | Indicates whether positive mode (+1) or negative mode (-1) has been used for ionization. |
DoubleReal scoreThis_ | ( | const MSSpectrum< PeakType > & | candidate, | |
const UInt | peak_cutoff, | |||
const DoubleReal | seed_mz, | |||
const UInt | c, | |||
const DoubleReal | intens, | |||
const DoubleReal | ampl_cutoff = 0 | |||
) | throw () [inline, protected, virtual] |
Given a candidate for an isotopic pattern, this function computes the corresponding score.
candidate | A isotope wavelet transformed spectrum. | |
peak_cutoff | The number of peaks we will consider for the isotopic pattern. | |
seed_mz | The predicted position of the monoisotopic peak. | |
c | The charge state minus 1 (e.g. c=2 means charge state 3) for which the score should be determined. | |
intens | The intensity of the transform at seed_mz . | |
ampl_cutoff | The threshold. |
void checkPosition_ | ( | const MSSpectrum< PeakType > & | candidate, | |
const MSSpectrum< PeakType > & | ref, | |||
const DoubleReal | seed_mz, | |||
const UInt | c, | |||
const UInt | scan_index | |||
) | throw () [inline, protected, virtual] |
A ugly but necessary function to handle "off-by-1-Dalton predictions" due to idiosyncrasies of the data set (in comparison to the averagine model).
candidate | The wavelet transformed spectrum containing the candidate. | |
ref | The original spectrum containing the candidate. | |
seed_mz | The m/z position of the candidate pattern. | |
c | The predicted charge state of the candidate. | |
scan_index | The index of the scan under consideration (w.r.t. the original map). |
DoubleReal getAvIntens_ | ( | const MSSpectrum< PeakType > & | scan | ) | throw () [inline, protected] |
Computes the average intensity (neglecting negative values) of scan
.
DoubleReal getSdIntens_ | ( | const MSSpectrum< PeakType > & | scan, | |
const DoubleReal | mean | |||
) | throw () [inline, protected] |
Computes the standard deviation (neglecting negative values) of the intensity of scan
.
DoubleReal getCubicInterpolatedValue_ | ( | const std::vector< DoubleReal > & | x, | |
const DoubleReal | xi, | |||
const std::vector< DoubleReal > & | y | |||
) | throw () [inline, protected] |
A wrapper function to the GSL interpolation routine.
std::pair< int, int > getNearBys_ | ( | const MSSpectrum< PeakType > & | signal, | |
const DoubleReal | mz, | |||
const UInt | start = 0 | |||
) | const throw () [inline, protected] |
A function to map m/z values to m/z indices. In particular useful if you know already the approximate position of the corresponding entry which can be indicated by start
.
void push2Box_ | ( | const DoubleReal | mz, | |
const UInt | scan, | |||
UInt | charge, | |||
const DoubleReal | score, | |||
const DoubleReal | intens, | |||
const DoubleReal | rt, | |||
const UInt | MZ_begin, | |||
const UInt | MZ_end | |||
) | throw () [inline, protected, virtual] |
Inserts a potential isotopic pattern into an open box or - if no such box exists - creates a new one.
mz | The position of the pattern. | |
scan | The index of the scan, we are currently analyzing (w.r.t. the data map). This information is necessary for the post-processing (sweep lining). | |
charge | The estimated charge state of the pattern. | |
score | The pattern's score. | |
intens | The intensity at the monoisotopic peak. | |
rt | The retention time of the scan (similar to scan , but here: no index, but the real value). | |
MZ_begin | The starting index of the pattern (m/z) w.r.t. the current scan. | |
MZ_end | The end index (w.r.t. the monoisotopic position!) of the pattern (m/z) w.r.t. the current scan. |
void push2TmpBox_ | ( | const DoubleReal | mz, | |
const UInt | scan, | |||
UInt | charge, | |||
const DoubleReal | score, | |||
const DoubleReal | intens, | |||
const DoubleReal | rt, | |||
const UInt | MZ_begin, | |||
const UInt | MZ_end | |||
) | throw () [inline, protected, virtual] |
Essentially the same function as.
push2Box this function stores its candidates only temporarily. In particular, this function is only used within a single scan transform. After the wavelet transform is computed on that scan, all candidates are pushed by this function and finally clustered together by
clusterSeeds_. Afterwards, a final push by
push2Box_ is performed storing the clustered candidates.
mz | The position of the pattern. | |
scan | The index of the scan, we are currently analyzing (w.r.t. the data map). This information is necessary for the post-processing (sweep lining). | |
charge | The estimated charge state of the pattern. | |
score | The pattern's score. | |
intens | The intensity at the monoisotopic peak. | |
rt | The retention time of the scan (similar to scan , but here: no index, but the real value). | |
MZ_begin | The starting index of the pattern (m/z) w.r.t. the current scan. | |
MZ_end | The end index (w.r.t. the monoisotopic position!) of the pattern (m/z) w.r.t. the current scan. |
DoubleReal getAvMZSpacing_ | ( | const MSSpectrum< PeakType > & | scan, | |
Int | start_index = 0 , |
|||
Int | end_index = -1 | |||
) | throw () [inline, protected] |
Computes the average MZ spacing of scan
in the range start_index
to end_index
.
scan | The scan we are interested in. | |
start_index | An optional starting position (index) w.r.t. scan . | |
end_index | An optional final position (index) w.r.t. scan . |
DoubleReal chordTrapezoidRule_ | ( | const DoubleReal | a, | |
const DoubleReal | b, | |||
const DoubleReal | fa, | |||
const DoubleReal | fb | |||
) | throw () [inline, protected] |
The trapezoid rule for integration.
a | first x coordinate. | |
b | second x coordinate. | |
fa | a's corresponding function value. | |
fb | b's corresponding function value. |
DoubleReal chordTrapezoidRule_ | ( | const std::vector< DoubleReal > & | x, | |
const std::vector< DoubleReal > & | y | |||
) | throw () [inline, protected] |
The trapezoid rule for integration.
x | The x coordinates. | |
y | The function values. |
UInt getPeakCutOff_ | ( | const DoubleReal | mass, | |
const UInt | z | |||
) | [inline, protected] |
Estimates the number of peaks of an isotopic pattern at mass mass
and charge state z
.
mass | The mass. | |
z | The charge. |
void clusterSeeds_ | ( | const std::vector< MSSpectrum< PeakType > > & | candidates, | |
const MSSpectrum< PeakType > & | ref, | |||
const UInt | scan_index, | |||
const UInt | max_charge | |||
) | throw () [inline, protected] |
Clusters the seeds stored by push2TmpBox_.
candidates | A isotope wavelet transformed spectrum. | |
ref | The corresponding original spectrum (w.r.t. candidates ). | |
scan_index | The index of the scan under consideration (w.r.t. the original map). | |
max_charge | The maximal charge state we will consider. |
std::multimap<DoubleReal, Box_> open_boxes_ [protected] |
std::multimap<DoubleReal, Box_> closed_boxes_ [protected] |
std::vector<std::multimap<DoubleReal, Box_> >* tmp_boxes_ [protected] |
gsl_interp_accel* acc_ [protected] |
gsl_spline* spline_ [protected] |
DoubleReal av_MZ_spacing_ [protected] |
DoubleReal peak_cutoff_intercept_ [protected] |
DoubleReal peak_cutoff_slope_ [protected] |
std::vector<DoubleReal> c_mzs_ [protected] |
std::vector<DoubleReal> c_spacings_ [protected] |
std::vector<DoubleReal> psi_ [protected] |
std::vector<DoubleReal> prod_ [protected] |
std::vector<DoubleReal> xs_ [protected] |
Generated Tue Apr 1 15:36:47 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |