1
// -*- mode: C++; tab-width: 2; -*-
4
// --------------------------------------------------------------------------
5
// OpenMS Mass Spectrometry Framework
6
// --------------------------------------------------------------------------
7
// Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
9
// This library is free software; you can redistribute it and/or
10
// modify it under the terms of the GNU Lesser General Public
11
// License as published by the Free Software Foundation; either
12
// version 2.1 of the License, or (at your option) any later version.
14
// This library is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
// Lesser General Public License for more details.
19
// You should have received a copy of the GNU Lesser General Public
20
// License along with this library; if not, write to the Free Software
21
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
// --------------------------------------------------------------------------
24
// $Maintainer: Clemens Groepl $
25
// $Authors: Clemens Groepl, Marc Sturm $
26
// --------------------------------------------------------------------------
28
#include <OpenMS/FORMAT/MzMLFile.h>
29
#include <OpenMS/FORMAT/FeatureXMLFile.h>
30
#include <OpenMS/KERNEL/StandardTypes.h>
31
#include <OpenMS/KERNEL/RangeUtils.h>
32
#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/FeatureFinder_impl.h>
33
#include <OpenMS/APPLICATIONS/TOPPBase.h>
35
using namespace OpenMS;
38
//-------------------------------------------------------------
40
//-------------------------------------------------------------
43
@page TOPP_FeatureFinderIsotopeWavelet FeatureFinderIsotopeWavelet
45
@brief The feature detection application for quantitation.
50
<td ALIGN = "center" BGCOLOR="#EBEBEB" ROWSPAN=1> pot. predecessor tools </td>
51
<td VALIGN="middle" ROWSPAN=3> \f$ \longrightarrow \f$ FeatureFinderIsotopeWavelet \f$ \longrightarrow \f$</td>
52
<td ALIGN = "center" BGCOLOR="#EBEBEB"> pot. successor tools </td>
55
<td VALIGN="middle" ALIGN = "center" ROWSPAN=1> @ref TOPP_NoiseFilterSGolay </td>
56
<td VALIGN="middle" ALIGN = "center" ROWSPAN=1> @ref TOPP_MapAlignerPoseClustering @n (or another alignment tool) </td>
59
<td VALIGN="middle" ALIGN = "center" ROWSPAN=1> @ref TOPP_NoiseFilterGaussian </td>
60
<td VALIGN="middle" ALIGN = "center" ROWSPAN=1> @ref TOPP_FeatureLinkerUnlabeled @n (or another feature grouping tool) </td>
65
This module identifies "features" in a LC/MS map. By feature, we understand a peptide in a MS sample that
66
reveals a characteristic isotope distribution. The algorithm
67
computes positions in rt and m/z dimension and a charge estimate
70
The algorithm identifies pronounced regions of the data around so-called <tt>seeds</tt>.
71
In the next step, we iteratively fit a model of the isotope profile and the retention time to
72
these data points. Data points with a low probability under this model are removed from the
73
feature region. The intensity of the feature is then given by the sum of the data points included
76
How to find suitable parameters and details of the different algorithms implemented are described
77
in the @ref TOPP_example_featuredetection "TOPP tutorial".
79
@note that the wavelet transform is very slow on high-resolution spectra (i.e. FT, Orbitrap). We recommend
80
to use a noise or intensity filter to remove spurious points first and to speed-up the feature detection process.
82
Specialized tools are available for some experimental techniques: @ref TOPP_SILACAnalyzer, @ref TOPP_ITRAQAnalyzer.
84
<B>The command line parameters of this tool are:</B>
85
@verbinclude TOPP_FeatureFinderIsotopeWavelet.cli
87
For the parameters of the algorithm section see the algorithms documentation: @n
88
@ref OpenMS::FeatureFinderAlgorithmIsotopeWavelet "isotope_wavelet" @n
92
// We do not want this class to show up in the docu:
95
class TOPPFeatureFinderIsotopeWavelet
99
TOPPFeatureFinderIsotopeWavelet()
100
: TOPPBase("FeatureFinderIsotopeWavelet","Detects two-dimensional features in LC-MS data.")
105
void registerOptionsAndFlags_()
107
registerInputFile_("in","<file>","","input file");
108
setValidFormats_("in",StringList::create("mzML"));
109
registerOutputFile_("out","<file>","","output file");
110
setValidFormats_("out",StringList::create("featureXML"));
112
addText_("All other options of the FeatureFinder are set in the 'algorithm' section of the INI file.\n");
114
registerSubsection_("algorithm","Algorithm section");
117
Param getSubsectionDefaults_(const String& /*section*/) const
119
return FeatureFinder().getParameters(FeatureFinderAlgorithmIsotopeWavelet<Peak1D,Feature>::getProductName());
122
ExitCodes main_(int , const char**)
125
String in = getStringOption_("in");
127
//prevent loading of fragment spectra
128
PeakFileOptions options;
129
options.setMSLevels(vector<Int>(1,1));
133
f.getOptions() = options;
134
f.setLogType(log_type_);
143
//setup of FeatureFinder
145
ff.setLogType(log_type_);
147
// A map for the resulting features
148
FeatureMap<> features;
150
// get parameters specific for the feature finder
151
Param feafi_param = getParam_().copy("algorithm:",true);
152
writeDebug_("Parameters passed to FeatureFinder", feafi_param, 3);
154
// Apply the feature finder
155
ff.run(FeatureFinderAlgorithmIsotopeWavelet<Peak1D, Feature>::getProductName(), exp, features, feafi_param, seeds);
156
features.applyMemberFunction(&UniqueIdInterface::setUniqueId);
159
if (debug_level_ > 10)
161
FeatureMap<>::Iterator it;
162
for (it = features.begin(); it != features.end(); ++it)
164
if (!it->isMetaEmpty())
168
LOG_INFO << "Feature " << it->getUniqueId() << endl;
169
for (Size i = 0; i < keys.size(); i++)
171
LOG_INFO << " " << keys[i] << " = " << it->getMetaValue(keys[i]) << endl;
177
//-------------------------------------------------------------
179
//-------------------------------------------------------------
181
//annotate output with data processing info
182
addDataProcessing_(features, getProcessingInfo_(DataProcessing::QUANTITATION));
184
// write features to user specified output file
185
FeatureXMLFile map_file;
186
String out = getStringOption_("out");
188
map_file.store(out,features);
195
int main( int argc, const char** argv )
197
TOPPFeatureFinderIsotopeWavelet tool;
198
return tool.main(argc,argv);