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.
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.
30
// --------------------------------------------------------------------------
31
// $Maintainer: Stephan Aiche $
32
// $Authors: Stephan Aiche $
33
// --------------------------------------------------------------------------
34
#include <OpenMS/KERNEL/MSExperiment.h>
35
#include <OpenMS/APPLICATIONS/TOPPBase.h>
36
#include <OpenMS/ANALYSIS/QUANTITATION/ItraqChannelExtractor.h>
37
#include <OpenMS/ANALYSIS/QUANTITATION/ItraqQuantifier.h>
38
#include <OpenMS/ANALYSIS/QUANTITATION/ItraqConstants.h>
39
#include <OpenMS/FORMAT/ConsensusXMLFile.h>
40
#include <OpenMS/FORMAT/MzMLFile.h>
41
#include <OpenMS/SYSTEM/File.h>
42
#include <OpenMS/FORMAT/MzQuantMLFile.h>
43
#include <OpenMS/METADATA/MSQuantifications.h>
45
using namespace OpenMS;
48
// NOTE: This tool is a copy if ITRAQAnalyzer with the difference that it sets, the mode
49
// automatically to TMT_SIXPLEX and ignores all iTRAQ-modes.
51
//-------------------------------------------------------------
53
//-------------------------------------------------------------
56
@page TOPP_TMTAnalyzer TMTAnalyzer
58
@brief Extracts and normalizes TMT information from an MS experiment.
63
<td ALIGN = "center" BGCOLOR="#EBEBEB"> pot. predecessor tools </td>
64
<td VALIGN="middle" ROWSPAN=3> \f$ \longrightarrow \f$ TMTAnalyzer \f$ \longrightarrow \f$</td>
65
<td ALIGN = "center" BGCOLOR="#EBEBEB"> pot. successor tools </td>
68
<td VALIGN="middle" ALIGN = "center" ROWSPAN=1> @ref TOPP_FileConverter </td>
69
<td VALIGN="middle" ALIGN = "center" ROWSPAN=2> @ref TOPP_IDMapper</td>
72
<td VALIGN="middle" ALIGN = "center" ROWSPAN=1> @ref TOPP_FileFilter </td>
77
Extract the TMT reporter ion intensities (6plex) from raw MS2 data, does isotope corrections and
78
stores the resulting quantitation as consensusXML, where each consensus centroid corresponds to
79
one TMT MS2 scan (e.g., CID). The position of the centroid is the precursor position, its
80
sub-elements are the channels (thus having m/z's of 126-131).
82
Isotope correction is done using non-negative least squares (NNLS). See @ref TOPP_ITRAQAnalyzer
85
The correction matrices can be found (and changed) in the INI file. However, these matrices for
86
TMT are now stable, and every kit delivered should have the same isotope
87
correction values. Thus, there should be no need to change them, but feel free to compare the
88
values in the INI file with your kit's Certificate.
90
After this quantitation step, you might want to annotate the consensus elements with the
91
respective identifications, obtained from an identification pipeline.
92
Note that quantification is solely on peptide level at this stage. In order to obtain protein
93
quantifications, you can try @ref TOPP_TextExporter to obtain a simple text format which you can
94
feed to other software tools (e.g., R), or you can try @ref TOPP_ProteinQuantifier.
96
<B>The command line parameters of this tool are:</B>
97
@verbinclude TOPP_TMTAnalyzer.cli
98
<B>INI file documentation of this tool:</B>
99
@htmlinclude TOPP_TMTAnalyzer.html
102
// We do not want this class to show up in the docu:
103
/// @cond TOPPCLASSES
105
class TOPPTMTAnalyzer :
110
TOPPBase("TMTAnalyzer", "Calculates TMT quantitative values for peptides", true, true)
115
void registerOptionsAndFlags_()
117
registerInputFile_("in", "<file>", "", "input raw/picked data file ");
118
setValidFormats_("in", StringList::create("mzML"));
119
registerOutputFile_("out", "<file>", "", "output consensusXML file with quantitative information");
120
setValidFormats_("out", StringList::create("consensusXML"));
122
registerOutputFile_("out_mzq", "<file>", "", "Optional output file of MzQuantML.", false, true);
123
setValidFormats_("out_mzq", StringList::create("mzq"));
125
registerOutputFile_("out_stats", "<file>", "", "output statistics as tab-separated file (readable by R or Excel or ...)", false);
126
setValidFormats_("out_stats", StringList::create("tsv"));
130
registerSubsection_("algorithm", "Algorithm parameters section");
133
Param getSubsectionDefaults_(const String & /*section*/) const
136
tmp.insert("Extraction:", ItraqChannelExtractor(ItraqQuantifier::TMT_SIXPLEX).getParameters());
137
tmp.insert("Quantification:", ItraqQuantifier(ItraqQuantifier::TMT_SIXPLEX).getParameters());
138
tmp.setValue("MetaInformation:Program", "OpenMS::TMTAnalyzer", "", StringList::create("advanced"));
142
ExitCodes main_(int, const char **)
144
//-------------------------------------------------------------
145
// parameter handling
146
//-------------------------------------------------------------
147
String in = getStringOption_("in");
148
String out = getStringOption_("out");
149
String out_stats = getStringOption_("out_stats");
150
String out_mzq = getStringOption_("out_mzq");
152
Int itraq_type = ItraqQuantifier::TMT_SIXPLEX;
153
//-------------------------------------------------------------
155
//-------------------------------------------------------------
157
MzMLFile mz_data_file;
158
MSExperiment<Peak1D> exp;
159
mz_data_file.setLogType(log_type_);
160
mz_data_file.load(in, exp);
162
//-------------------------------------------------------------
164
//-------------------------------------------------------------
165
Param extract_param(getParam_().copy("algorithm:Extraction:", true));
166
ItraqChannelExtractor itraq_ce(itraq_type, extract_param);
168
ConsensusMap consensus_map_raw, consensus_map_quant;
169
// extract raw signals
170
itraq_ce.run(exp, consensus_map_raw);
173
Param quant_param(getParam_().copy("algorithm:Quantification:", true));
174
ItraqQuantifier itraq_quant(itraq_type, quant_param);
176
itraq_quant.run(consensus_map_raw, consensus_map_quant);
178
// assign unique ID to output file (this might throw an exception.. but thats ok, as we want the program to quit then)
179
if (getStringOption_("id_pool").trim().length() > 0) getDocumentIDTagger_().tag(consensus_map_quant);
181
// annotate output file with MetaInformation
182
Param metainfo_param(getParam_().copy("algorithm:MetaInformation:", true));
183
for (Param::ParamIterator it = metainfo_param.begin(); it != metainfo_param.end(); ++it)
185
consensus_map_quant.setMetaValue(it->name, it->value);
189
//-------------------------------------------------------------
191
//-------------------------------------------------------------
193
//annotate output with data processing info
194
addDataProcessing_(consensus_map_quant, getProcessingInfo_(DataProcessing::QUANTITATION));
196
// add filename references
197
for (ConsensusMap::FileDescriptions::iterator it = consensus_map_quant.getFileDescriptions().begin();
198
it != consensus_map_quant.getFileDescriptions().end();
201
it->second.filename = in;
204
ConsensusXMLFile cm_file;
205
cm_file.store(out, consensus_map_quant);
207
if (!out_mzq.trim().empty())
209
MSQuantifications msq;
210
std::vector<std::vector<std::pair<String, DoubleReal> > > labels;
211
if (itraq_type == ItraqQuantifier::FOURPLEX)
213
for (Size i = 0; i < 4; ++i)
215
std::vector<std::pair<String, DoubleReal> > one_label;
216
one_label.push_back(std::make_pair<String, DoubleReal>(String("Channel ") + String(ItraqConstants::CHANNELS_FOURPLEX[i][0]), DoubleReal(ItraqConstants::CHANNELS_FOURPLEX[i][0])));
217
labels.push_back(one_label);
220
else //ItraqQuantifier::EIGHTPLEX
222
for (Size i = 0; i < 8; ++i)
224
std::vector<std::pair<String, DoubleReal> > one_label;
225
one_label.push_back(std::make_pair<String, DoubleReal>(String("Channel ") + String(ItraqConstants::CHANNELS_FOURPLEX[i][0]), DoubleReal(ItraqConstants::CHANNELS_FOURPLEX[i][0])));
226
labels.push_back(one_label);
229
msq.registerExperiment(exp, labels); //add assays
231
MSQuantifications::QUANT_TYPES quant_type = MSQuantifications::MS2LABEL;
232
msq.setAnalysisSummaryQuantType(quant_type); //add analysis_summary_
234
msq.addConsensusMap(consensus_map_quant); //add ITRAQAnalyzer result
235
//~ add AuditCollection - no such concept in TOPPTools yet
237
file.store(out_mzq, msq);
240
std::cout << itraq_quant.getStats();
241
if (!out_stats.trim().empty())
244
f.open(out_stats.c_str(), ios_base::out);
245
f << itraq_quant.getStats();
254
int main(int argc, const char ** argv)
256
TOPPTMTAnalyzer tool;
257
return tool.main(argc, argv);