ProteoWizard
MSIAMTDataTest.cpp
Go to the documentation of this file.
1 //
2 // $Id: MSIAMTDataTest.cpp 2051 2010-06-15 18:39:13Z chambm $
3 //
4 //
5 // Original author: Kate Hoff <katherine.hoff@proteowizard.org>
6 //
7 // Copyright 2009 Center for Applied Molecular Medicine
8 // University of Southern California, Los Angeles, CA
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 #include "MSIAMTData.hpp"
25 
26 using namespace pwiz::cv;
27 using namespace eharmony;
28 
29 int main()
30 {
31  ifstream ifs("msi_aligned_database.xml");
32  MSIAMTData data;
33  data.read(ifs);
34 
35  /*
36  ostringstream oss;
37  XMLWriter writer(oss);
38  data.write(writer);
39  cout << oss.str() << endl;
40  */
41 
42  ofstream ofs("msi_aligned_database.tsv");
43  ofstream r("r_aligned.tsv");
44  vector<PeptideEntry>::iterator it = data.peptideEntries.begin();
45  for(; it != data.peptideEntries.end(); ++it)
46  {
47  vector<ModificationStateEntry>::iterator jt = it->modificationStateEntries.begin();
48  for(; jt != it->modificationStateEntries.end(); ++jt)
49  {
50  vector<Observation>::iterator kt = jt->observations.begin();
51  for(; kt != jt->observations.end(); ++kt)
52  {
53  ofs << jt->modifiedMass << "\t" << kt->observedHydrophobicity << "\t" << it->peptideSequence << "\n";
54  r << jt->modifiedMass << "\t" << kt->observedHydrophobicity << "\n";
55  }
56 
57  }
58 
59  }
60 
61  return 0;
62 
63 }