Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
FeatureFinderAlgorithmIsotopeWavelet.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2013.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Rene Hussong $
32 // $Authors: $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_FEATUREFINDERALGORITHMISOTOPEWAVELET_H
36 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_FEATUREFINDERALGORITHMISOTOPEWAVELET_H
37 
43 #include <iostream>
44 #include <time.h>
45 #include <algorithm>
46 
47 #ifdef OPENMS_HAS_TBB
49 #include <tbb/task_scheduler_init.h>
50 #include <tbb/pipeline.h>
51 #include <tbb/parallel_for.h>
52 #endif
53 
54 
55 namespace OpenMS
56 {
75  template <typename PeakType, typename FeatureType>
77  public FeatureFinderAlgorithm<PeakType, FeatureType>
78  {
79 #ifdef OPENMS_HAS_TBB
80  friend class IsotopeWaveletParallelFor<PeakType, FeatureType>;
81 #endif
82 
83 public:
84 
86 
87 
90  {
91  this->defaults_.setValue("max_charge", 3, "The maximal charge state to be considered.");
92  this->defaults_.setMinInt("max_charge", 1);
93 
94  this->defaults_.setValue("intensity_threshold", -1., "The final threshold t' is build upon the formula: t' = av+t*sd, "
95  "where t is the intensity_threshold, av the average intensity within the wavelet transformed signal "
96  "and sd the standard deviation of the transform. "
97  "If you set intensity_threshold=-1, t' will be zero.\n"
98  "As the 'optimal' value for this parameter is highly data dependent, we would recommend to start "
99  "with -1, which will also extract features with very low signal-to-noise ratio. Subsequently, one "
100  "might increase the threshold to find an optimized trade-off between false positives and true positives. "
101  "Depending on the dynamic range of your spectra, suitable value ranges include: -1, [0:10], and if your data "
102  "features even very high intensity values, t can also adopt values up to around 30. "
103  "Please note that this parameter is not of an integer type, s.t. you can also use t:=0.1, e.g.");
104  this->defaults_.setValue("intensity_type", "ref", "Determines the intensity type returned for the identified features. 'ref' (default) returns the sum of the intensities of each isotopic peak within an isotope pattern. 'trans' refers to the intensity of the monoisotopic peak within the wavelet transform. 'corrected' refers also to the transformed intensity with an attempt to remove the effects of the convolution. While the latter ones might be preferable for qualitative analyses, 'ref' might be the best option to obtain quantitative results. Please note that intensity values might be spoiled (in particular for the option 'ref'), as soon as patterns overlap (see also the explanations given in the class documentation of FeatureFinderAlgorihtmIsotopeWavelet).", StringList::create("advanced"));
105  this->defaults_.setValidStrings("intensity_type", StringList::create("ref,trans,corrected"));
106 
107  this->defaults_.setValue("check_ppm", "false", "Enables/disables a ppm test vs. the averagine model, i.e. "
108  "potential peptide masses are checked for plausibility. In addition, a heuristic correcting potential mass shifts induced by the wavelet is applied.", StringList::create("advanced"));
109  this->defaults_.setValidStrings("check_ppm", StringList::create("true,false"));
110 
111  this->defaults_.setValue("hr_data", "false", "Must be true in case of high-resolution data, i.e. "
112  "for spectra featuring large m/z-gaps (present in FTICR and Orbitrap data, e.g.). Please check "
113  "a single MS scan out of your recording, if you are unsure.");
114  this->defaults_.setValidStrings("hr_data", StringList::create("true,false"));
115 
116 #if (defined(OPENMS_HAS_CUDA) || defined(OPENMS_HAS_TBB))
117  this->defaults_.setValue("parallel:use_gpus", "-1", "A comma-separated list of IDs corresponding to the GPU devices to use.\n"
118  "'-1' disables parallelization (CUDA/TBB) at all.\n");
119 #endif
120 
121  this->defaults_.setValue("sweep_line:rt_votes_cutoff", 5, "Defines the minimum number of "
122  "subsequent scans where a pattern must occur to be considered as a feature.", StringList::create("advanced"));
123  this->defaults_.setMinInt("sweep_line:rt_votes_cutoff", 0);
124  this->defaults_.setValue("sweep_line:rt_interleave", 1, "Defines the maximum number of "
125  "scans (w.r.t. rt_votes_cutoff) where an expected pattern is missing. There is usually no reason to change the default value.", StringList::create("advanced"));
126  this->defaults_.setMinInt("sweep_line:rt_interleave", 0);
127 
128  this->defaultsToParam_();
129  }
130 
133  {
134  }
135 
137  {
138  MSSpectrum<PeakType> * new_spec(createHRData(i));
140  iwt->initializeScanCuda(*new_spec);
141 
142  return c_trans;
143  }
144 
146  {
147  MSSpectrum<PeakType> spec((*this->map_)[i]);
148 
149  const MSSpectrum<PeakType> & specr((*this->map_)[i]);
150 
151  for (UInt j = 0; j < spec.size() - 1; ++j)
152  {
153  spec[j].setMZ(-1 * (specr[j + 1].getMZ() - specr[j].getMZ()));
154  spec[j].setIntensity((specr[j].getIntensity() + specr[j + 1].getIntensity()));
155  }
156  spec[spec.size() - 1].setMZ(-1); spec[spec.size() - 1].setIntensity(-1);
157 
158  ConstRefVector<MSSpectrum<PeakType> > c_sorted_spec(spec.begin(), spec.end());
159  //Sort in ascending order according to the intensities present in the transform
160  c_sorted_spec.sortByPosition();
161 
162 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
163  std::ofstream ofilex("spacings.trans");
164  for (UInt j = 0; j < spec.size() - 1; ++j)
165  {
166  ofilex << ::std::setprecision(12) << std::fixed << spec[j].getMZ() << "\t" << spec[j].getIntensity() << std::endl;
167  }
168  ofilex.close();
169 #endif
170 
171  UInt pos = 0;
172  while (c_sorted_spec[pos].getIntensity() <= 0)
173  {
174  if (++pos >= c_sorted_spec.size())
175  {
176  std::cout << "Detected empty scan or a scan that cannot be interpolated with zeros in HR mode. " << std::endl;
177  std::cout << "Please check scan # " << i << " of your data set." << std::endl;
178  exit(-1);
179  }
180  }
181  DoubleReal bound = -1 * c_sorted_spec[pos].getMZ();
182 
183  if (bound > (1. / max_charge_) / 2.)
184  {
185  //that might be case for simulated spectra,
186  //which might show a very artificial spacing
187  bound = (1. / max_charge_) / 2. / 4.;
188  }
189 
191  new_spec->reserve(200000);
192  new_spec->setRT(((*this->map_)[i]).getRT());
193  PeakType p; p.setMZ(specr[0].getMZ()); p.setIntensity(specr[0].getIntensity());
194  new_spec->push_back(p);
195 
196  UInt count;
197  for (UInt j = 0; j < spec.size() - 1; ++j)
198  {
199  count = 0;
200  while (-spec[j].getMZ() - count * bound > bound)
201  {
202  ++count;
203  p.setMZ(specr[j].getMZ() + count * bound); p.setIntensity(0);
204  new_spec->push_back(p);
205  }
206  p.setMZ(specr[j + 1].getMZ()); p.setIntensity(specr[j + 1].getIntensity());
207  new_spec->push_back(p);
208  }
209 
210 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
211  std::ofstream ofiley("new_spec.trans");
212  for (UInt j = 0; j < new_spec->size(); ++j)
213  {
214  ofiley << ::std::setprecision(12) << std::fixed << (*new_spec)[j].getMZ() << "\t" << (*new_spec)[j].getIntensity() << std::endl;
215  }
216  ofiley.close();
217 #endif
218 
219  return new_spec;
220  }
221 
223  void run()
224  {
225  DoubleReal max_mz = this->map_->getMax()[1];
226  DoubleReal min_mz = this->map_->getMin()[1];
227 
228  Size max_size = 0;
229 #ifdef OPENMS_HAS_CUDA
230  if (use_cuda_) //some preprocessing necessary for the GPU computation
231  {
232  for (UInt i = 0; i < this->map_->size(); ++i)
233  {
234  max_size = std::max(max_size, (*this->map_)[i].size());
235  }
236  }
237 #endif
238 
239  //Check for useless RT_votes_cutoff_ parameter
240  if (RT_votes_cutoff_ > this->map_->size())
241  {
243  }
244  else
245  {
247  }
248 
250  progress_counter_ = 0;
251  this->ff_->startProgress(0, 2 * this->map_->size() * max_charge_, "analyzing spectra");
252 
253 #if defined(OPENMS_HAS_TBB) && defined(OPENMS_HAS_CUDA)
254  if (use_tbb_)
255  {
256  UInt num_gpus = this->gpu_ids_.size();
257  tbb::task_scheduler_init init(num_gpus);
258  std::vector<IsotopeWaveletTransform<PeakType> *> iwts(num_gpus);
259 
260  for (UInt t = 0; t < num_gpus; ++t)
261  {
262  iwts[t] = new IsotopeWaveletTransform<PeakType>(min_mz, max_mz, max_charge_, max_size, true, hr_data_, intensity_type_);
263  }
264 
265  static tbb::affinity_partitioner ap;
266  //The parallel execution over all available GPU devices
267  tbb::parallel_for(tbb::blocked_range<size_t>(0, num_gpus, 1), IsotopeWaveletParallelFor<PeakType, FeatureType>(iwts, this), ap);
268 
269 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
270  std::cout << "Merging."; std::cout.flush();
271 #endif
272 
273  for (UInt t = 1; t < num_gpus; ++t)
274  {
275  iwts[0]->mergeFeatures(iwts[t], RT_interleave_, RT_votes_cutoff_);
276  }
277 
278 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
279  std::cout << "Final mapping."; std::cout.flush();
280 #endif
281  *this->features_ = iwts[0]->mapSeeds2Features(*this->map_, real_RT_votes_cutoff_);
282 
283  for (UInt t = 0; t < num_gpus; ++t)
284  {
285  delete (iwts[t]);
286  }
287  }
288 #else
289  if (use_tbb_)
290  {
291  std::cerr << "Error: You requested computation via TBB, but OpenMS has not been configured for TBB usage." << std::endl;
292  std::cerr << "Error: You need to rebuild OpenMS using the configure flag \"--enable-tbb-release\" or \"--enable-tbb-debug\"." << std::endl;
293  std::cerr << "Error: Please note that the multithreaded FeatureFinder needs necessarily the CUDA library, which must be enabled with \"--enable-cuda\"." << std::endl;
294  }
295 #endif
296 
297  if (!use_tbb_)
298  {
300 #ifdef OPENMS_HAS_CUDA
301  if (use_cuda_)
302  {
303  cudaSetDevice(gpu_ids_[0]);
304  std::cout << "Using device with ID: " << gpu_ids_[0] << std::endl;
305  cudaDeviceProp props;
306  cudaGetDeviceProperties(&props, gpu_ids_[0]);
307  std::cout << "This device is named: " << props.name << std::endl;
308  }
309 #endif
310 
311  for (UInt i = 0; i < this->map_->size(); ++i)
312  {
313  const MSSpectrum<PeakType> & c_ref((*this->map_)[i]);
314 
315 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
316  std::cout << ::std::fixed << ::std::setprecision(6) << "Spectrum " << i + 1 << " (" << (*this->map_)[i].getRT() << ") of " << this->map_->size() << " ... ";
317  std::cout.flush();
318 #endif
319 
320  if (c_ref.size() <= 1) //unable to do transform anything
321  {
322 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
323  std::cout << "scan empty or consisting of a single data point. Skipping." << std::endl;
324 #endif
325  this->ff_->setProgress(progress_counter_ += 2);
326  continue;
327  }
328 
329  if (!use_cuda_)
330  {
331  if (!hr_data_) //Lowres data
332  {
333  iwt->initializeScan((*this->map_)[i]);
334  for (UInt c = 0; c < max_charge_; ++c)
335  {
336  MSSpectrum<PeakType> c_trans(c_ref);
337 
338  iwt->getTransform(c_trans, c_ref, c);
339 
340 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
341  std::stringstream stream;
342  stream << "cpu_lowres_" << c_ref.getRT() << "_" << c + 1 << ".trans\0";
343  std::ofstream ofile(stream.str().c_str());
344  for (UInt k = 0; k < c_ref.size(); ++k)
345  {
346  ofile << ::std::setprecision(8) << std::fixed << c_trans[k].getMZ() << "\t" << c_trans[k].getIntensity() << "\t" << c_ref[k].getIntensity() << std::endl;
347  }
348  ofile.close();
349 #endif
350 
351 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
352  std::cout << "transform O.K. ... "; std::cout.flush();
353 #endif
355 
356  iwt->identifyCharge(c_trans, c_ref, i, c, intensity_threshold_, check_PPMs_);
357 
358 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
359  std::cout << "charge recognition O.K. ... "; std::cout.flush();
360 #endif
362  }
363  }
364  else //Highres data
365  {
366  MSSpectrum<PeakType> * new_spec(NULL);
367  for (UInt c = 0; c < max_charge_; ++c)
368  {
369  new_spec = createHRData(i);
370  iwt->initializeScan(*new_spec, c);
371  MSSpectrum<PeakType> c_trans(*new_spec);
372 
373  iwt->getTransformHighRes(c_trans, *new_spec, c);
374 
375 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
376  std::stringstream stream;
377  stream << "cpu_highres_" << new_spec->getRT() << "_" << c + 1 << ".trans\0";
378  std::ofstream ofile(stream.str().c_str());
379  for (UInt k = 0; k < new_spec->size(); ++k)
380  {
381  ofile << ::std::setprecision(8) << std::fixed << c_trans[k].getMZ() << "\t" << c_trans[k].getIntensity() << "\t" << (*new_spec)[k].getIntensity() << std::endl;
382  }
383  ofile.close();
384 #endif
385 
386 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
387  std::cout << "transform O.K. ... "; std::cout.flush();
388 #endif
390 
391  iwt->identifyCharge(c_trans, *new_spec, i, c, intensity_threshold_, check_PPMs_);
392 
393 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
394  std::cout << "charge recognition O.K. ... "; std::cout.flush();
395 #endif
397 
398  delete (new_spec); new_spec = NULL;
399  }
400  }
401  }
402  else //use CUDA but not TBB
403  {
404 #ifdef OPENMS_HAS_CUDA
405  bool success = true;
407  if (!hr_data_) //LowRes data
408  {
409  c_trans = new typename IsotopeWaveletTransform<PeakType>::TransSpectrum(&(*this->map_)[i]);
410  success = iwt->initializeScanCuda((*this->map_)[i]) == Constants::CUDA_INIT_SUCCESS;
411 
412  if (success)
413  {
414  for (UInt c = 0; c < max_charge_; ++c)
415  {
416  iwt->getTransformCuda(*c_trans, c);
417 
418 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
419  std::stringstream stream;
420  stream << "gpu_lowres_" << ((*this->map_)[i]).getRT() << "_" << c + 1 << ".trans\0";
421  std::ofstream ofile(stream.str().c_str());
422  for (UInt k = 0; k < c_trans->size(); ++k)
423  {
424  ofile << ::std::setprecision(8) << std::fixed << c_trans->getMZ(k) << "\t" << c_trans->getTransIntensity(k) << "\t" << c_trans->getRefIntensity(k) << std::endl;
425  }
426  ofile.close();
427 #endif
428 
429 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
430  std::cout << "cuda transform for charge " << c + 1 << " O.K. ... "; std::cout.flush();
431 #endif
433 
434  iwt->identifyChargeCuda(*c_trans, i, c, intensity_threshold_, check_PPMs_);
435 
436 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
437  std::cout << "cuda charge recognition for charge " << c + 1 << " O.K." << std::endl;
438 #endif
440  }
441  iwt->finalizeScanCuda();
442  }
443  else
444  {
445  std::cout << "Warning/Error generated at scan " << i << " (" << ((*this->map_)[i]).getRT() << ")." << std::endl;
446  }
447  }
448  else //HighRes data
449  {
450  c_trans = prepareHRDataCuda(i, iwt);
451  for (UInt c = 0; c < max_charge_; ++c)
452  {
453  iwt->getTransformCuda(*c_trans, c);
454 
455 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
456  std::stringstream stream;
457  stream << "gpu_highres_" << ((*this->map_)[i]).getRT() << "_" << c + 1 << ".trans\0";
458  std::ofstream ofile(stream.str().c_str());
459  for (UInt k = 0; k < c_trans->size(); ++k)
460  {
461  ofile << ::std::setprecision(8) << std::fixed << c_trans->getMZ(k) << "\t" << c_trans->getTransIntensity(k) << "\t" << c_trans->getRefIntensity(k) << std::endl;
462  }
463  ofile.close();
464 #endif
465 
466 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
467  std::cout << "cuda transform for charge " << c + 1 << " O.K. ... "; std::cout.flush();
468 #endif
470 
471  iwt->identifyChargeCuda(*c_trans, i, c, intensity_threshold_, check_PPMs_);
472 
473 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
474  std::cout << "cuda charge recognition for charge " << c + 1 << " O.K." << std::endl;
475 #endif
477  }
478  c_trans->destroy();
479  iwt->finalizeScanCuda();
480  }
481 
482  delete (new_spec); new_spec = NULL;
483  delete (c_trans); c_trans = NULL;
484 
485 #else
486  std::cerr << "Error: You requested computation on GPU, but OpenMS has not been configured for CUDA usage." << std::endl;
487  std::cerr << "Error: You need to rebuild OpenMS using the configure flag \"--enable-cuda\"." << std::endl;
488 #endif
489  }
490 
492 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
493  std::cout << "updated box states." << std::endl;
494 #endif
495 
496  std::cout.flush();
497  }
498 
499  this->ff_->endProgress();
500 
501  //Forces to empty OpenBoxes_ and to synchronize ClosedBoxes_
503 
504 #ifdef OPENMS_DEBUG_ISOTOPE_WAVELET
505  std::cout << "Final mapping."; std::cout.flush();
506 #endif
507  *this->features_ = iwt->mapSeeds2Features(*this->map_, real_RT_votes_cutoff_);
508 
509  delete (iwt);
510  }
511  else
512  {
513 #ifndef OPENMS_HAS_TBB
514  std::cerr << "Error: You requested multi-threaded computation via threading building blocks, but OpenMS has not been configured for TBB usage." << std::endl;
515  std::cerr << "Error: You need to rebuild OpenMS with -DENABLE_TBB=ON." << std::endl;
516 #endif
517  }
518  }
519 
520  static const String getProductName()
521  {
522  return "isotope_wavelet";
523  }
524 
526  {
528  }
529 
530 protected:
531 
533  struct BoxElement
534  {
536  UInt c;
540  };
541 
542  typedef std::map<UInt, BoxElement> Box;
543 
549  std::vector<UInt> gpu_ids_;
550 
551 #if defined(OPENMS_HAS_TBB) && defined(OPENMS_HAS_CUDA)
552  tbb::atomic<int> progress_counter_;
553  Int device_num_, gpu_to_exclude_;
554 #else
556 #endif
557 
559  {
560  max_charge_ = this->param_.getValue("max_charge");
561  intensity_threshold_ = this->param_.getValue("intensity_threshold");
562  RT_votes_cutoff_ = this->param_.getValue("sweep_line:rt_votes_cutoff");
563  RT_interleave_ = this->param_.getValue("sweep_line:rt_interleave");
565  check_PPMs_ = ((String)(this->param_.getValue("check_ppm")) == "true");
566  hr_data_ = ((String)(this->param_.getValue("hr_data")) == "true");
567  intensity_type_ = ((String)(this->param_.getValue("intensity_type")));
568 #if defined(OPENMS_HAS_CUDA) || defined(OPENMS_HAS_TBB)
569  use_gpus_ = this->param_.getValue("parallel:use_gpus");
570  std::vector<String> tokens;
571  if (!use_gpus_.split(',', tokens))
572  {
573  tokens.push_back(use_gpus_);
574  }
575  //Attention: updateMembers_ can be called several times!
576  gpu_ids_.clear();
577  if (tokens[0].trim().toInt() == -1) //no parallelization
578  {
579  use_cuda_ = false;
580  use_tbb_ = false;
581  return;
582  }
583  gpu_ids_.push_back(tokens[0].trim().toInt());
584  use_cuda_ = true;
585  use_tbb_ = false;
586  for (UInt i = 1; i < tokens.size(); ++i)
587  {
588  if (tokens[i].trim().toInt() == (Int) gpu_ids_[i - 1])
589  {
590  continue;
591  }
592  gpu_ids_.push_back(tokens[i].trim().toInt());
593  use_tbb_ = true;
594  }
595 #else
596  use_cuda_ = false;
597  use_tbb_ = false;
598 #endif
599  }
600 
601  };
602 
603 } //namespace
604 
605 #endif
const int CUDA_INIT_SUCCESS
Definition: IsotopeWaveletConstants.h:92
const double k
FeatureMap< Feature > mapSeeds2Features(const MSExperiment< PeakType > &map, const UInt RT_votes_cutoff)
Filters the candidates further more and maps the internally used data structures to the OpenMS framew...
Definition: IsotopeWaveletTransform.h:2313
virtual void getTransform(MSSpectrum< PeakType > &c_trans, const MSSpectrum< PeakType > &c_ref, const UInt c)
Computes the isotope wavelet transform of charge state c.
Definition: IsotopeWaveletTransform.h:693
FeatureMapType * features_
Output data pointer.
Definition: FeatureFinderAlgorithm.h:144
Param defaults_
Container for default parameters. This member should be filled in the constructor of derived classes!...
Definition: DefaultParamHandler.h:155
void setValue(const String &key, const DataValue &value, const String &description="", const StringList &tags=StringList())
Sets a value.
virtual void destroy()
Definition: IsotopeWaveletTransform.h:137
A more convenient string class.
Definition: String.h:56
FeatureFinder * ff_
Pointer to the calling FeatureFinder that is used to access the feature flags.
Definition: FeatureFinderAlgorithm.h:147
Size size() const
Definition: MSExperiment.h:117
void setMZ(CoordinateType coordinate)
Mutable access to the m/z coordinate (index 1)
Definition: Peak2D.h:197
String use_gpus_
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:547
Param param_
Container for current parameters.
Definition: DefaultParamHandler.h:148
bool use_tbb_
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:548
const MapType * map_
Input data pointer.
Definition: FeatureFinderAlgorithm.h:141
FeatureFinderAlgorithm< PeakType, FeatureType > Base
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:85
static void setMaxCharge(const UInt max_charge)
Sets the max_charge parameter.
Definition: IsotopeWavelet.h:116
DoubleReal score
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:537
#define NULL
Definition: IsotopeWaveletParallelFor.h:41
std::map< UInt, BoxElement > Box
Key: RT (index), value: BoxElement.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:542
Abstract base class for FeatureFinder algorithms.
Definition: FeatureFinderAlgorithm.h:74
UInt RT_interleave_
The number of subsequent scans a pattern must cover in order to be considered as signal.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:546
static const String getProductName()
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:520
UInt c
Note, this is not the charge (it is charge-1!!!)
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:536
DoubleReal mz
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:535
const double c
const PositionType & getMax() const
Returns the maximum position.
Definition: RangeManager.h:115
DoubleReal intens
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:538
Internally (only by GPUs) used data structure . It allows efficient data exchange between CPU and GPU...
Definition: IsotopeWaveletTransform.h:112
void setIntensity(IntensityType intensity)
Non-mutable access to the data point intensity (height)
Definition: Peak2D.h:167
virtual void getTransformHighRes(MSSpectrum< PeakType > &c_trans, const MSSpectrum< PeakType > &c_ref, const UInt c)
Computes the isotope wavelet transform of charge state c.
Definition: IsotopeWaveletTransform.h:736
Internally used data structure for the sweep line algorithm.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:533
DoubleReal getMZ(const UInt i) const
Definition: IsotopeWaveletTransform.h:152
void endProgress() const
Ends the progress display.
const DataValue & getValue(const String &key) const
Returns a value of a parameter.
virtual ~FeatureFinderAlgorithmIsotopeWavelet()
Destructor.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:132
bool use_cuda_
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:548
virtual void initializeScan(const MSSpectrum< PeakType > &c_ref, const UInt c=0)
Definition: IsotopeWaveletTransform.h:774
const PositionType & getMin() const
Returns the minimum position.
Definition: RangeManager.h:109
A class implementing the isotope wavelet transform. If you just want to find features using the isoto...
Definition: IsotopeWaveletTransform.h:87
DoubleReal intensity_threshold_
The only parameter of the isotope wavelet.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:545
Implements the isotope wavelet feature finder.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:76
static StringList create(const String &list, const char splitter= ',')
Returns a list that is created by splitting the given (comma-separated) string (String are not trimme...
DoubleReal RT
The elution time (not the scan index)
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:539
void updateBoxStates(const MSExperiment< PeakType > &map, const Size scan_index, const UInt RT_interleave, const UInt RT_votes_cutoff, const Int front_bound=-1, const Int end_bound=-1)
A function keeping track of currently open and closed sweep line boxes. This function is used by the ...
Definition: IsotopeWaveletTransform.h:2029
MSSpectrum< PeakType > * createHRData(const UInt i)
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:145
void updateMembers_()
This method is used to update extra member variables at the end of the setParameters() method...
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:558
virtual void identifyCharge(const MSSpectrum< PeakType > &candidates, const MSSpectrum< PeakType > &ref, const UInt scan_index, const UInt c, const DoubleReal ampl_cutoff, const bool check_PPMs)
Given an isotope wavelet transformed spectrum candidates, this function assigns to every significant ...
Definition: IsotopeWaveletTransform.h:1180
String intensity_type_
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:547
void setValidStrings(const String &key, const std::vector< String > &strings)
Sets the valid strings for the parameter key.
DoubleReal getTransIntensity(const UInt i) const
Definition: IsotopeWaveletTransform.h:164
IsotopeWaveletTransform< PeakType >::TransSpectrum * prepareHRDataCuda(const UInt i, IsotopeWaveletTransform< PeakType > *iwt)
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:136
Command line progress.
Definition: ProgressLogger.h:68
void setMinInt(const String &key, Int min)
Sets the minimum value for the integer or integer list parameter key.
void setRT(DoubleReal rt)
Sets the absolute retention time (is seconds)
Definition: MSSpectrum.h:221
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:144
void startProgress(SignedSize begin, SignedSize end, const String &label) const
Initializes the progress display.
bool hr_data_
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:548
A class for distributing the data over several GPUs using Intel Threading Building Blocks...
Definition: IsotopeWaveletParallelFor.h:52
Int progress_counter_
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:555
UInt max_charge_
The maximal charge state we will consider.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:544
void setProgress(SignedSize value) const
Sets the current progress.
Size size() const
Definition: IsotopeWaveletTransform.h:176
FeatureFinderAlgorithmIsotopeWavelet()
Default Constructor.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:89
DoubleReal getRT() const
Definition: MSSpectrum.h:215
This vector holds pointer to the elements of another container.
Definition: ConstRefVector.h:72
DoubleReal getRefIntensity(const UInt i) const
Definition: IsotopeWaveletTransform.h:158
void sortByPosition()
Lexicographically sorts the elements by their position.
Definition: ConstRefVector.h:766
UInt RT_votes_cutoff_
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:546
int Int
Signed integer type.
Definition: Types.h:100
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const
Splits a string into substrings using splitter as delimiter.
static FeatureFinderAlgorithm< PeakType, FeatureType > * create()
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:525
void run()
The working horse of this class.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:223
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
void defaultsToParam_()
Updates the parameters after the defaults have been set in the constructor.
bool check_PPMs_
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:548
UInt real_RT_votes_cutoff_
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:546
std::vector< UInt > gpu_ids_
A list of all GPU devices that can be used.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:549

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:13 using doxygen 1.8.5