Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
PepXMLFile.h
Go to the documentation of this file.
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-2015.
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: Chris Bielow, Hendrik Weisser $
32 // $Authors: Chris Bielow, Hendrik Weisser $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_FORMAT_PEPXMLFILE_H
36 #define OPENMS_FORMAT_PEPXMLFILE_H
37 
41 #include <OpenMS/FORMAT/XMLFile.h>
45 
46 #include <vector>
47 #include <map>
48 #include <set>
49 
50 
51 namespace OpenMS
52 {
60  class OPENMS_DLLAPI PepXMLFile :
61  protected Internal::XMLHandler,
62  public Internal::XMLFile
63  {
64 public:
65 
67  PepXMLFile();
68 
70  virtual ~PepXMLFile();
71 
85  void load(const String& filename, std::vector<ProteinIdentification>& proteins, std::vector<PeptideIdentification>& peptides, const String& experiment_name, const MSExperiment<>& experiment, bool use_precursor_data = false);
86 
93  void load(const String& filename, std::vector<ProteinIdentification>& proteins, std::vector<PeptideIdentification>& peptides, const String& experiment_name = "");
94 
100  void store(const String& filename, std::vector<ProteinIdentification>& protein_ids, std::vector<PeptideIdentification>& peptide_ids, const String& mz_file = "", const String& mz_name = "", bool peptideprophet_analyzed = false);
101 
102 protected:
103 
105  virtual void endElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname);
106 
108  virtual void startElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname, const xercesc::Attributes& attributes);
109 
110 private:
111 
113  void makeScanMap_();
114 
116  void readRTMZCharge_(const xercesc::Attributes& attributes);
117 
130  void matchModification_(const double mass, const String& origin, String& modification_description);
131 
133  {
136  double mass;
137  bool variable;
140 
142  mass(0),
143  variable(false)
144  {
145  }
146 
148  aminoacid(rhs.aminoacid),
149  massdiff(rhs.massdiff),
150  mass(rhs.mass),
151  variable(rhs.variable),
152  description(rhs.description),
153  terminus(rhs.terminus)
154  {
155  }
156 
158  {
159  }
160 
162  {
163  if (this != &rhs)
164  {
165  aminoacid = rhs.aminoacid;
166  massdiff = rhs.massdiff;
167  mass = rhs.mass;
168  variable = rhs.variable;
169  description = rhs.description;
170  terminus = rhs.terminus;
171  }
172  return *this;
173  }
174 
175  };
176 
178  std::vector<ProteinIdentification>* proteins_;
179 
181  std::vector<PeptideIdentification>* peptides_;
182 
185 
188 
191 
194 
196  std::map<Size, Size> scan_map_;
197 
199  double rt_tol_, mz_tol_;
200 
203 
206 
209 
212 
215 
218 
220  std::vector<std::vector<ProteinIdentification>::iterator> current_proteins_;
221 
224 
227 
230 
233 
236 
238  double rt_, mz_;
239 
242 
245 
248 
251 
254 
256  std::vector<std::pair<String, Size> > current_modifications_;
257 
259  std::vector<AminoAcidModification> fixed_modifications_;
260 
262  std::vector<AminoAcidModification> variable_modifications_;
263 
265 
266  };
267 
268 } // namespace OpenMS
269 
270 #endif // OPENMS_FORMAT_PEPXMLFILE_H
AminoAcidModification & operator=(const AminoAcidModification &rhs)
Definition: PepXMLFile.h:161
A more convenient string class.
Definition: String.h:57
std::vector< std::vector< ProteinIdentification >::iterator > current_proteins_
References to currently active ProteinIdentifications.
Definition: PepXMLFile.h:220
double mass
Definition: PepXMLFile.h:136
AminoAcidModification()
Definition: PepXMLFile.h:141
String exp_name_
Name of the associated experiment (filename of the data file, extension will be removed) ...
Definition: PepXMLFile.h:187
std::vector< ProteinIdentification > * proteins_
Pointer to the list of identified proteins.
Definition: PepXMLFile.h:178
Base class for XML handlers.
Definition: XMLHandler.h:99
Element hydrogen_
Hydrogen data (for mass types)
Definition: PepXMLFile.h:202
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
String terminus
Definition: PepXMLFile.h:139
String massdiff
Definition: PepXMLFile.h:135
double rt_
RT and m/z of current PeptideIdentification.
Definition: PepXMLFile.h:238
AminoAcidModification(const AminoAcidModification &rhs)
Definition: PepXMLFile.h:147
std::vector< AminoAcidModification > fixed_modifications_
Fixed aminoacid modifications.
Definition: PepXMLFile.h:259
ProteinIdentification::SearchParameters params_
Search parameters of the current identification run.
Definition: PepXMLFile.h:223
Search parameters of the DB search.
Definition: ProteinIdentification.h:117
Used to load and store PepXML files.
Definition: PepXMLFile.h:60
String current_base_name_
current base name
Definition: PepXMLFile.h:217
String current_sequence_
Sequence of the current peptide hit.
Definition: PepXMLFile.h:235
Definition: PepXMLFile.h:132
String description
Definition: PepXMLFile.h:138
bool seen_experiment_
Have we seen the experiment of interest at all?
Definition: PepXMLFile.h:211
bool use_precursor_data_
Get RT and m/z for peptide ID from precursor scan (should only matter for RT)?
Definition: PepXMLFile.h:193
Representation of an element.
Definition: Element.h:54
DigestionEnzyme
Definition: ProteinIdentification.h:103
double hydrogen_mass_
Mass of a hydrogen atom (monoisotopic/average depending on case)
Definition: PepXMLFile.h:253
UInt search_id_
ID of current search result.
Definition: PepXMLFile.h:244
Representation of a peptide hit.
Definition: PeptideHit.h:55
std::map< Size, Size > scan_map_
Mapping between scan number in the pepXML file and index in the corresponding MSExperiment.
Definition: PepXMLFile.h:196
double rt_tol_
Retention time and mass-to-charge tolerance.
Definition: PepXMLFile.h:199
std::vector< PeptideIdentification > * peptides_
Pointer to the list of identified peptides.
Definition: PepXMLFile.h:181
ProteinIdentification::DigestionEnzyme enzyme_
Enzyme associated with the current identification run.
Definition: PepXMLFile.h:226
bool wrong_experiment_
Do current entries belong to the experiment of interest (for pepXML files that bundle results from di...
Definition: PepXMLFile.h:208
Int charge_
Precursor ion charge.
Definition: PepXMLFile.h:241
DateTime date_
Date the pepXML file was generated.
Definition: PepXMLFile.h:250
std::vector< std::pair< String, Size > > current_modifications_
The modifications of the current peptide hit (position is 1-based)
Definition: PepXMLFile.h:256
DateTime Class.
Definition: DateTime.h:55
String prot_id_
Identifier linking PeptideIdentifications and ProteinIdentifications.
Definition: PepXMLFile.h:247
std::vector< AminoAcidModification > variable_modifications_
Variable aminoacid modifications.
Definition: PepXMLFile.h:262
Base class for loading/storing XML files that have a handler derived from XMLHandler.
Definition: XMLFile.h:53
PeptideHit peptide_hit_
PeptideHit instance currently being processed.
Definition: PepXMLFile.h:232
PeptideIdentification current_peptide_
PeptideIdentification instance currently being processed.
Definition: PepXMLFile.h:229
String aminoacid
Definition: PepXMLFile.h:134
bool checked_base_name_
Have we checked the "base_name" attribute in the "msms_run_summary" element?
Definition: PepXMLFile.h:214
bool analysis_summary_
Are we currently in an "analysis_summary" element (should be skipped)?
Definition: PepXMLFile.h:205
String search_engine_
Set name of search engine.
Definition: PepXMLFile.h:190
virtual ~AminoAcidModification()
Definition: PepXMLFile.h:157
int Int
Signed integer type.
Definition: Types.h:96
const MSExperiment * experiment_
Pointer to the experiment from which the pepXML file was generated.
Definition: PepXMLFile.h:184
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:63
bool variable
Definition: PepXMLFile.h:137

OpenMS / TOPP release 2.0.0 Documentation generated on Wed Mar 30 2016 12:49:25 using doxygen 1.8.11