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: Andreas Bertsch $
25
// $Authors: Marc Sturm $
26
// --------------------------------------------------------------------------
28
#include <OpenMS/METADATA/Modification.h>
35
const std::string Modification::NamesOfSpecificityType[] = {"AA","AA_AT_CTERM","AA_AT_NTERM","CTERM","NTERM"};
37
Modification::Modification() :
38
SampleTreatment("Modification"),
41
specificity_type_(AA),
42
affected_amino_acids_("")
47
Modification::Modification(const Modification& source):
48
SampleTreatment(source),
49
reagent_name_(source.reagent_name_),
51
specificity_type_(source.specificity_type_),
52
affected_amino_acids_(source.affected_amino_acids_)
57
Modification::~Modification()
62
Modification& Modification::operator = (const Modification& source)
64
if (&source == this) return *this;
66
SampleTreatment::operator=(source);
67
reagent_name_ = source.reagent_name_;
69
specificity_type_ = source.specificity_type_;
70
affected_amino_acids_ = source.affected_amino_acids_;
75
bool Modification::operator== (const SampleTreatment& rhs) const
77
if (type_!=rhs.getType()) return false;
79
const Modification* tmp = dynamic_cast<const Modification*>(&rhs);
81
SampleTreatment::operator==(*tmp) &&
82
reagent_name_ == tmp->reagent_name_ &&
83
mass_ == tmp->mass_ &&
84
specificity_type_ == tmp->specificity_type_ &&
85
affected_amino_acids_ == tmp->affected_amino_acids_
89
SampleTreatment* Modification::clone() const
91
SampleTreatment* tmp = new Modification(*this);
95
const String& Modification::getReagentName() const
100
void Modification::setReagentName(const String& reagent_name)
102
reagent_name_ = reagent_name;
106
DoubleReal Modification::getMass() const
111
void Modification::setMass(DoubleReal mass)
117
const Modification::SpecificityType& Modification::getSpecificityType() const
119
return specificity_type_;
122
void Modification::setSpecificityType(const Modification::SpecificityType& specificity_type)
124
specificity_type_ = specificity_type;
128
const String& Modification::getAffectedAminoAcids() const
130
return affected_amino_acids_;
133
void Modification::setAffectedAminoAcids(const String& affected_amino_acids)
135
affected_amino_acids_ = affected_amino_acids;