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

« back to all changes in this revision

Viewing changes to source/CHEMISTRY/ResidueModification.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
 
// -*- 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
 
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.
22
29
//
23
30
// --------------------------------------------------------------------------
24
31
// $Maintainer: Andreas Bertsch $
33
40
namespace OpenMS
34
41
{
35
42
 
36
 
        ResidueModification::ResidueModification()
37
 
                : term_spec_(ResidueModification::ANYWHERE),
38
 
                        classification_(ResidueModification::ARTIFACT),
39
 
                        average_mass_(0.0),
40
 
                        mono_mass_(0.0),
41
 
                        diff_average_mass_(0.0),
42
 
                        diff_mono_mass_(0.0),
43
 
                        neutral_loss_mono_mass_(0.0),
44
 
                        neutral_loss_average_mass_(0.0)
45
 
        {
46
 
        }
47
 
 
48
 
        ResidueModification::ResidueModification(const ResidueModification& rhs)
49
 
                : id_(rhs.id_),
50
 
                        full_id_(rhs.full_id_),
51
 
                        psi_mod_accession_(rhs.psi_mod_accession_),
52
 
                        unimod_accession_(rhs.unimod_accession_),
53
 
                        full_name_(rhs.full_name_),
54
 
                        name_(rhs.name_),
55
 
                        term_spec_(rhs.term_spec_),
56
 
                        origin_(rhs.origin_),
57
 
                        classification_(rhs.classification_),
58
 
                        average_mass_(rhs.average_mass_),
59
 
                        mono_mass_(rhs.mono_mass_),
60
 
                        diff_average_mass_(rhs.diff_average_mass_),
61
 
                        diff_mono_mass_(rhs.diff_mono_mass_),
62
 
                        formula_(rhs.formula_),
63
 
                        diff_formula_(rhs.diff_formula_),
64
 
                        synonyms_(rhs.synonyms_),
65
 
                        neutral_loss_diff_formula_(rhs.neutral_loss_diff_formula_),
66
 
                        neutral_loss_mono_mass_(rhs.neutral_loss_mono_mass_),
67
 
                        neutral_loss_average_mass_(rhs.neutral_loss_average_mass_)
68
 
        {
69
 
        }
70
 
        
71
 
        ResidueModification& ResidueModification::operator = (const ResidueModification& rhs)
72
 
  {
73
 
                if (this != &rhs)
74
 
                {
75
 
        id_ = rhs.id_;
76
 
                        full_id_ = rhs.full_id_;
77
 
                        psi_mod_accession_ = rhs.psi_mod_accession_;
78
 
                        unimod_accession_ = rhs.unimod_accession_;
79
 
                        full_name_ = rhs.full_name_;
80
 
                        name_ = rhs.name_;
81
 
                        term_spec_ = rhs.term_spec_;
82
 
                        origin_ = rhs.origin_;
83
 
                        classification_ = rhs.classification_;
84
 
                        average_mass_ = rhs.average_mass_;
85
 
                        mono_mass_ = rhs.mono_mass_;
86
 
                        diff_average_mass_ = rhs.diff_average_mass_;
87
 
                        diff_mono_mass_ = rhs.diff_mono_mass_;
88
 
                        formula_ = rhs.formula_;
89
 
                        diff_formula_ = rhs.diff_formula_;
90
 
                        synonyms_ = rhs.synonyms_;
91
 
                        neutral_loss_diff_formula_ = rhs.neutral_loss_diff_formula_;
92
 
                        neutral_loss_mono_mass_ = rhs.neutral_loss_mono_mass_;
93
 
                        neutral_loss_average_mass_ = rhs.neutral_loss_average_mass_;
94
 
                }
95
 
                
96
 
                return *this;
97
 
  }
98
 
        
99
 
        bool ResidueModification::operator == (const ResidueModification& rhs) const
100
 
        {
101
 
                return  id_ == rhs.id_ &&
102
 
                                                full_id_ == rhs.full_id_ && 
103
 
                                                psi_mod_accession_ == rhs.psi_mod_accession_ && 
104
 
                                                unimod_accession_ == rhs.unimod_accession_ &&
105
 
                                                full_name_ == rhs.full_name_ &&
106
 
                                                name_ == rhs.name_ &&
107
 
                                                term_spec_ == rhs.term_spec_ &&
108
 
                                                origin_ == rhs.origin_ &&
109
 
                                                classification_ == rhs.classification_ &&
110
 
                                                average_mass_ == rhs.average_mass_ &&
111
 
                                                mono_mass_ == rhs.mono_mass_ && 
112
 
                                                diff_average_mass_ == rhs.diff_average_mass_ &&
113
 
                                                diff_mono_mass_ == rhs.diff_mono_mass_ &&
114
 
                                                formula_ == rhs.formula_ &&
115
 
                                                diff_formula_ == rhs.diff_formula_ &&
116
 
                                                synonyms_ == rhs.synonyms_ &&
117
 
                                                neutral_loss_diff_formula_ == rhs.neutral_loss_diff_formula_ &&
118
 
                                                neutral_loss_mono_mass_ == rhs.neutral_loss_mono_mass_ &&
119
 
                                                neutral_loss_average_mass_ == rhs.neutral_loss_average_mass_;
120
 
        }
121
 
        
122
 
        bool ResidueModification::operator != (const ResidueModification& rhs) const
123
 
        {
124
 
                return !(*this == rhs);
125
 
        }
126
 
        
127
 
        ResidueModification::~ResidueModification()
128
 
        {
129
 
 
130
 
        }
131
 
 
132
 
        void ResidueModification::setId(const String& id)
133
 
        {
134
 
                id_ = id;
135
 
        }
136
 
 
137
 
        const String& ResidueModification::getId() const
138
 
        {
139
 
                return id_;
140
 
        }
141
 
        
142
 
        void ResidueModification::setFullId(const String& full_id)
143
 
        {
144
 
                full_id_ = full_id;
145
 
        }
146
 
 
147
 
        const String& ResidueModification::getFullId() const
148
 
        {
149
 
                return full_id_;
150
 
        }
151
 
 
152
 
        void ResidueModification::setPSIMODAccession(const String& id)
153
 
        {
154
 
                psi_mod_accession_ = id;
155
 
        }
156
 
 
157
 
        const String& ResidueModification::getPSIMODAccession() const
158
 
        {
159
 
                return psi_mod_accession_;
160
 
        }
161
 
 
162
 
        void ResidueModification::setUniModAccession(const String& id)
163
 
        {
164
 
                unimod_accession_ = id;
165
 
        }
166
 
 
167
 
        const String& ResidueModification::getUniModAccession() const
168
 
        {
169
 
                return unimod_accession_;
170
 
        }
171
 
 
172
 
        void ResidueModification::setFullName(const String& full_name)
173
 
        {
174
 
                full_name_ = full_name;
175
 
        }
176
 
 
177
 
        const String& ResidueModification::getFullName() const
178
 
        {
179
 
                return full_name_;
180
 
        }
181
 
 
182
 
        void ResidueModification::setName(const String& name)
183
 
        {
184
 
                name_ = name;
185
 
        }
186
 
 
187
 
        const String& ResidueModification::getName() const
188
 
        {
189
 
                return name_;
190
 
        }
191
 
        
192
 
        void ResidueModification::setTermSpecificity(Term_Specificity term_spec)
193
 
        {
194
 
                term_spec_ = term_spec;
195
 
        }
196
 
 
197
 
        void ResidueModification::setTermSpecificity(const String& term_spec)
198
 
        {
199
 
                if (term_spec == "C-term")
200
 
                {
201
 
                        term_spec_ = C_TERM;
202
 
                        return;
203
 
                }
204
 
                if (term_spec == "N-term")
205
 
                {
206
 
                        term_spec_ = N_TERM;
207
 
                        return;
208
 
                }
209
 
                if (term_spec == "none")
210
 
                {
211
 
                        term_spec_ = ANYWHERE;
212
 
                        return;
213
 
                }
214
 
                cerr << "ResidueModification: cannot convert '" << term_spec << "' into term specificity!" << endl;
215
 
                return;
216
 
        }
217
 
        
218
 
        ResidueModification::Term_Specificity ResidueModification::getTermSpecificity() const
219
 
        {
220
 
                return term_spec_;
221
 
        }
222
 
 
223
 
        String ResidueModification::getTermSpecificityName(Term_Specificity term_spec) const
224
 
        {
225
 
                if (term_spec == NUMBER_OF_TERM_SPECIFICITY)
226
 
                {
227
 
                        term_spec = term_spec_; 
228
 
                }
229
 
                switch(term_spec)
230
 
                {
231
 
                        case C_TERM: return "C-term";
232
 
                        case N_TERM: return "N-term";
233
 
                        default: // ANYWHERE
234
 
                                if (term_spec != ANYWHERE)
235
 
                                {
236
 
                                        cerr << "ResidueModification: cannot convert '" << term_spec << "' into term specificity name!" << endl;
237
 
                                }
238
 
                                return "none";
239
 
                }
240
 
        }
241
 
        
242
 
        void ResidueModification::setOrigin(const String& origin)
243
 
        {
244
 
                origin_ = origin;
245
 
        }
246
 
 
247
 
        const String& ResidueModification::getOrigin() const
248
 
        {
249
 
                return origin_;
250
 
        }
251
 
 
252
 
        void ResidueModification::setSourceClassification(Source_Classification classification)
253
 
        {
254
 
                classification_ = classification;
255
 
        }
256
 
 
257
 
        void ResidueModification::setSourceClassification(const String& classification)
258
 
        {   
259
 
                String c = classification;
260
 
                c.toLower();
 
43
  ResidueModification::ResidueModification() :
 
44
    term_spec_(ResidueModification::ANYWHERE),
 
45
    classification_(ResidueModification::ARTIFACT),
 
46
    average_mass_(0.0),
 
47
    mono_mass_(0.0),
 
48
    diff_average_mass_(0.0),
 
49
    diff_mono_mass_(0.0),
 
50
    neutral_loss_mono_mass_(0.0),
 
51
    neutral_loss_average_mass_(0.0)
 
52
  {
 
53
  }
 
54
 
 
55
  ResidueModification::ResidueModification(const ResidueModification & rhs) :
 
56
    id_(rhs.id_),
 
57
    full_id_(rhs.full_id_),
 
58
    psi_mod_accession_(rhs.psi_mod_accession_),
 
59
    unimod_accession_(rhs.unimod_accession_),
 
60
    full_name_(rhs.full_name_),
 
61
    name_(rhs.name_),
 
62
    term_spec_(rhs.term_spec_),
 
63
    origin_(rhs.origin_),
 
64
    classification_(rhs.classification_),
 
65
    average_mass_(rhs.average_mass_),
 
66
    mono_mass_(rhs.mono_mass_),
 
67
    diff_average_mass_(rhs.diff_average_mass_),
 
68
    diff_mono_mass_(rhs.diff_mono_mass_),
 
69
    formula_(rhs.formula_),
 
70
    diff_formula_(rhs.diff_formula_),
 
71
    synonyms_(rhs.synonyms_),
 
72
    neutral_loss_diff_formula_(rhs.neutral_loss_diff_formula_),
 
73
    neutral_loss_mono_mass_(rhs.neutral_loss_mono_mass_),
 
74
    neutral_loss_average_mass_(rhs.neutral_loss_average_mass_)
 
75
  {
 
76
  }
 
77
 
 
78
  ResidueModification & ResidueModification::operator=(const ResidueModification & rhs)
 
79
  {
 
80
    if (this != &rhs)
 
81
    {
 
82
      id_ = rhs.id_;
 
83
      full_id_ = rhs.full_id_;
 
84
      psi_mod_accession_ = rhs.psi_mod_accession_;
 
85
      unimod_accession_ = rhs.unimod_accession_;
 
86
      full_name_ = rhs.full_name_;
 
87
      name_ = rhs.name_;
 
88
      term_spec_ = rhs.term_spec_;
 
89
      origin_ = rhs.origin_;
 
90
      classification_ = rhs.classification_;
 
91
      average_mass_ = rhs.average_mass_;
 
92
      mono_mass_ = rhs.mono_mass_;
 
93
      diff_average_mass_ = rhs.diff_average_mass_;
 
94
      diff_mono_mass_ = rhs.diff_mono_mass_;
 
95
      formula_ = rhs.formula_;
 
96
      diff_formula_ = rhs.diff_formula_;
 
97
      synonyms_ = rhs.synonyms_;
 
98
      neutral_loss_diff_formula_ = rhs.neutral_loss_diff_formula_;
 
99
      neutral_loss_mono_mass_ = rhs.neutral_loss_mono_mass_;
 
100
      neutral_loss_average_mass_ = rhs.neutral_loss_average_mass_;
 
101
    }
 
102
 
 
103
    return *this;
 
104
  }
 
105
 
 
106
  bool ResidueModification::operator==(const ResidueModification & rhs) const
 
107
  {
 
108
    return id_ == rhs.id_ &&
 
109
           full_id_ == rhs.full_id_ &&
 
110
           psi_mod_accession_ == rhs.psi_mod_accession_ &&
 
111
           unimod_accession_ == rhs.unimod_accession_ &&
 
112
           full_name_ == rhs.full_name_ &&
 
113
           name_ == rhs.name_ &&
 
114
           term_spec_ == rhs.term_spec_ &&
 
115
           origin_ == rhs.origin_ &&
 
116
           classification_ == rhs.classification_ &&
 
117
           average_mass_ == rhs.average_mass_ &&
 
118
           mono_mass_ == rhs.mono_mass_ &&
 
119
           diff_average_mass_ == rhs.diff_average_mass_ &&
 
120
           diff_mono_mass_ == rhs.diff_mono_mass_ &&
 
121
           formula_ == rhs.formula_ &&
 
122
           diff_formula_ == rhs.diff_formula_ &&
 
123
           synonyms_ == rhs.synonyms_ &&
 
124
           neutral_loss_diff_formula_ == rhs.neutral_loss_diff_formula_ &&
 
125
           neutral_loss_mono_mass_ == rhs.neutral_loss_mono_mass_ &&
 
126
           neutral_loss_average_mass_ == rhs.neutral_loss_average_mass_;
 
127
  }
 
128
 
 
129
  bool ResidueModification::operator!=(const ResidueModification & rhs) const
 
130
  {
 
131
    return !(*this == rhs);
 
132
  }
 
133
 
 
134
  ResidueModification::~ResidueModification()
 
135
  {
 
136
 
 
137
  }
 
138
 
 
139
  void ResidueModification::setId(const String & id)
 
140
  {
 
141
    id_ = id;
 
142
  }
 
143
 
 
144
  const String & ResidueModification::getId() const
 
145
  {
 
146
    return id_;
 
147
  }
 
148
 
 
149
  void ResidueModification::setFullId(const String & full_id)
 
150
  {
 
151
    full_id_ = full_id;
 
152
  }
 
153
 
 
154
  const String & ResidueModification::getFullId() const
 
155
  {
 
156
    return full_id_;
 
157
  }
 
158
 
 
159
  void ResidueModification::setPSIMODAccession(const String & id)
 
160
  {
 
161
    psi_mod_accession_ = id;
 
162
  }
 
163
 
 
164
  const String & ResidueModification::getPSIMODAccession() const
 
165
  {
 
166
    return psi_mod_accession_;
 
167
  }
 
168
 
 
169
  void ResidueModification::setUniModAccession(const String & id)
 
170
  {
 
171
    unimod_accession_ = id;
 
172
  }
 
173
 
 
174
  const String & ResidueModification::getUniModAccession() const
 
175
  {
 
176
    return unimod_accession_;
 
177
  }
 
178
 
 
179
  void ResidueModification::setFullName(const String & full_name)
 
180
  {
 
181
    full_name_ = full_name;
 
182
  }
 
183
 
 
184
  const String & ResidueModification::getFullName() const
 
185
  {
 
186
    return full_name_;
 
187
  }
 
188
 
 
189
  void ResidueModification::setName(const String & name)
 
190
  {
 
191
    name_ = name;
 
192
  }
 
193
 
 
194
  const String & ResidueModification::getName() const
 
195
  {
 
196
    return name_;
 
197
  }
 
198
 
 
199
  void ResidueModification::setTermSpecificity(Term_Specificity term_spec)
 
200
  {
 
201
    term_spec_ = term_spec;
 
202
  }
 
203
 
 
204
  void ResidueModification::setTermSpecificity(const String & term_spec)
 
205
  {
 
206
    if (term_spec == "C-term")
 
207
    {
 
208
      term_spec_ = C_TERM;
 
209
      return;
 
210
    }
 
211
    if (term_spec == "N-term")
 
212
    {
 
213
      term_spec_ = N_TERM;
 
214
      return;
 
215
    }
 
216
    if (term_spec == "none")
 
217
    {
 
218
      term_spec_ = ANYWHERE;
 
219
      return;
 
220
    }
 
221
    cerr << "ResidueModification: cannot convert '" << term_spec << "' into term specificity!" << endl;
 
222
    return;
 
223
  }
 
224
 
 
225
  ResidueModification::Term_Specificity ResidueModification::getTermSpecificity() const
 
226
  {
 
227
    return term_spec_;
 
228
  }
 
229
 
 
230
  String ResidueModification::getTermSpecificityName(Term_Specificity term_spec) const
 
231
  {
 
232
    if (term_spec == NUMBER_OF_TERM_SPECIFICITY)
 
233
    {
 
234
      term_spec = term_spec_;
 
235
    }
 
236
    switch (term_spec)
 
237
    {
 
238
    case C_TERM: return "C-term";
 
239
 
 
240
    case N_TERM: return "N-term";
 
241
 
 
242
    default:         // ANYWHERE
 
243
      if (term_spec != ANYWHERE)
 
244
      {
 
245
        cerr << "ResidueModification: cannot convert '" << term_spec << "' into term specificity name!" << endl;
 
246
      }
 
247
      return "none";
 
248
    }
 
249
  }
 
250
 
 
251
  void ResidueModification::setOrigin(const String & origin)
 
252
  {
 
253
    origin_ = origin;
 
254
  }
 
255
 
 
256
  const String & ResidueModification::getOrigin() const
 
257
  {
 
258
    return origin_;
 
259
  }
 
260
 
 
261
  void ResidueModification::setSourceClassification(Source_Classification classification)
 
262
  {
 
263
    classification_ = classification;
 
264
  }
 
265
 
 
266
  void ResidueModification::setSourceClassification(const String & classification)
 
267
  {
 
268
    String c = classification;
 
269
    c.toLower();
261
270
    if (c == "artifact" || c == "artefact") // unimod uses Artefact (BE) not Artifcat (AE)
262
 
                {
263
 
                        classification_ = ARTIFACT;
264
 
                        return;
265
 
                }
266
 
                if (c == "natural")
267
 
                {
268
 
                        classification_ = NATURAL;
269
 
                        return;
270
 
                }
271
 
                if (c == "hypothetical")
272
 
                {
273
 
                        classification_ = HYPOTHETICAL;
274
 
                        return;
275
 
                }  
 
271
    {
 
272
      classification_ = ARTIFACT;
 
273
      return;
 
274
    }
 
275
    if (c == "natural")
 
276
    {
 
277
      classification_ = NATURAL;
 
278
      return;
 
279
    }
 
280
    if (c == "hypothetical")
 
281
    {
 
282
      classification_ = HYPOTHETICAL;
 
283
      return;
 
284
    }
276
285
    if (c == "post-translational")
277
286
    {
278
287
      classification_ = POSTTRANSLATIONAL;
336
345
 
337
346
    classification_ = UNKNOWN;
338
347
 
339
 
                //cerr << "ResidueModification: Unknown source classification '" << classification << "'" << endl;
340
 
                return;
341
 
        }
342
 
        
343
 
        ResidueModification::Source_Classification ResidueModification::getSourceClassification() const
344
 
        {
345
 
                return classification_;
346
 
        }
347
 
 
348
 
        String ResidueModification::getSourceClassificationName(Source_Classification classification) const
349
 
        {
350
 
                if (classification == NUMBER_OF_SOURCE_CLASSIFICATIONS)
351
 
                {
352
 
                        classification = classification_;
353
 
                }
354
 
                switch (classification)
355
 
                {
 
348
    //cerr << "ResidueModification: Unknown source classification '" << classification << "'" << endl;
 
349
    return;
 
350
  }
 
351
 
 
352
  ResidueModification::Source_Classification ResidueModification::getSourceClassification() const
 
353
  {
 
354
    return classification_;
 
355
  }
 
356
 
 
357
  String ResidueModification::getSourceClassificationName(Source_Classification classification) const
 
358
  {
 
359
    if (classification == NUMBER_OF_SOURCE_CLASSIFICATIONS)
 
360
    {
 
361
      classification = classification_;
 
362
    }
 
363
    switch (classification)
 
364
    {
356
365
    case ARTIFACT: return "Artefact"; // return Artefact (BE) not Artifcat (AE)
 
366
 
357
367
    case NATURAL:  return "Natural";
 
368
 
358
369
    case HYPOTHETICAL: return "Hypothetical";
 
370
 
359
371
    case POSTTRANSLATIONAL: return "Post-translational";
 
372
 
360
373
    case MULTIPLE:  return "Multiple";
 
374
 
361
375
    case CHEMICAL_DERIVATIVE: return "Chemical derivative";
 
376
 
362
377
    case ISOTOPIC_LABEL: return "Isotopic label";
 
378
 
363
379
    case PRETRANSLATIONAL:  return "Pre-translational";
 
380
 
364
381
    case OTHER_GLYCOSYLATION: return "Other glycosylation";
 
382
 
365
383
    case NLINKED_GLYCOSYLATION: return "N-linked glycosylation";
 
384
 
366
385
    case AA_SUBSTITUTION:  return "AA substitution";
 
386
 
367
387
    case OTHER: return "Other";
 
388
 
368
389
    case NONSTANDARD_RESIDUE: return "Non-standard residue";
 
390
 
369
391
    case COTRANSLATIONAL: return "Co-translational";
370
 
    case OLINKED_GLYCOSYLATION:  return "O-linked glycosylation";      
 
392
 
 
393
    case OLINKED_GLYCOSYLATION:  return "O-linked glycosylation";
 
394
 
371
395
    case UNKNOWN:  return "";
372
396
 
373
397
    default: return "Unknown";
374
 
                }
375
 
                return "Unknown";
376
 
        }
377
 
        
378
 
        void ResidueModification::setAverageMass(DoubleReal mass)
379
 
        {
380
 
                average_mass_ = mass;
381
 
        }
382
 
 
383
 
        DoubleReal ResidueModification::getAverageMass() const
384
 
        {
385
 
                return average_mass_;
386
 
        }
387
 
 
388
 
        void ResidueModification::setMonoMass(DoubleReal mass)
389
 
        {
390
 
                mono_mass_ = mass;
391
 
        }
392
 
 
393
 
        DoubleReal ResidueModification::getMonoMass() const
394
 
        {
395
 
                return mono_mass_;
396
 
        }
397
 
 
398
 
 
399
 
        void ResidueModification::setDiffAverageMass(DoubleReal mass)
400
 
        {
401
 
                diff_average_mass_ = mass;
402
 
        }
403
 
 
404
 
        DoubleReal ResidueModification::getDiffAverageMass() const
405
 
        {
406
 
                return diff_average_mass_;
407
 
        }
408
 
        
409
 
        void ResidueModification::setDiffMonoMass(DoubleReal mass)
410
 
        {
411
 
                diff_mono_mass_ = mass;
412
 
        }
413
 
 
414
 
        DoubleReal ResidueModification::getDiffMonoMass() const
415
 
        {
416
 
                return diff_mono_mass_;
417
 
        }
418
 
        
419
 
        void ResidueModification::setFormula(const String& formula)
420
 
        {
421
 
                formula_ = formula;
422
 
        }
423
 
 
424
 
        const String& ResidueModification::getFormula() const
425
 
        {
426
 
                return formula_;
427
 
        }
428
 
 
429
 
        void ResidueModification::setDiffFormula(const EmpiricalFormula& diff_formula)
430
 
        {
431
 
                diff_formula_ = diff_formula;
432
 
        }
433
 
 
434
 
        const EmpiricalFormula& ResidueModification::getDiffFormula() const
435
 
        {
436
 
                return diff_formula_;
437
 
        }
438
 
        
439
 
        void ResidueModification::addSynonym(const String& synonym)
440
 
        {
441
 
                synonyms_.insert(synonym);
442
 
        }
443
 
 
444
 
        void ResidueModification::setSynonyms(const set<String>& synonyms)
445
 
        {
446
 
                synonyms_ = synonyms;
447
 
        }
448
 
 
449
 
        const set<String>& ResidueModification::getSynonyms() const
450
 
        {
451
 
                return synonyms_;
452
 
        }
453
 
 
454
 
        void ResidueModification::setNeutralLossDiffFormula(const EmpiricalFormula& diff_formula)
455
 
        {
456
 
                neutral_loss_diff_formula_ = diff_formula;
457
 
        }
458
 
 
459
 
        const EmpiricalFormula& ResidueModification::getNeutralLossDiffFormula() const
460
 
        {
461
 
                return neutral_loss_diff_formula_;
462
 
        }
463
 
 
464
 
        void ResidueModification::setNeutralLossMonoMass(DoubleReal mono_mass)
465
 
        {
466
 
                neutral_loss_mono_mass_ = mono_mass;
467
 
        }
468
 
 
469
 
        DoubleReal ResidueModification::getNeutralLossMonoMass() const
470
 
        {
471
 
                return neutral_loss_mono_mass_;
472
 
        }
473
 
 
474
 
        void ResidueModification::setNeutralLossAverageMass(DoubleReal average_mass)
475
 
        {
476
 
                neutral_loss_average_mass_ = average_mass;
477
 
        }
478
 
 
479
 
        DoubleReal ResidueModification::getNeutralLossAverageMass() const
480
 
        {
481
 
                return neutral_loss_average_mass_;
482
 
        }
483
 
 
484
 
        bool ResidueModification::hasNeutralLoss() const
485
 
        {
486
 
                return neutral_loss_diff_formula_ != "";
487
 
        }
 
398
    }
 
399
    return "Unknown";
 
400
  }
 
401
 
 
402
  void ResidueModification::setAverageMass(DoubleReal mass)
 
403
  {
 
404
    average_mass_ = mass;
 
405
  }
 
406
 
 
407
  DoubleReal ResidueModification::getAverageMass() const
 
408
  {
 
409
    return average_mass_;
 
410
  }
 
411
 
 
412
  void ResidueModification::setMonoMass(DoubleReal mass)
 
413
  {
 
414
    mono_mass_ = mass;
 
415
  }
 
416
 
 
417
  DoubleReal ResidueModification::getMonoMass() const
 
418
  {
 
419
    return mono_mass_;
 
420
  }
 
421
 
 
422
  void ResidueModification::setDiffAverageMass(DoubleReal mass)
 
423
  {
 
424
    diff_average_mass_ = mass;
 
425
  }
 
426
 
 
427
  DoubleReal ResidueModification::getDiffAverageMass() const
 
428
  {
 
429
    return diff_average_mass_;
 
430
  }
 
431
 
 
432
  void ResidueModification::setDiffMonoMass(DoubleReal mass)
 
433
  {
 
434
    diff_mono_mass_ = mass;
 
435
  }
 
436
 
 
437
  DoubleReal ResidueModification::getDiffMonoMass() const
 
438
  {
 
439
    return diff_mono_mass_;
 
440
  }
 
441
 
 
442
  void ResidueModification::setFormula(const String & formula)
 
443
  {
 
444
    formula_ = formula;
 
445
  }
 
446
 
 
447
  const String & ResidueModification::getFormula() const
 
448
  {
 
449
    return formula_;
 
450
  }
 
451
 
 
452
  void ResidueModification::setDiffFormula(const EmpiricalFormula & diff_formula)
 
453
  {
 
454
    diff_formula_ = diff_formula;
 
455
  }
 
456
 
 
457
  const EmpiricalFormula & ResidueModification::getDiffFormula() const
 
458
  {
 
459
    return diff_formula_;
 
460
  }
 
461
 
 
462
  void ResidueModification::addSynonym(const String & synonym)
 
463
  {
 
464
    synonyms_.insert(synonym);
 
465
  }
 
466
 
 
467
  void ResidueModification::setSynonyms(const set<String> & synonyms)
 
468
  {
 
469
    synonyms_ = synonyms;
 
470
  }
 
471
 
 
472
  const set<String> & ResidueModification::getSynonyms() const
 
473
  {
 
474
    return synonyms_;
 
475
  }
 
476
 
 
477
  void ResidueModification::setNeutralLossDiffFormula(const EmpiricalFormula & diff_formula)
 
478
  {
 
479
    neutral_loss_diff_formula_ = diff_formula;
 
480
  }
 
481
 
 
482
  const EmpiricalFormula & ResidueModification::getNeutralLossDiffFormula() const
 
483
  {
 
484
    return neutral_loss_diff_formula_;
 
485
  }
 
486
 
 
487
  void ResidueModification::setNeutralLossMonoMass(DoubleReal mono_mass)
 
488
  {
 
489
    neutral_loss_mono_mass_ = mono_mass;
 
490
  }
 
491
 
 
492
  DoubleReal ResidueModification::getNeutralLossMonoMass() const
 
493
  {
 
494
    return neutral_loss_mono_mass_;
 
495
  }
 
496
 
 
497
  void ResidueModification::setNeutralLossAverageMass(DoubleReal average_mass)
 
498
  {
 
499
    neutral_loss_average_mass_ = average_mass;
 
500
  }
 
501
 
 
502
  DoubleReal ResidueModification::getNeutralLossAverageMass() const
 
503
  {
 
504
    return neutral_loss_average_mass_;
 
505
  }
 
506
 
 
507
  bool ResidueModification::hasNeutralLoss() const
 
508
  {
 
509
    return neutral_loss_diff_formula_ != "";
 
510
  }
 
511
 
488
512
}
489