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

« back to all changes in this revision

Viewing changes to include/OpenMS/ANALYSIS/ID/PILISIdentification.h

  • 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: Andreas Bertsch $
 
25
// $Authors: Andreas Bertsch $
 
26
// --------------------------------------------------------------------------
 
27
 
 
28
 
 
29
#ifndef OPENMS_ANALYSIS_ID_PILISIDENTIFICATION_H
 
30
#define OPENMS_ANALYSIS_ID_PILISIDENTIFICATION_H
 
31
 
 
32
#include <OpenMS/ANALYSIS/ID/PILISModel.h>
 
33
#include <OpenMS/METADATA/PeptideIdentification.h>
 
34
#include <OpenMS/KERNEL/StandardTypes.h>
 
35
 
 
36
#include <vector>
 
37
#include <map>
 
38
 
 
39
namespace OpenMS
 
40
{
 
41
        // forward declarations
 
42
        class PeakSpectrumCompareFunctor;
 
43
        
 
44
        /**
 
45
          @brief This class actually implements a complete ProteinIdentification run with PILIS
 
46
 
 
47
                The PILISIdentification class needs a PILISModel and a PILISSequenceDB to generate
 
48
                identifications. Simply call getIdentifications with a RichPeakMap.
 
49
                 
 
50
                @htmlinclude OpenMS_PILISIdentification.parameters
 
51
                
 
52
                @ingroup Analysis_ID
 
53
        */
 
54
        class OPENMS_DLLAPI PILISIdentification : public DefaultParamHandler
 
55
        {
 
56
 
 
57
                public:
 
58
 
 
59
                        /** @name constructors and destructors
 
60
                         */
 
61
                        //@{
 
62
                        /// default constructor
 
63
                        PILISIdentification();
 
64
                        
 
65
                        /// copy constructor
 
66
                        PILISIdentification(const PILISIdentification& source);
 
67
                        
 
68
                        /// destructor
 
69
                        virtual ~PILISIdentification();
 
70
                        //@}
 
71
                
 
72
                        ///
 
73
                        PILISIdentification& operator = (const PILISIdentification& source);
 
74
 
 
75
                        /** @name Accessors
 
76
                         */
 
77
                        //@{
 
78
                        /// sets the sequence DB to be used for the ProteinIdentification runs
 
79
                        //void setSequenceDB(const SuffixArrayPeptideFinder& sapf);
 
80
 
 
81
                        /// sets the model to be used for the ProteinIdentification run
 
82
                        void setModel(PILISModel* hmm_model);
 
83
 
 
84
                        /// performs an ProteinIdentification run on a RichPeakMap
 
85
                        void getIdentifications(const std::vector<std::map<String, UInt> >& candidates, std::vector<PeptideIdentification>& ids, const RichPeakMap& exp);
 
86
 
 
87
                        /// performs an ProteinIdentification run on a PeakSpectrum
 
88
                        void getIdentification(const std::map<String, UInt>& candidates, PeptideIdentification& id, const RichPeakSpectrum& spectrum);
 
89
                        //@}
 
90
 
 
91
                protected:
 
92
 
 
93
                        /// fast method to create spectra for pre-scoring
 
94
                        void getSpectrum_(RichPeakSpectrum& spec, const String& sequence, int charge);
 
95
                
 
96
                        /// performs a pre-scoring of the given spec with very simple spectra from the candidate peptides
 
97
                        void getPreIdentification_(PeptideIdentification& id, const RichPeakSpectrum& spec, const std::map<String, UInt>& cand_peptides);
 
98
 
 
99
                        /// performs a ProteinIdentification via spectra comparison with the PILISModel spectrum generator
 
100
                        void getFinalIdentification_(PeptideIdentification& id, const RichPeakSpectrum& spec, const PeptideIdentification& pre_id);
 
101
        
 
102
                        /// returns the model pointer
 
103
                        PILISModel* getPILISModel_();
 
104
 
 
105
                        /// returns the sequence database pointer
 
106
                        //PILISSequenceDB* getSequenceDB_();
 
107
                        //SuffixArrayPeptideFinder* getSequenceDB_();
 
108
                        
 
109
                        /// the sequence database for the candidate peptides
 
110
                        //PILISSequenceDB* sequence_db_;
 
111
                        //SuffixArrayPeptideFinder sapf_;
 
112
 
 
113
                        /// the model for spectra simulation
 
114
                        PILISModel* hmm_model_;
 
115
 
 
116
                        /// amino acids weights for the simple spectra generator
 
117
                        Map<char, double> aa_weight_;
 
118
 
 
119
                        /// scorer for pre comparison
 
120
                        PeakSpectrumCompareFunctor* pre_scorer_;
 
121
 
 
122
                        /// scorer for spectra comparison
 
123
                        PeakSpectrumCompareFunctor* scorer_;
 
124
 
 
125
                        /// a peaks, just to not instantiate it over and over again
 
126
                        RichPeak1D p_;
 
127
 
 
128
                        ///
 
129
                        std::vector<RichPeakSpectrum> sim_specs_;
 
130
 
 
131
                        /// flag whether the istance has a internal sequence db
 
132
                        bool own_sequence_db_;
 
133
 
 
134
                        /// flag whether the istance has a internal model
 
135
                        bool own_model_;
 
136
 
 
137
                        /// update members method from DefaultParamHandler to update the members 
 
138
                        void updateMembers_();
 
139
        };
 
140
}
 
141
 
 
142
#endif