ProteoWizard
LegacyAdapter.hpp
Go to the documentation of this file.
1 //
2 // $Id: LegacyAdapter.hpp 1656 2009-12-30 20:54:17Z chambm $
3 //
4 //
5 // Original author: Darren Kessner <darren@proteowizard.org>
6 //
7 // Copyright 2008 Spielberg Family Center for Applied Proteomics
8 // Cedars-Sinai Medical Center, Los Angeles, California 90048
9 //
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
13 //
14 // http://www.apache.org/licenses/LICENSE-2.0
15 //
16 // Unless required by applicable law or agreed to in writing, software
17 // distributed under the License is distributed on an "AS IS" BASIS,
18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 // See the License for the specific language governing permissions and
20 // limitations under the License.
21 //
22 //
23 
24 
25 #ifndef _LEGACYADAPTER_HPP_
26 #define _LEGACYADAPTER_HPP_
27 
28 
30 #include "MSData.hpp"
31 #include "boost/shared_ptr.hpp"
32 
33 
34 namespace pwiz { namespace data { class CVTranslator; } }
35 
36 
37 namespace pwiz {
38 namespace msdata {
39 
40 
42 
43 
44 ///
45 /// interface for legacy access to Instrument
46 ///
47 /// mzXML/RAMP encode instrument information as 5 strings:
48 /// manufacturer, model, ionisation, analyzer, detector
49 ///
50 /// In mzML, the equivalent information is encoded as cvParams in
51 /// various locations in the <instrument> element. One important
52 /// difference is that the manufacturer information is implicit in
53 /// the CV term used to encode the model.
54 ///
55 /// The "set" methods use CVTranslator to translate the string(s) to an
56 /// appropriate cvParam. If no CV term can be found, the information is
57 /// encoded as a userParam.
58 ///
59 /// The "get" methods look for the cvParam first, then the userParam.
60 ///
62 {
63  public:
64 
65  LegacyAdapter_Instrument(InstrumentConfiguration& instrumentConfiguration,
66  const CVTranslator& cvTranslator);
67 
68  std::string manufacturer() const;
69  std::string model() const;
70  void manufacturerAndModel(const std::string& valueManufacturer,
71  const std::string& valueModel);
72 
73  std::string ionisation() const;
74  void ionisation(const std::string& value);
75 
76  std::string analyzer() const;
77  void analyzer(const std::string& value);
78 
79  std::string detector() const;
80  void detector(const std::string& value);
81 
82  private:
83  struct Impl;
84  boost::shared_ptr<Impl> impl_;
87 };
88 
89 
90 ///
91 /// interface for legacy access to Software
92 ///
93 /// mzXML:
94 /// <software type="acquisition" name="XCalibur" version="4.20">
95 ///
96 /// MSData:
97 /// name: Software::cvParams(0)
98 /// version: Software::version
99 /// type: DataProcessing::processingMethods[?].userParams[?]
100 ///
101 /// Note: setting 'type' may create a DataProcessing object, which needs an id.
102 /// Since the id is generated from 'name', it is an error to set 'type' before
103 /// setting 'name'.
104 ///
106 {
107  public:
108 
109  LegacyAdapter_Software(SoftwarePtr software, MSData& msd, const CVTranslator& cvTranslator);
110 
111  std::string name() const;
112  void name(const std::string& value);
113 
114  std::string version() const;
115  void version(const std::string& value);
116 
117  std::string type() const;
118  void type(const std::string& value);
119 
120  private:
121  struct Impl;
122  boost::shared_ptr<Impl> impl_;
125 };
126 
127 
128 } // namespace msdata
129 } // namespace pwiz
130 
131 
132 #endif // _LEGACYADAPTER_HPP_
133