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: Andreas Bertsch $
26
// --------------------------------------------------------------------------
29
#ifndef OPENMS_ANALYSIS_ID_PILISNEUTRALLOSSMODEL_H
30
#define OPENMS_ANALYSIS_ID_PILISNEUTRALLOSSMODEL_H
33
#include <OpenMS/KERNEL/StandardTypes.h>
34
#include <OpenMS/DATASTRUCTURES/Map.h>
35
#include <OpenMS/DATASTRUCTURES/String.h>
36
#include <OpenMS/CONCEPT/Types.h>
37
#include <OpenMS/ANALYSIS/ID/HiddenMarkovModel.h>
38
#include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
45
@brief This class implements the simulation of the spectra from PILIS
47
PILIS uses a HMM based structure to model the population of fragment ions
48
from a peptide. The spectrum generator can be accessed via the getSpectrum
51
@htmlinclude OpenMS_PILISNeutralLossModel.parameters
55
class OPENMS_DLLAPI PILISNeutralLossModel : public DefaultParamHandler
57
friend class PILISNeutralLossModelGenerator;
61
/** @name Constructors and destructors
64
/// default constructor
65
PILISNeutralLossModel();
68
PILISNeutralLossModel(const PILISNeutralLossModel& model);
71
virtual ~PILISNeutralLossModel();
74
/// assignment operator
75
PILISNeutralLossModel& operator = (const PILISNeutralLossModel& mode);
80
/// performs a training step; needs as parameters a spectrum with annotated sequence and charge; returns the intensity sum of the matched peaks
81
DoubleReal train(const RichPeakSpectrum& spec, const AASequence& peptide, DoubleReal ion_weight, UInt charge, DoubleReal peptide_weight);
83
/// given a peptide (a ion) the model returns the peaks with intensities relative to initial_prob
84
void getIons(std::vector<RichPeak1D>& peaks, const AASequence& peptide, DoubleReal initial_prob);
86
/// sets the hidden markov model
87
void setHMM(const HiddenMarkovModel& model);
89
/// writes the HMM to the given file in the GraphML format. A detailed description of the GraphML format can be found under http://graphml.graphdrawing.org/
90
const HiddenMarkovModel& getHMM() const;
92
/// generates the models
95
/// this method evaluates the model after training; it should be called after all training steps with train
101
/// extracts the precursor and related intensities of a training spectrum
102
DoubleReal getIntensitiesFromSpectrum_(const RichPeakSpectrum& train_spec, Map<String, DoubleReal>& pre_ints, DoubleReal ion_weight, const AASequence& peptide, UInt charge);
104
/// trains precursor and related peaks
105
void trainIons_(DoubleReal initial_probability, const Map<String, DoubleReal>& intensities, const AASequence& peptide);
107
/// estimates the precursor intensities
108
void getIons_(Map<String, DoubleReal>& intensities, DoubleReal initial_probability, const AASequence& precursor);
110
/// enables the states needed for precursor training/simulation
111
void enableIonStates_(const AASequence& peptide);
113
/// precursor model used
114
HiddenMarkovModel hmm_precursor_;
119
void updateMembers_();