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

« back to all changes in this revision

Viewing changes to source/ANALYSIS/QUANTITATION/ItraqEightPlexQuantitationMethod.C

  • Committer: Package Import Robot
  • Author(s): Filippo Rusconi
  • Date: 2013-12-20 11:30:16 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20131220113016-wre5g9bteeheq6he
Tags: 1.11.1-3
* remove version number from libbost development package names;
* ensure that AUTHORS is correctly shipped in all packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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: Stephan Aiche $
 
32
// $Authors: Stephan Aiche $
 
33
// --------------------------------------------------------------------------
 
34
 
 
35
#include <OpenMS/ANALYSIS/QUANTITATION/ItraqEightPlexQuantitationMethod.h>
 
36
 
 
37
namespace OpenMS
 
38
{
 
39
  const String ItraqEightPlexQuantitationMethod::name_ = "itraq8plex";
 
40
 
 
41
  ItraqEightPlexQuantitationMethod::ItraqEightPlexQuantitationMethod()
 
42
  {
 
43
    setName("ItraqFourPlexQuantitationMethod");
 
44
 
 
45
    // create the channel map
 
46
    channels_.push_back(IsobaricChannelInformation(113, 0, "", 113.1078));
 
47
    channels_.push_back(IsobaricChannelInformation(114, 1, "", 114.1112));
 
48
    channels_.push_back(IsobaricChannelInformation(115, 2, "", 115.1082));
 
49
    channels_.push_back(IsobaricChannelInformation(116, 3, "", 116.1116));
 
50
    channels_.push_back(IsobaricChannelInformation(117, 4, "", 117.1149));
 
51
    channels_.push_back(IsobaricChannelInformation(118, 5, "", 118.1120));
 
52
    channels_.push_back(IsobaricChannelInformation(119, 6, "", 119.1153));
 
53
    channels_.push_back(IsobaricChannelInformation(121, 7, "", 121.1220));
 
54
 
 
55
    // we assume 114 to be the reference
 
56
    reference_channel_ = 0;
 
57
 
 
58
    setDefaultParams_();
 
59
  }
 
60
 
 
61
  ItraqEightPlexQuantitationMethod::~ItraqEightPlexQuantitationMethod()
 
62
  {
 
63
  }
 
64
 
 
65
  ItraqEightPlexQuantitationMethod::ItraqEightPlexQuantitationMethod(const ItraqEightPlexQuantitationMethod& other)
 
66
  {
 
67
    channels_.clear();
 
68
    channels_.insert(channels_.begin(), other.channels_.begin(), other.channels_.end());
 
69
 
 
70
    reference_channel_ = other.reference_channel_;
 
71
  }
 
72
 
 
73
  ItraqEightPlexQuantitationMethod& ItraqEightPlexQuantitationMethod::operator=(const ItraqEightPlexQuantitationMethod& rhs)
 
74
  {
 
75
    if (this == &rhs)
 
76
      return *this;
 
77
 
 
78
    channels_.clear();
 
79
    channels_.insert(channels_.begin(), rhs.channels_.begin(), rhs.channels_.end());
 
80
 
 
81
    reference_channel_ = rhs.reference_channel_;
 
82
 
 
83
    return *this;
 
84
  }
 
85
 
 
86
  void ItraqEightPlexQuantitationMethod::setDefaultParams_()
 
87
  {
 
88
    defaults_.setValue("channel_113_description", "", "Description for the content of the 113 channel.");
 
89
    defaults_.setValue("channel_114_description", "", "Description for the content of the 114 channel.");
 
90
    defaults_.setValue("channel_115_description", "", "Description for the content of the 115 channel.");
 
91
    defaults_.setValue("channel_116_description", "", "Description for the content of the 116 channel.");
 
92
    defaults_.setValue("channel_117_description", "", "Description for the content of the 117 channel.");
 
93
    defaults_.setValue("channel_118_description", "", "Description for the content of the 118 channel.");
 
94
    defaults_.setValue("channel_119_description", "", "Description for the content of the 119 channel.");
 
95
    defaults_.setValue("channel_121_description", "", "Description for the content of the 121 channel.");
 
96
    defaults_.setValue("reference_channel", 113, "Number of the reference channel (113-121). Please note that 120 is not valid.");
 
97
    defaults_.setMinInt("reference_channel", 113);
 
98
    defaults_.setMaxInt("reference_channel", 121);
 
99
 
 
100
//    {0.00, 0.00, 6.89, 0.22},   //113
 
101
//    {0.00, 0.94, 5.90, 0.16},
 
102
//    {0.00, 1.88, 4.90, 0.10},
 
103
//    {0.00, 2.82, 3.90, 0.07},
 
104
//    {0.06, 3.77, 2.99, 0.00},
 
105
//    {0.09, 4.71, 1.88, 0.00},
 
106
//    {0.14, 5.66, 0.87, 0.00},
 
107
//    {0.27, 7.44, 0.18, 0.00}    //121
 
108
    defaults_.setValue("correction_matrix", StringList::create("0.00/0.00/6.89/0.22," //113
 
109
                                                               "0.00/0.94/5.90/0.16,"
 
110
                                                               "0.00/1.88/4.90/0.10,"
 
111
                                                               "0.00/2.82/3.90/0.07,"
 
112
                                                               "0.06/3.77/2.99/0.00,"
 
113
                                                               "0.09/4.71/1.88/0.00,"
 
114
                                                               "0.14/5.66/0.87/0.00,"
 
115
                                                               "0.27/7.44/0.18/0.00"), //121
 
116
                       "Override default values (see Documentation); use the following format: <-2Da>/<-1Da>/<+1Da>/<+2Da> ; e.g. '0/0.3/4/0' , '0.1/0.3/3/0.2'");
 
117
 
 
118
    defaultsToParam_();
 
119
  }
 
120
 
 
121
  void ItraqEightPlexQuantitationMethod::updateMembers_()
 
122
  {
 
123
    channels_[0].description = param_.getValue("channel_113_description");
 
124
    channels_[1].description = param_.getValue("channel_114_description");
 
125
    channels_[2].description = param_.getValue("channel_115_description");
 
126
    channels_[3].description = param_.getValue("channel_116_description");
 
127
    channels_[4].description = param_.getValue("channel_117_description");
 
128
    channels_[5].description = param_.getValue("channel_118_description");
 
129
    channels_[6].description = param_.getValue("channel_119_description");
 
130
    channels_[7].description = param_.getValue("channel_121_description");
 
131
 
 
132
    // compute the index of the reference channel
 
133
    Int ref_ch = param_.getValue("reference_channel");
 
134
    if (ref_ch == 121)
 
135
    {
 
136
      reference_channel_ = 7;
 
137
    }
 
138
    else if (ref_ch == 120)
 
139
    {
 
140
      LOG_WARN << "Invalid channel selection." << std::endl;
 
141
    }
 
142
    else
 
143
    {
 
144
      reference_channel_ = ref_ch - 113;
 
145
    }
 
146
  }
 
147
 
 
148
  const String& ItraqEightPlexQuantitationMethod::getName() const
 
149
  {
 
150
    return ItraqEightPlexQuantitationMethod::name_;
 
151
  }
 
152
 
 
153
  const IsobaricQuantitationMethod::IsobaricChannelList& ItraqEightPlexQuantitationMethod::getChannelInformation() const
 
154
  {
 
155
    return channels_;
 
156
  }
 
157
 
 
158
  Size ItraqEightPlexQuantitationMethod::getNumberOfChannels() const
 
159
  {
 
160
    return 8;
 
161
  }
 
162
 
 
163
  Matrix<double> ItraqEightPlexQuantitationMethod::getIsotopeCorrectionMatrix() const
 
164
  {
 
165
    StringList iso_correction = getParameters().getValue("correction_matrix");
 
166
    return stringListToIsotopCorrectionMatrix_(iso_correction);
 
167
  }
 
168
 
 
169
  Size ItraqEightPlexQuantitationMethod::getReferenceChannel() const
 
170
  {
 
171
    return reference_channel_;
 
172
  }
 
173
 
 
174
} // namespace