~ubuntu-branches/ubuntu/wily/openms/wily

« back to all changes in this revision

Viewing changes to source/APPLICATIONS/TOPP/MapAlignerSpectrum.C

  • Committer: Package Import Robot
  • Author(s): Filippo Rusconi
  • Date: 2012-11-12 15:58:12 UTC
  • Revision ID: package-import@ubuntu.com-20121112155812-vr15wtg9b50cuesg
Tags: upstream-1.9.0
ImportĀ upstreamĀ versionĀ 1.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode: C++; tab-width: 2; -*-
 
2
// vi: set ts=2:
 
3
//
 
4
// --------------------------------------------------------------------------
 
5
//                   OpenMS Mass Spectrometry Framework
 
6
// --------------------------------------------------------------------------
 
7
//  Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
 
8
//
 
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.
 
13
//
 
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.
 
18
//
 
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
 
22
//
 
23
// --------------------------------------------------------------------------
 
24
// $Maintainer: Clemens Groepl $
 
25
// $Authors: Marc Sturm, Clemens Groepl $
 
26
// --------------------------------------------------------------------------
 
27
 
 
28
#include <OpenMS/ANALYSIS/MAPMATCHING/MapAlignmentAlgorithmSpectrumAlignment.h>
 
29
#include <OpenMS/APPLICATIONS/MapAlignerBase.h>
 
30
 
 
31
using namespace OpenMS;
 
32
using namespace std;
 
33
 
 
34
//-------------------------------------------------------------
 
35
// Doxygen docu
 
36
//-------------------------------------------------------------
 
37
 
 
38
/**
 
39
        @page TOPP_MapAlignerSpectrum MapAlignerSpectrum
 
40
 
 
41
                @brief Corrects retention time distortions between maps by aligning spectra.
 
42
 
 
43
<CENTER>
 
44
        <table>
 
45
                <tr>
 
46
                        <td ALIGN = "center" BGCOLOR="#EBEBEB"> potential predecessor tools </td>
 
47
                        <td VALIGN="middle" ROWSPAN=2> \f$ \longrightarrow \f$ MapAlignerSpectrumAlignment \f$ \longrightarrow \f$</td>
 
48
                        <td ALIGN = "center" BGCOLOR="#EBEBEB"> potential successor tools </td>
 
49
                </tr>
 
50
                <tr>
 
51
                        <td VALIGN="middle" ALIGN = "center" ROWSPAN=1> @ref TOPP_FileConverter </td>
 
52
                        <td VALIGN="middle" ALIGN = "center" ROWSPAN=1> @ref TOPP_FeatureFinderCentroided @n (or another feature finding algorithm) </td>
 
53
                </tr>
 
54
        </table>
 
55
</CENTER>
 
56
 
 
57
        This tool provides an algorithm to align the retention time scales of multiple input files, correcting shifts and distortions between them. Retention time adjustment may be necessary to correct for chromatography differences e.g. before data from multiple LC-MS runs can be combined (feature grouping), or when one run should be annotated with peptide identifications obtained in a different run.
 
58
 
 
59
                All map alignment tools (MapAligner...) collect retention time data from the input files and - by fitting a model to this data - compute transformations that map all runs to a common retention time scale. They can apply the transformations right away and return output files with aligned time scales (parameter @p out), and/or return descriptions of the transformations in trafoXML format (parameter @p trafo_out). Transformations stored as trafoXML can be applied to arbitrary files with the @ref TOPP_MapRTTransformer tool.
 
60
 
 
61
        The map alignment tools differ in how they obtain retention time data for the modeling of transformations, and consequently what types of data they can be applied to. Here, an experimental algorithm based on spectrum alignment is implemented. It is only applicable to peak maps (mzML format).
 
62
        For more details and algorithm-specific parameters (set in the INI file) see "Detailed Description" in the @ref OpenMS::MapAlignmentAlgorithmSpectrumAlignment "algorithm documentation".
 
63
 
 
64
        @see @ref TOPP_MapAlignerIdentification @ref TOPP_MapAlignerPoseClustering @ref TOPP_MapRTTransformer
 
65
 
 
66
        Since %OpenMS 1.8, the extraction of data for the alignment has been separate from the modeling of RT transformations based on that data. It is now possible to use different models independently of the chosen algorithm. This algorithm has been tested mostly with the "interpolated" model. The different available models are:
 
67
        - @ref OpenMS::TransformationModelLinear "linear": Linear model.
 
68
        - @ref OpenMS::TransformationModelBSpline "b_spline": Smoothing spline (non-linear).
 
69
        - @ref OpenMS::TransformationModelInterpolated "interpolated": Different types of interpolation.
 
70
 
 
71
        The following parameters control the modeling of RT transformations (they can be set in the "model" section of the INI file):
 
72
        @htmlinclude OpenMS_MapAlignerSpectrumModel.parameters @n
 
73
 
 
74
        <B>The command line parameters of this tool are:</B> @n
 
75
        @verbinclude TOPP_MapAlignerSpectrum.cli
 
76
 
 
77
*/
 
78
 
 
79
// We do not want this class to show up in the docu:
 
80
/// @cond TOPPCLASSES
 
81
 
 
82
class TOPPMapAlignerSpectrum
 
83
  : public TOPPMapAlignerBase
 
84
{
 
85
 
 
86
public:
 
87
        TOPPMapAlignerSpectrum()
 
88
                : TOPPMapAlignerBase("MapAlignerSpectrum", "Corrects retention time distortions between maps by spectrum alignment.")
 
89
        {
 
90
        }
 
91
 
 
92
protected:
 
93
        void registerOptionsAndFlags_()
 
94
        {
 
95
                String formats = "mzML";
 
96
                TOPPMapAlignerBase::registerOptionsAndFlags_(formats);
 
97
                // no support for a reference file yet
 
98
                registerSubsection_("algorithm", "Algorithm parameters section");
 
99
                registerSubsection_("model", "Options to control the modeling of retention time transformations from data");
 
100
        }
 
101
 
 
102
        Param getSubsectionDefaults_(const String& section) const
 
103
        {
 
104
                if (section == "algorithm")
 
105
                {
 
106
                        MapAlignmentAlgorithmSpectrumAlignment algo;
 
107
                        return algo.getParameters();
 
108
                }
 
109
                if (section == "model")
 
110
                {
 
111
                        return getModelDefaults("interpolated");
 
112
                }
 
113
                return Param(); // shouldn't happen
 
114
        }
 
115
 
 
116
        ExitCodes main_(int, const char**)
 
117
        {
 
118
                MapAlignmentAlgorithmSpectrumAlignment algorithm;
 
119
                return TOPPMapAlignerBase::commonMain_(&algorithm);
 
120
        }
 
121
};
 
122
 
 
123
 
 
124
int main(int argc, const char** argv)
 
125
{
 
126
  TOPPMapAlignerSpectrum tool;
 
127
  return tool.main(argc, argv);
 
128
}
 
129
 
 
130
/// @endcond