Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
MzTab.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-2013.
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: Timo Sachsenberg $
32 // $Authors: Timo Sachsenberg $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_FORMAT_MZTAB_H
36 #define OPENMS_FORMAT_MZTAB_H
37 
40 #include <map>
41 #include <vector>
42 #include <list>
43 #include <algorithm>
45 
46 namespace OpenMS
47 {
55  // MzTab supports null, NaN, Inf for cells with Integer or Double values. MzTabCellType explicitly defines the state of the cell for these types.
57  {
63  };
64 
65  // basic interface for all MzTab datatypes (can be null; are converted from and to cell string)
67  {
68 public:
69  virtual bool isNull() const = 0;
70  virtual void setNull(bool b) = 0;
71  virtual String toCellString() const = 0;
72  virtual void fromCellString(const String&) = 0;
73  };
74 
75  // interface for NaN- and Inf- able datatypes (Double and Integer in MzTab). These are as well null-able
78  {
79 public:
80  virtual bool isNaN() const = 0;
81  virtual void setNaN() = 0;
82  virtual bool isInf() const = 0;
83  virtual void setInf() = 0;
84  };
85 
86  // base class for the atomic non-container like MzTab data types (Double, Int)
89  {
90 public:
92  null_(true)
93  {
94  }
95 
96  bool isNull() const
97  {
98  return null_;
99  }
100 
101  void setNull(bool b)
102  {
103  null_ = b;
104  }
105 
106 protected:
107  bool null_;
108  };
109 
110  // base class for the atomic non-container like MzTab data types (Double, Int)
113  {
114 public:
117  {
118  }
119 
120  bool isNull() const
121  {
122  return state_ == MZTAB_CELLSTATE_NULL;
123  }
124 
125  void setNull(bool b)
126  {
128  }
129 
130  bool isNaN() const
131  {
132  return state_ == MZTAB_CELLSTATE_NAN;
133  }
134 
135  void setNaN()
136  {
138  }
139 
140  bool isInf() const
141  {
142  return state_ == MZTAB_CELLSTATE_INF;
143  }
144 
145  void setInf()
146  {
148  }
149 
150 protected:
152  };
153 
154  class MzTabDouble :
156  {
157 public:
158  void set(const DoubleReal& value)
159  {
161  value_ = value;
162  }
163 
164  DoubleReal get() const
165  {
167  {
168  return value_;
169  }
170  else
171  {
172  throw Exception::ElementNotFound(__FILE__, __LINE__, __PRETTY_FUNCTION__, String("Trying to extract MzTab Double value from non-double valued cell. Did you check the cell state before querying the value?"));
173  return 0;
174  }
175  }
176 
178  {
179  switch (state_)
180  {
182  return String("null");
183 
184  case MZTAB_CELLSTATE_NAN:
185  return String("NaN");
186 
187  case MZTAB_CELLSTATE_INF:
188  return String("Inf");
189 
191  default:
192  return String(value_);
193  }
194  }
195 
196  void fromCellString(const String& s)
197  {
198  String lower = s;
199  lower.toLower().trim();
200  if (lower == "null")
201  {
202  setNull(true);
203  }
204  else if (lower == "nan")
205  {
206  setNaN();
207  }
208  else if (lower == "inf")
209  {
210  setInf();
211  }
212  else // default case
213  {
214  set(lower.toDouble());
215  }
216  }
217 
218 protected:
220  };
221 
223  public MzTabNullAbleBase
224  {
225 public:
227  {
228  }
229 
230  bool isNull() const
231  {
232  return entries_.empty();
233  }
234 
235  void setNull(bool b)
236  {
237  if (b)
238  {
239  entries_.clear();
240  }
241  }
242 
244  {
245  if (isNull())
246  {
247  return "null";
248  }
249  else
250  {
251  String ret;
252  for (std::vector<MzTabDouble>::const_iterator it = entries_.begin(); it != entries_.end(); ++it)
253  {
254  if (it != entries_.begin())
255  {
256  ret += ",";
257  }
258  ret += it->toCellString();
259  }
260  return ret;
261  }
262  }
263 
264  void fromCellString(const String& s)
265  {
266  String lower = s;
267  lower.toLower().trim();
268  if (lower == "null")
269  {
270  setNull(true);
271  }
272  else
273  {
274  String ss = s;
275  std::vector<String> fields;
276  ss.split(",", fields);
277  for (Size i = 0; i != fields.size(); ++i)
278  {
279  MzTabDouble ds;
280  ds.fromCellString(fields[i]);
281  entries_.push_back(ds);
282  }
283  }
284  }
285 
286  std::vector<MzTabDouble> get() const
287  {
288  return entries_;
289  }
290 
291  void set(const std::vector<MzTabDouble>& entries)
292  {
293  entries_ = entries;
294  }
295 
296 protected:
297  std::vector<MzTabDouble> entries_;
298  };
299 
300  class MzTabInteger :
302  {
303 public:
304  void set(const Int& value)
305  {
307  value_ = value;
308  }
309 
310  Int get() const
311  {
313  {
314  return value_;
315  }
316  else
317  {
318  throw Exception::ElementNotFound(__FILE__, __LINE__, __PRETTY_FUNCTION__, String("Trying to extract MzTab Integer value from non-integer valued cell. Did you check the cell state before querying the value?"));
319  return 0;
320  }
321  }
322 
324  {
325  switch (state_)
326  {
328  return String("null");
329 
330  case MZTAB_CELLSTATE_NAN:
331  return String("NaN");
332 
333  case MZTAB_CELLSTATE_INF:
334  return String("Inf");
335 
337  default:
338  return String(value_);
339  }
340  }
341 
342  void fromCellString(const String& s)
343  {
344  String lower = s;
345  lower.toLower().trim();
346  if (lower == "null")
347  {
348  setNull(true);
349  }
350  else if (lower == "nan")
351  {
352  setNaN();
353  }
354  else if (lower == "inf")
355  {
356  setInf();
357  }
358  else // default case
359  {
360  set(lower.toInt());
361  }
362  }
363 
364 protected:
366  };
367 
368  class MzTabBoolean :
369  public MzTabNullAbleBase
370  {
371 public:
372  void set(const bool& value)
373  {
374  setNull(false);
375  value_ = value;
376  }
377 
378  Int get() const
379  {
380  return value_;
381  }
382 
384  {
385  if (isNull())
386  {
387  return "null";
388  }
389  else
390  {
391  if (value_)
392  {
393  return "1";
394  }
395  else
396  {
397  return "0";
398  }
399  }
400  }
401 
402  void fromCellString(const String& s)
403  {
404  String lower = s;
405  lower.toLower().trim();
406  if (lower == "null")
407  {
408  setNull(true);
409  }
410  else
411  {
412  if (s == "0")
413  {
414  set(false);
415  }
416  else if (s == "1")
417  {
418  set(true);
419  }
420  else
421  {
422  throw Exception::ConversionError(__FILE__, __LINE__, __PRETTY_FUNCTION__, String("Could not convert String '") + s + "' to MzTabBoolean");
423  }
424  }
425  }
426 
427 protected:
428  bool value_;
429  };
430 
431  class MzTabString :
433  {
434 public:
435  void set(const String& value)
436  {
437  String lower = value;
438  lower.toLower().trim();
439  if (lower == "null")
440  {
441  setNull(true);
442  }
443  else
444  {
445  value_ = value;
446  }
447  }
448 
449  String get() const
450  {
451  return value_;
452  }
453 
454  bool isNull() const
455  {
456  return value_.empty();
457  }
458 
459  void setNull(bool b)
460  {
461  if (b)
462  {
463  value_.clear();
464  }
465  }
466 
468  {
469  if (isNull())
470  {
471  return String("null");
472  }
473  else
474  {
475  return value_;
476  }
477  }
478 
479  void fromCellString(const String& s)
480  {
481  set(s);
482  }
483 
484 protected:
486  };
487 
490  {
491 public:
492  bool isNull() const
493  {
494  return CV_label_.empty() && accession_.empty() && name_.empty() && value_.empty();
495  }
496 
497  void setNull(bool b)
498  {
499  if (b)
500  {
501  CV_label_.clear();
502  accession_.clear();
503  name_.clear();
504  value_.clear();
505  }
506  }
507 
508  void setCVLabel(const String& CV_label)
509  {
510  CV_label_ = CV_label;
511  }
512 
513  void setAccession(const String& accession)
514  {
515  accession_ = accession;
516  }
517 
518  void setName(const String& name)
519  {
520  name_ = name;
521  }
522 
523  void setValue(const String& value)
524  {
525  value_ = value;
526  }
527 
529  {
530  assert(!isNull());
531  return CV_label_;
532  }
533 
535  {
536  assert(!isNull());
537  return accession_;
538  }
539 
540  String getName() const
541  {
542  assert(!isNull());
543  return name_;
544  }
545 
546  String getValue() const
547  {
548  assert(!isNull());
549  return value_;
550  }
551 
553  {
554  if (isNull())
555  {
556  return "null";
557  }
558  else
559  {
560  String ret = "[";
561  ret += CV_label_ + ",";
562  ret += accession_ + ",";
563  if (!name_.empty())
564  {
565  ret += String("\"") + name_ + String("\""); // always quote non empty name
566  }
567 
568  ret += String(",");
569 
570  ret += value_;
571  ret += "]";
572  return ret;
573  }
574  }
575 
576  void fromCellString(const String& s)
577  {
578  String lower = s;
579  lower.toLower().trim();
580  if (lower == "null")
581  {
582  setNull(true);
583  }
584  else
585  {
586  String ss = s;
587 
588  // quotes (around name) so possibly a comma inside the CV name.
589  if (s.hasSubstring("\""))
590  {
591  std::vector<String> quoted_fields;
592  ss.split("\"", quoted_fields);
593 
594  if (quoted_fields.size() != 3)
595  {
596  throw Exception::ConversionError(__FILE__, __LINE__, __PRETTY_FUNCTION__, String("Could not convert quoted fields in '") + s + "' to MzTabParameter");
597  }
598 
599  name_ = quoted_fields[1];
600  ss.substitute(String("\"") + name_ + String("\""), ""); // remove CV name that possibly contains comma
601 
602  std::vector<String> comma_fields;
603  ss.split(",", comma_fields);
604  if (comma_fields.size() != 4)
605  {
606  throw Exception::ConversionError(__FILE__, __LINE__, __PRETTY_FUNCTION__, String("Could not convert String '") + s + "' to MzTabParameter");
607  }
608  else
609  {
610 
611  comma_fields[0].remove('[');
612  comma_fields[3].remove(']');
613  CV_label_ = comma_fields[0];
614  accession_ = comma_fields[1];
615  value_ = comma_fields[3];
616  }
617  }
618  else // no quotes (around name) => no extra comma expected
619  {
620  std::vector<String> fields;
621  ss.split(",", fields);
622  if (fields.size() != 4)
623  {
624  throw Exception::ConversionError(__FILE__, __LINE__, __PRETTY_FUNCTION__, String("Could not convert String '") + s + "' to MzTabParameter");
625  }
626  else
627  {
628 
629  fields[0].remove('[');
630  fields[3].remove(']');
631  CV_label_ = fields[0];
632  accession_ = fields[1];
633  name_ = fields[2].remove('"');
634  value_ = fields[3];
635  }
636  }
637  }
638  }
639 
640 protected:
645  };
646 
649  {
650 public:
651  bool isNull() const
652  {
653  return parameters_.empty();
654  }
655 
656  void setNull(bool b)
657  {
658  if (b)
659  {
660  parameters_.clear();
661  }
662  }
663 
665  {
666  if (isNull())
667  {
668  return "null";
669  }
670  else
671  {
672  String ret;
673  for (std::vector<MzTabParameter>::const_iterator it = parameters_.begin(); it != parameters_.end(); ++it)
674  {
675  if (it != parameters_.begin())
676  {
677  ret += "|";
678  }
679  ret += it->toCellString();
680  }
681  return ret;
682  }
683  }
684 
685  void fromCellString(const String& s)
686  {
687  String lower = s;
688  lower.toLower().trim();
689 
690  if (lower == "null")
691  {
692  setNull(true);
693  }
694  else
695  {
696  String ss = s;
697  std::vector<String> fields;
698  ss.split("|", fields);
699  for (Size i = 0; i != fields.size(); ++i)
700  {
701  MzTabParameter p;
702  lower = fields[i];
703  lower.toLower();
704  if (lower == "null")
705  {
706  throw Exception::ConversionError(__FILE__, __LINE__, __PRETTY_FUNCTION__, String("MzTabParameter in MzTabParameterList must not be null '") + s);
707  }
708  p.fromCellString(fields[i]);
709  parameters_.push_back(p);
710  }
711  }
712  }
713 
714  std::vector<MzTabParameter> get() const
715  {
716  return parameters_;
717  }
718 
719  void set(const std::vector<MzTabParameter>& parameters)
720  {
721  parameters_ = parameters;
722  }
723 
724 protected:
725  std::vector<MzTabParameter> parameters_;
726  };
727 
730  {
731 public:
733  sep_('|')
734  {
735  }
736 
737  // needed for e.g. ambiguity_members and GO accessions as these use ',' as separator while the others use '|'
738  void setSeparator(char sep)
739  {
740  sep_ = sep;
741  }
742 
743  bool isNull() const
744  {
745  return entries_.empty();
746  }
747 
748  void setNull(bool b)
749  {
750  if (b)
751  {
752  entries_.clear();
753  }
754  }
755 
757  {
758  if (isNull())
759  {
760  return "null";
761  }
762  else
763  {
764  String ret;
765  for (std::vector<MzTabString>::const_iterator it = entries_.begin(); it != entries_.end(); ++it)
766  {
767  if (it != entries_.begin())
768  {
769  ret += sep_;
770  }
771  ret += it->toCellString();
772  }
773  return ret;
774  }
775  }
776 
777  void fromCellString(const String& s)
778  {
779  String lower = s;
780  lower.toLower().trim();
781 
782  if (lower == "null")
783  {
784  setNull(true);
785  }
786  else
787  {
788  String ss = s;
789  std::vector<String> fields;
790  ss.split(sep_, fields);
791  for (Size i = 0; i != fields.size(); ++i)
792  {
793  MzTabString ts;
794  ts.fromCellString(fields[i]);
795  entries_.push_back(ts);
796  }
797  }
798  }
799 
800  std::vector<MzTabString> get() const
801  {
802  return entries_;
803  }
804 
805  void set(const std::vector<MzTabString>& entries)
806  {
807  entries_ = entries;
808  }
809 
810 protected:
811  std::vector<MzTabString> entries_;
812  char sep_;
813  };
814 
817  {
818 public:
819 
820  bool isNull() const
821  {
823  }
824 
825  void setNull(bool b)
826  {
827  if (b)
828  {
829  pos_param_pairs_.clear();
831  }
832  }
833 
834  // set (potentially ambigous) position(s) with associated parameter (might be null if not set)
835  void setPositionsAndParameters(const std::vector<std::pair<Int, MzTabParameter> >& ppp)
836  {
837  pos_param_pairs_ = ppp;
838  }
839 
840  std::vector<std::pair<Int, MzTabParameter> > getPositionsAndParameters() const
841  {
842  return pos_param_pairs_;
843  }
844 
846  {
847  mod_or_subst_identifier_ = mod_id;
848  }
849 
851  {
852  assert(!isNull());
854  }
855 
857  {
858  if (isNull())
859  {
860  return String("null");
861  }
862  else
863  {
864  String pos_param_string;
865 
866  for (Size i = 0; i != pos_param_pairs_.size(); ++i)
867  {
868  pos_param_string += pos_param_pairs_[i].first;
869 
870  // attach MzTabParameter if available
871  if (!pos_param_pairs_[i].second.isNull())
872  {
873  pos_param_string += pos_param_pairs_[i].second.toCellString();
874  }
875 
876  // add | as separator (exept for last one)
877  if (i < pos_param_pairs_.size() - 1)
878  {
879  pos_param_string += String("|");
880  }
881  }
882 
883  // quick sanity check
885  {
886  throw Exception::ConversionError(__FILE__, __LINE__, __PRETTY_FUNCTION__, String("Modification or Substitution identifier MUST NOT be null or empty in MzTabModification"));
887  }
888 
889  String res;
890  // only add '-' if we have position information
891  if (!pos_param_string.empty())
892  {
893  res = pos_param_string + "-" + mod_or_subst_identifier_.toCellString();
894  }
895  else
896  {
898  }
899  return res;
900  }
901  }
902 
903  void fromCellString(const String& s)
904  {
905  String lower = s;
906  lower.toLower().trim();
907  if (lower == "null")
908  {
909  setNull(true);
910  }
911  else
912  {
913  if (!lower.hasSubstring("-")) // no positions? simply use s as mod identifier
914  {
916  }
917  else
918  {
919  String ss = s;
920  ss.trim();
921  std::vector<String> fields;
922  ss.split("-", fields);
923 
924  if (fields.size() != 2)
925  {
926  throw Exception::ConversionError(__FILE__, __LINE__, __PRETTY_FUNCTION__, String("Can't convert to MzTabModification from '") + s);
927  }
928  mod_or_subst_identifier_.fromCellString(fields[1].trim());
929 
930  std::vector<String> position_fields;
931  fields[0].split("|", position_fields);
932 
933  for (Size i = 0; i != position_fields.size(); ++i)
934  {
935  Size spos = position_fields[i].find_first_of("[");
936 
937  if (spos == std::string::npos) // only position information and no parameter
938  {
939  pos_param_pairs_.push_back(std::make_pair(position_fields[i].toInt(), MzTabParameter()));
940  }
941  else
942  {
943  // extract position part
944  Int pos = String(position_fields[i].begin(), position_fields[i].begin() + spos).toInt();
945 
946  // extract [,,,] part
947  MzTabParameter param;
948  param.fromCellString(position_fields[i].substr(spos));
949  pos_param_pairs_.push_back(std::make_pair(pos, param));
950  }
951  }
952  }
953  }
954  }
955 
956 protected:
957  std::vector<std::pair<Int, MzTabParameter> > pos_param_pairs_;
959  };
960 
962  public MzTabNullAbleBase
963  {
964 public:
965  bool isNull() const
966  {
967  return entries_.empty();
968  }
969 
970  void setNull(bool b)
971  {
972  if (b)
973  {
974  entries_.clear();
975  }
976  }
977 
979  {
980  if (isNull())
981  {
982  return "null";
983  }
984  else
985  {
986  String ret;
987  for (std::vector<MzTabModification>::const_iterator it = entries_.begin(); it != entries_.end(); ++it)
988  {
989  if (it != entries_.begin())
990  {
991  ret += ",";
992  }
993  ret += it->toCellString();
994  }
995  return ret;
996  }
997  }
998 
999  void fromCellString(const String& s)
1000  {
1001  String lower = s;
1002  lower.toLower().trim();
1003  if (lower == "null")
1004  {
1005  setNull(true);
1006  }
1007  else
1008  {
1009  String ss = s;
1010  std::vector<String> fields;
1011 
1012  if (!ss.hasSubstring("[")) // no parameters
1013  {
1014  ss.split(",", fields);
1015  for (Size i = 0; i != fields.size(); ++i)
1016  {
1017  MzTabModification ms;
1018  ms.fromCellString(fields[i]);
1019  entries_.push_back(ms);
1020  }
1021  }
1022  else
1023  {
1024  // example string: 3|4[a,b,,v]|8[,,"blabla, [bla]",v],1|2|3[a,b,,v]-mod:123
1025  // we don't want to split at the , inside of [ ] MzTabParameter brackets.
1026  // Additionally, and we don't want to recognise quoted brackets inside the MzTabParameter where they can occur in quoted text (see example string)
1027  bool in_param_bracket = false;
1028  bool in_quotes = false;
1029 
1030  for (Size pos = 0; pos != ss.size(); ++pos)
1031  {
1032  // param_bracket state
1033  if (ss[pos] == '[' && !in_quotes)
1034  {
1035  in_param_bracket = true;
1036  continue;
1037  }
1038 
1039  if (ss[pos] == ']' && !in_quotes)
1040  {
1041  in_param_bracket = false;
1042  continue;
1043  }
1044 
1045  // quote state
1046  if (ss[pos] == '\"')
1047  {
1048  in_quotes = !in_quotes;
1049  continue;
1050  }
1051 
1052  // comma in param bracket
1053  if (ss[pos] == ',' && !in_quotes && in_param_bracket)
1054  {
1055  ss[pos] = ((char)007); // use ASCII bell as temporary separator
1056  continue;
1057  }
1058  }
1059 
1060  // now the split at comma is save
1061  ss.split(",", fields);
1062  /*
1063  for (Size i = 0; i != fields.size(); ++i)
1064  {
1065  std::cout << "Modification list field[" + String(i) + "]=" << fields[i] << std::endl;
1066  }
1067  */
1068  for (Size i = 0; i != fields.size(); ++i)
1069  {
1070  fields[i].substitute(((char)007), ','); // resubstitute comma after split
1071  MzTabModification ms;
1072  ms.fromCellString(fields[i]);
1073  entries_.push_back(ms);
1074  }
1075  }
1076  }
1077  }
1078 
1079  std::vector<MzTabModification> get() const
1080  {
1081  return entries_;
1082  }
1083 
1084  void set(const std::vector<MzTabModification>& entries)
1085  {
1086  entries_ = entries;
1087  }
1088 
1089 protected:
1090  std::vector<MzTabModification> entries_;
1091 
1092  };
1093 
1095  public MzTabNullAbleInterface
1096  {
1097 public:
1099  ms_file_(0)
1100  {
1101  }
1102 
1103  bool isNull() const
1104  {
1105  return (ms_file_ < 1) || (spec_ref_.empty());
1106  }
1107 
1108  void setNull(bool b)
1109  {
1110  if (b)
1111  {
1112  ms_file_ = 0;
1113  spec_ref_.clear();
1114  }
1115  }
1116 
1117  void setMSFile(Size index)
1118  {
1119  assert(index >= 1);
1120  if (index >= 1)
1121  {
1122  ms_file_ = index;
1123  }
1124  }
1125 
1126  void setSpecRef(String spec_ref)
1127  {
1128  assert(!spec_ref.empty());
1129  if (!spec_ref.empty())
1130  {
1131  spec_ref_ = spec_ref;
1132  }
1133  }
1134 
1136  {
1137  assert(!isNull());
1138  return spec_ref_;
1139  }
1140 
1141  Size getMSFile() const
1142  {
1143  assert(!isNull());
1144  return ms_file_;
1145  }
1146 
1147  void setSpecRefFile(const String& spec_ref)
1148  {
1149  assert(!spec_ref.empty());
1150  if (!spec_ref.empty())
1151  {
1152  spec_ref_ = spec_ref;
1153  }
1154  }
1155 
1157  {
1158  if (isNull())
1159  {
1160  return String("null");
1161  }
1162  else
1163  {
1164  return String("ms_file[") + String(ms_file_) + "]:" + spec_ref_;
1165  }
1166  }
1167 
1168  void fromCellString(const String& s)
1169  {
1170  String lower = s;
1171  lower.toLower().trim();
1172  if (lower == "null")
1173  {
1174  setNull(true);
1175  }
1176  else
1177  {
1178  String ss = s;
1179  std::vector<String> fields;
1180  ss.split(":", fields);
1181  if (fields.size() != 2)
1182  {
1183  throw Exception::ConversionError(__FILE__, __LINE__, __PRETTY_FUNCTION__, String("Can not convert to MzTabSpectraRef from '") + s);
1184  }
1185 
1186  spec_ref_ = fields[1];
1187  ms_file_ = (Size)(fields[0].substitute("ms_file[", "").remove(']').toInt());
1188  }
1189  }
1190 
1191 protected:
1192  Size ms_file_; // number is specified in the meta data section.
1194  };
1195 
1196  // MTD - Metadata section (Key-value)
1197 
1198  // all meta data belonging to a (potentially empty) sub unit id
1200  {
1201  // ranges denote multiplicity as specified in the specification document
1202  std::vector<MzTabParameter> species; // 0..* Species of the unit / subsample.
1203  std::vector<MzTabParameter> tissue; // 0..* Tissue of the unit / subsample.
1204  std::vector<MzTabParameter> cell_type; // 0..* Parameter Cell type of the unit / subsample.
1205  std::vector<MzTabParameter> disease; // 0..* Disease state of the unit / subsample.
1206  std::vector<MzTabString> description; // 0..* Description of the subsample.
1207  std::vector<MzTabParameter> quantification_reagent; // 0..* Quantification reagent used to label the subsample.
1208  std::vector<MzTabParameter> custom; // 0..* Additional parameters for the subsample.
1209  };
1210 
1211  // all meta data belonging to one unit id
1213  {
1214  // version string is not explicitly modelled but written at top
1215  MzTabString title; // 0..1 The unit’s title
1217  std::vector<MzTabParameterList> sample_processing; // 0..* Description of the sample processing.
1218  std::vector<MzTabParameter> instrument_name; // 0..* The instrument’s name
1219  std::vector<MzTabParameter> instrument_source; // 0..* The instrument’s source
1220  std::vector<MzTabParameter> instrument_analyzer; // 0..* The instrument’s analyzer
1221  std::vector<MzTabParameter> instrument_detector; // 0..* The instrument’s detector
1222  std::vector<MzTabParameter> software; // 0..* Analysis software used in the order it was used.
1223  std::vector<std::vector<String> > software_setting; // 0..* A sotware setting used. This field MAY occur multiple times for a single software (=same index).
1224  MzTabParameterList false_discovery_rate; // 0..1 False discovery rate(s)for the experiment.
1225  std::vector<MzTabStringList> publication; // 0..* Publication ids (pubmed / doi).
1226  std::vector<MzTabString> contact_name; // 0..* Contact name.
1227  std::vector<MzTabString> contact_affiliation; // 0..* Contact affiliation.
1228  std::vector<MzTabString> contact_email; // 0..* Contact’s e-mail address.
1229  std::vector<MzTabString> uri; // 0..* Points to the unit’s source data.
1230  MzTabParameterList mod; // 0..1 Modifications reported in the unit.
1231  MzTabParameter quantification_method; // 0..1 Quantification method used.
1232  MzTabParameter protein_quantification_unit; // 0..1 Unit of protein quantification results.
1233  MzTabParameter peptide_quantification_unit; // 0..1 Unit of peptide quantification results.
1234  MzTabParameter small_molecule_quantification_unit; // 0..1 Unit of small molecule quantification results.
1235  std::vector<MzTabParameter> ms_file_format; // // 0..* Data format of the external MS data file.
1236  std::vector<MzTabParameter> ms_file_location; // 0..* Location of the external MS data file.
1237  std::vector<MzTabParameter> ms_file_id_format; // 0..* Identifier format of the external MS data file.
1238  std::vector<MzTabParameter> custom; // 0..* Additional parameters.
1239  std::vector<MzTabSubIdMetaData> sub_id_data; // can contain none, one or multiple sub ids
1240 
1241  // Units: The format of the value has to be {column name}={Parameter defining the unit}
1242  // This field MUST NOT be used to define a unit for quantification columns.
1243  std::vector<String> colunit_protein; // 0..* Defines the used unit for a column in the protein section.
1244  std::vector<String> colunit_peptide; // 0..* Defines the used unit for a column in the peptide section.
1245  std::vector<String> colunit_small_molecule; // 0..* Defines the used unit for a column in the small molecule section.
1246  };
1247 
1248  typedef std::pair<String, MzTabString> MzTabOptionalColumnEntry; // column name (not null able), value (null able)
1249 
1250  // PRT - Protein section (Table based)
1252  {
1254  {
1255  // use "," as list separator because "|" can be used for go terms and protein accessions
1256  go_terms.setSeparator(',');
1258  }
1259 
1260  MzTabString accession; // The protein’s accession.
1261  //String unit_id; // The unit’s id. not null able!
1262  MzTabString description; // Human readable description (i.e. the name)
1263  MzTabInteger taxid; // NEWT taxonomy for the species.
1264  MzTabString species; // Human readable name of the species
1265  MzTabString database; // Name of the protein database.
1266  MzTabString database_version; // String Version of the protein database.
1267  MzTabParameterList search_engine; // Search engine(s) identifying the protein.
1268  MzTabParameterList search_engine_score; // Search engine(s) reliability score(s).
1269  MzTabInteger reliability; // (1-3) Identification reliability.
1270  MzTabInteger num_peptides; // Number of PSMs assigned to the protein.
1271  MzTabInteger num_peptides_distinct; // Distinct (sequence + modifications) # of peptides.
1272  MzTabInteger num_peptides_unambiguous; // Distinct number of unambiguous peptides.
1273  MzTabStringList ambiguity_members; // Alternative protein identifications.
1274  MzTabModificationList modifications; // Modifications identified in the protein.
1275  MzTabString uri; // Location of the protein’s source entry.
1276  MzTabStringList go_terms; // List of GO terms for the protein.
1277  MzTabDouble protein_coverage; // (0-1) Amount of protein sequence identified.
1278  std::vector<MzTabDouble> protein_abundance_sub; // Protein abundance in the subsample.
1279  std::vector<MzTabDouble> protein_abundance_stdev_sub; // Standard deviation of the protein abundance.
1280  std::vector<MzTabDouble> protein_abundance_std_error_sub; // Standard error of the protein abundance.
1281  std::vector<MzTabOptionalColumnEntry> opt_; // Optional Columns must start with “opt_”
1282  };
1283 
1284  // PEP - Peptide section (Table based)
1286  {
1287  MzTabString sequence; // The peptide’s sequence.
1288  MzTabString accession; // The protein’s accession.
1289  //String unit_id; // The unit’s id.
1290  MzTabBoolean unique; // 0=false, 1=true, null else: Peptide is unique for the protein.
1291  MzTabString database; // Name of the sequence database.
1292  MzTabString database_version; // Version (and optionally # of entries).
1293  MzTabParameterList search_engine; // Search engine(s) that identified the peptide.
1294  MzTabParameterList search_engine_score; // Search engine(s) score(s) for the peptide.
1295  MzTabInteger reliability; // (1-3) 0=null Identification reliability for the peptide.
1296  MzTabModificationList modifications; // Modifications identified in the peptide.
1297  MzTabDoubleList retention_time; // Time points in seconds. Semantics may vary.
1298  MzTabDouble charge; // Precursor ion’s charge.
1299  MzTabDouble mass_to_charge; // Precursor ion’s m/z.
1300  MzTabString uri; // Location of the PSM’s source entry.
1301  MzTabSpectraRef spectra_ref; // Spectra identifying the peptide.
1302  std::vector<MzTabDouble> peptide_abundance_sub; // Peptide abundance in the subsample;
1303  std::vector<MzTabDouble> peptide_abundance_stdev_sub; // Peptide abundance standard deviation.
1304  std::vector<MzTabDouble> peptide_abundance_std_error_sub; // Peptide abundance standard error.
1305  std::vector<MzTabOptionalColumnEntry> opt_; // Optional columns must start with “opt_”.
1306  };
1307 
1308  // SML Small molecule section (table based)
1310  {
1311  MzTabStringList identifier; // The small molecule’s identifier.
1312  MzTabString chemical_formula; // Chemical formula of the identified compound.
1313  MzTabString smiles; // Molecular structure in SMILES format.
1314  MzTabString inchi_key; // InChi Key of the identified compound.
1315  MzTabString description; // Human readable description (i.e. the name)
1316  MzTabDouble mass_to_charge; // Precursor ion’s m/z.
1317  MzTabDouble charge; // Precursor ion’s charge.
1318  MzTabDoubleList retention_time; // Time points in seconds. Semantics may vary.
1319  MzTabInteger taxid; // NEWT taxonomy for the species.
1320  MzTabString species; // Human readable name of the species
1321  MzTabString database; // Name of the used database.
1322  MzTabString database_version; // String Version of the database (and optionally # of compounds).
1323  MzTabInteger reliability; // (1-3) The identification reliability.
1324  MzTabString uri; // The source entry’s location.
1325  MzTabSpectraRef spectra_ref; // Spectra identifying the small molecule.
1326  MzTabParameterList search_engine; // Search engine(s) identifying the small molecule.
1327  MzTabParameterList search_engine_score; // Search engine(s) identifications score(s).
1328  MzTabModificationList modifications; // Modifications identified on the small molecule.
1329  std::vector<MzTabDouble> smallmolecule_abundance_sub; // Abundance in the subsample;
1330  std::vector<MzTabDouble> smallmolecule_abundance_stdev_sub; // Standard deviation of the abundance.
1331  std::vector<MzTabDouble> smallmolecule_abundance_std_error_sub; // Standard errpr of the abundance.
1332  std::vector<MzTabOptionalColumnEntry> opt_; // Optional columns must start with “opt_”.
1333  };
1334 
1335  typedef std::vector<MzTabProteinSectionRow> MzTabProteinSectionRows;
1336 
1337  typedef std::vector<MzTabPeptideSectionRow> MzTabPeptideSectionRows;
1338 
1339  typedef std::vector<MzTabSmallMoleculeSectionRow> MzTabSmallMoleculeSectionRows;
1340 
1341  typedef std::map<String, MzTabUnitIdMetaData> MzTabMetaData;
1342 
1343  typedef std::map<String, MzTabProteinSectionRows> MzTabProteinSectionData;
1344 
1345  typedef std::map<String, MzTabPeptideSectionRows> MzTabPeptideSectionData;
1346 
1347  typedef std::map<String, MzTabSmallMoleculeSectionRows> MzTabSmallMoleculeSectionData;
1348 
1355  class OPENMS_DLLAPI MzTab
1356  {
1357 public:
1359  MzTab() {}
1360 
1362  ~MzTab() {}
1363 
1365  {
1366  return map_unitid_to_meta_data_;
1367  }
1368 
1369  void setMetaData(const MzTabMetaData& md)
1370  {
1371  map_unitid_to_meta_data_ = md;
1372  }
1373 
1375  {
1376  return map_unitid_to_protein_data_;
1377  }
1378 
1380  {
1381  map_unitid_to_protein_data_ = psd;
1382  }
1383 
1385  {
1386  return map_unitid_to_peptide_data_;
1387  }
1388 
1390  {
1391  map_unitid_to_peptide_data_ = psd;
1392  }
1393 
1395  {
1396  return map_unitid_to_small_molecule_data_;
1397  }
1398 
1400  {
1401  map_unitid_to_small_molecule_data_ = smsd;
1402  }
1403 
1404  // Extract opt_ (custom, optional column names. Note: opt_ column names must be the same for all unitids so just take from first
1405  std::vector<String> getProteinOptionalColumnNames() const
1406  {
1407  std::vector<String> names;
1408  const MzTabProteinSectionData& protein_section = map_unitid_to_protein_data_;
1409  if (!protein_section.empty())
1410  {
1411  const MzTabProteinSectionRows& protein_rows = protein_section.begin()->second;
1412  if (!protein_rows.empty())
1413  {
1414  const std::vector<MzTabOptionalColumnEntry>& opt_ = protein_rows[0].opt_;
1415  for (std::vector<MzTabOptionalColumnEntry>::const_iterator it = opt_.begin(); it != opt_.end(); ++it)
1416  {
1417  names.push_back(it->first);
1418  }
1419  }
1420  }
1421  return names;
1422  }
1423 
1424  // Extract opt_ (custom, optional column names. Note: opt_ column names must be the same for all unitids so just take from first
1425  std::vector<String> getPeptideOptionalColumnNames() const
1426  {
1427  std::vector<String> names;
1428  const MzTabPeptideSectionData& peptide_section = map_unitid_to_peptide_data_;
1429  if (!peptide_section.empty())
1430  {
1431  const MzTabPeptideSectionRows& peptide_rows = peptide_section.begin()->second;
1432  if (!peptide_rows.empty())
1433  {
1434  const std::vector<MzTabOptionalColumnEntry>& opt_ = peptide_rows[0].opt_;
1435  for (std::vector<MzTabOptionalColumnEntry>::const_iterator it = opt_.begin(); it != opt_.end(); ++it)
1436  {
1437  names.push_back(it->first);
1438  }
1439  }
1440  }
1441  return names;
1442  }
1443 
1444  // Extract opt_ (custom, optional column names. Note: opt_ column names must be the same for all unitids so just take from first
1445  std::vector<String> getSmallMoleculeOptionalColumnNames() const
1446  {
1447  std::vector<String> names;
1448  const MzTabSmallMoleculeSectionData& small_molecule_section = map_unitid_to_small_molecule_data_;
1449  if (!small_molecule_section.empty())
1450  {
1451  const MzTabSmallMoleculeSectionRows& small_molecule_rows = small_molecule_section.begin()->second;
1452  if (!small_molecule_rows.empty())
1453  {
1454  const std::vector<MzTabOptionalColumnEntry>& opt_ = small_molecule_rows[0].opt_;
1455  for (std::vector<MzTabOptionalColumnEntry>::const_iterator it = opt_.begin(); it != opt_.end(); ++it)
1456  {
1457  names.push_back(it->first);
1458  }
1459  }
1460  }
1461  return names;
1462  }
1463 
1464 protected:
1469  };
1470 
1471 } // namespace OpenMS
1472 
1473 #endif // OPENMS_FORMAT_MZTAB_H
MzTabSpectraRef spectra_ref
Definition: MzTab.h:1301
std::vector< MzTabParameter > species
Definition: MzTab.h:1202
MzTabSpectraRef spectra_ref
Definition: MzTab.h:1325
String toCellString() const
Definition: MzTab.h:856
MzTabString uri
Definition: MzTab.h:1275
std::vector< MzTabDouble > smallmolecule_abundance_stdev_sub
Definition: MzTab.h:1330
void fromCellString(const String &s)
Definition: MzTab.h:264
void fromCellString(const String &s)
Definition: MzTab.h:777
virtual String toCellString() const =0
Definition: MzTab.h:1212
void setNull(bool b)
Definition: MzTab.h:235
MzTabString database
Definition: MzTab.h:1291
std::map< String, MzTabProteinSectionRows > MzTabProteinSectionData
Definition: MzTab.h:1343
A more convenient string class.
Definition: String.h:56
MzTabString accession
Definition: MzTab.h:1288
void set(const DoubleReal &value)
Definition: MzTab.h:158
std::vector< MzTabDouble > protein_abundance_sub
Definition: MzTab.h:1278
MzTabString sequence
Definition: MzTab.h:1287
Definition: MzTab.h:1251
MzTabParameter protein_quantification_unit
Definition: MzTab.h:1232
std::vector< MzTabParameter > ms_file_format
Definition: MzTab.h:1235
std::vector< MzTabParameter > cell_type
Definition: MzTab.h:1204
DoubleReal toDouble() const
Conversion to double.
Element could not be found exception.
Definition: Exception.h:648
void fromCellString(const String &s)
Definition: MzTab.h:479
MzTabParameterList search_engine
Definition: MzTab.h:1267
Definition: MzTab.h:62
std::vector< std::vector< String > > software_setting
Definition: MzTab.h:1223
virtual bool isNull() const =0
Definition: MzTab.h:111
MzTab()
Default constructor.
Definition: MzTab.h:1359
bool isNaN() const
Definition: MzTab.h:130
const MzTabSmallMoleculeSectionData & getSmallMoleculeSectionData() const
Definition: MzTab.h:1394
Definition: MzTab.h:60
MzTabString inchi_key
Definition: MzTab.h:1314
Definition: MzTab.h:1094
Definition: MzTab.h:431
void setNull(bool b)
Definition: MzTab.h:825
MzTabParameter quantification_method
Definition: MzTab.h:1231
MzTabString getModOrSubstIdentifier() const
Definition: MzTab.h:850
Definition: MzTab.h:488
std::vector< MzTabOptionalColumnEntry > opt_
Definition: MzTab.h:1305
MzTabString database
Definition: MzTab.h:1265
bool isNull() const
Definition: MzTab.h:651
String toCellString() const
Definition: MzTab.h:467
String getName() const
Definition: MzTab.h:540
String value_
Definition: MzTab.h:485
String getAccession() const
Definition: MzTab.h:534
std::map< String, MzTabUnitIdMetaData > MzTabMetaData
Definition: MzTab.h:1341
MzTabString database_version
Definition: MzTab.h:1266
String CV_label_
Definition: MzTab.h:641
MzTabParameterList search_engine
Definition: MzTab.h:1293
std::vector< MzTabParameter > disease
Definition: MzTab.h:1205
MzTabSmallMoleculeSectionData map_unitid_to_small_molecule_data_
Definition: MzTab.h:1468
std::vector< MzTabParameter > custom
Definition: MzTab.h:1238
MzTabStringList identifier
Definition: MzTab.h:1311
std::vector< MzTabParameter > instrument_detector
Definition: MzTab.h:1221
std::vector< MzTabDouble > peptide_abundance_stdev_sub
Definition: MzTab.h:1303
std::vector< MzTabSmallMoleculeSectionRow > MzTabSmallMoleculeSectionRows
Definition: MzTab.h:1339
MzTabProteinSectionRow()
Definition: MzTab.h:1253
MzTabParameterList search_engine_score
Definition: MzTab.h:1294
void setCVLabel(const String &CV_label)
Definition: MzTab.h:508
std::vector< MzTabModification > entries_
Definition: MzTab.h:1090
MzTabCellStateType state_
Definition: MzTab.h:151
void setNull(bool b)
Definition: MzTab.h:125
void fromCellString(const String &s)
Definition: MzTab.h:196
bool isNull() const
Definition: MzTab.h:1103
Definition: MzTab.h:647
std::vector< MzTabOptionalColumnEntry > opt_
Definition: MzTab.h:1332
std::vector< MzTabDouble > peptide_abundance_std_error_sub
Definition: MzTab.h:1304
MzTabString mod_or_subst_identifier_
Definition: MzTab.h:958
char sep_
Definition: MzTab.h:812
Int value_
Definition: MzTab.h:365
void setSpecRefFile(const String &spec_ref)
Definition: MzTab.h:1147
String toCellString() const
Definition: MzTab.h:978
std::vector< MzTabDouble > protein_abundance_stdev_sub
Definition: MzTab.h:1279
MzTabString uri
Definition: MzTab.h:1324
std::vector< MzTabParameter > quantification_reagent
Definition: MzTab.h:1207
std::vector< MzTabProteinSectionRow > MzTabProteinSectionRows
Definition: MzTab.h:1335
MzTabDoubleList retention_time
Definition: MzTab.h:1318
bool isNull() const
Definition: MzTab.h:96
MzTabSpectraRef()
Definition: MzTab.h:1098
MzTabBoolean unique
Definition: MzTab.h:1290
void set(const String &value)
Definition: MzTab.h:435
MzTabInteger reliability
Definition: MzTab.h:1295
MzTabProteinSectionData map_unitid_to_protein_data_
Definition: MzTab.h:1466
~MzTab()
Destructor.
Definition: MzTab.h:1362
Definition: MzTab.h:815
MzTabParameterList mod
Definition: MzTab.h:1230
MzTabCellStateType
Data model of MzTab files. Please see the official MzTab specification at https://code.google.com/p/mztab/.
Definition: MzTab.h:56
void setNull(bool b)
Definition: MzTab.h:1108
void setValue(const String &value)
Definition: MzTab.h:523
std::vector< String > getPeptideOptionalColumnNames() const
Definition: MzTab.h:1425
String getCVLabel() const
Definition: MzTab.h:528
Definition: MzTab.h:368
MzTabPeptideSectionData map_unitid_to_peptide_data_
Definition: MzTab.h:1467
MzTabString description
Definition: MzTab.h:1315
void set(const std::vector< MzTabModification > &entries)
Definition: MzTab.h:1084
std::vector< MzTabParameter > ms_file_id_format
Definition: MzTab.h:1237
MzTabString accession
Definition: MzTab.h:1260
String toCellString() const
Definition: MzTab.h:243
bool isInf() const
Definition: MzTab.h:140
std::map< String, MzTabSmallMoleculeSectionRows > MzTabSmallMoleculeSectionData
Definition: MzTab.h:1347
MzTabModificationList modifications
Definition: MzTab.h:1274
MzTabDouble mass_to_charge
Definition: MzTab.h:1299
MzTabNullAbleBase()
Definition: MzTab.h:91
std::vector< MzTabSubIdMetaData > sub_id_data
Definition: MzTab.h:1239
Int toInt() const
Conversion to int.
String accession_
Definition: MzTab.h:642
String getSpecRef() const
Definition: MzTab.h:1135
MzTabString species
Definition: MzTab.h:1320
Definition: MzTab.h:728
MzTabString title
Definition: MzTab.h:1215
std::vector< MzTabParameter > software
Definition: MzTab.h:1222
void setNull(bool b)
Definition: MzTab.h:748
const MzTabProteinSectionData & getProteinSectionData() const
Definition: MzTab.h:1374
std::vector< MzTabParameter > instrument_source
Definition: MzTab.h:1219
String spec_ref_
Definition: MzTab.h:1193
bool value_
Definition: MzTab.h:428
std::vector< MzTabParameter > custom
Definition: MzTab.h:1208
Definition: MzTab.h:66
void setPositionsAndParameters(const std::vector< std::pair< Int, MzTabParameter > > &ppp)
Definition: MzTab.h:835
MzTabInteger reliability
Definition: MzTab.h:1269
std::vector< MzTabDouble > protein_abundance_std_error_sub
Definition: MzTab.h:1280
void fromCellString(const String &s)
Definition: MzTab.h:999
void setPeptideSectionData(const MzTabPeptideSectionData &psd)
Definition: MzTab.h:1389
String & toLower()
Converts the string to lowercase.
String toCellString() const
Definition: MzTab.h:1156
bool hasSubstring(const String &string) const
true if String contains the string, false otherwise
DoubleReal value_
Definition: MzTab.h:219
MzTabString description
Definition: MzTab.h:1262
String & trim()
removes whitespaces (space, tab, line feed, carriage return) at the beginning and the end of the stri...
MzTabDouble charge
Definition: MzTab.h:1298
std::vector< MzTabDouble > entries_
Definition: MzTab.h:297
void set(const std::vector< MzTabDouble > &entries)
Definition: MzTab.h:291
MzTabInteger taxid
Definition: MzTab.h:1319
MzTabString description
Definition: MzTab.h:1216
Size getMSFile() const
Definition: MzTab.h:1141
const MzTabMetaData & getMetaData() const
Definition: MzTab.h:1364
void setName(const String &name)
Definition: MzTab.h:518
String toCellString() const
Definition: MzTab.h:552
bool isNull() const
Definition: MzTab.h:820
MzTabDoubleList retention_time
Definition: MzTab.h:1297
std::vector< MzTabString > contact_email
Definition: MzTab.h:1228
std::vector< MzTabParameter > parameters_
Definition: MzTab.h:725
MzTabDouble mass_to_charge
Definition: MzTab.h:1316
void set(const std::vector< MzTabString > &entries)
Definition: MzTab.h:805
Definition: MzTab.h:222
std::vector< MzTabParameter > instrument_name
Definition: MzTab.h:1218
std::vector< String > getSmallMoleculeOptionalColumnNames() const
Definition: MzTab.h:1445
std::vector< MzTabDouble > smallmolecule_abundance_std_error_sub
Definition: MzTab.h:1331
void set(const Int &value)
Definition: MzTab.h:304
std::vector< MzTabDouble > peptide_abundance_sub
Definition: MzTab.h:1302
void setSeparator(char sep)
Definition: MzTab.h:738
MzTabString species
Definition: MzTab.h:1264
const MzTabPeptideSectionData & getPeptideSectionData() const
Definition: MzTab.h:1384
MzTabDouble protein_coverage
Definition: MzTab.h:1277
MzTabModificationList modifications
Definition: MzTab.h:1296
Size ms_file_
Definition: MzTab.h:1192
void fromCellString(const String &s)
Definition: MzTab.h:402
String toCellString() const
Definition: MzTab.h:756
MzTabStringList go_terms
Definition: MzTab.h:1276
Invalid conversion exception.
Definition: Exception.h:363
void fromCellString(const String &s)
Definition: MzTab.h:576
std::vector< MzTabPeptideSectionRow > MzTabPeptideSectionRows
Definition: MzTab.h:1337
void setModOrSubstIdentifier(const MzTabString &mod_id)
Definition: MzTab.h:845
bool isNull() const
Definition: MzTab.h:965
String toCellString() const
Definition: MzTab.h:177
std::vector< MzTabString > description
Definition: MzTab.h:1206
String getValue() const
Definition: MzTab.h:546
MzTabMetaData map_unitid_to_meta_data_
Definition: MzTab.h:1465
MzTabStringList ambiguity_members
Definition: MzTab.h:1273
void setProteinSectionData(const MzTabProteinSectionData &psd)
Definition: MzTab.h:1379
void setNull(bool b)
Definition: MzTab.h:101
bool isNull() const
Definition: MzTab.h:492
std::vector< MzTabString > contact_name
Definition: MzTab.h:1226
MzTabParameterList search_engine_score
Definition: MzTab.h:1327
Definition: MzTab.h:59
Definition: MzTab.h:154
std::vector< MzTabDouble > smallmolecule_abundance_sub
Definition: MzTab.h:1329
MzTabModificationList modifications
Definition: MzTab.h:1328
bool isNull() const
Definition: MzTab.h:743
std::map< String, MzTabPeptideSectionRows > MzTabPeptideSectionData
Definition: MzTab.h:1345
String toCellString() const
Definition: MzTab.h:664
void setMSFile(Size index)
Definition: MzTab.h:1117
std::vector< String > colunit_small_molecule
Definition: MzTab.h:1245
Definition: MzTab.h:1199
MzTabInteger num_peptides
Definition: MzTab.h:1270
MzTabStringList()
Definition: MzTab.h:732
Definition: MzTab.h:87
MzTabParameterList search_engine
Definition: MzTab.h:1326
Definition: MzTab.h:1285
String toCellString() const
Definition: MzTab.h:323
std::vector< MzTabParameter > instrument_analyzer
Definition: MzTab.h:1220
Definition: MzTab.h:61
MzTabParameter small_molecule_quantification_unit
Definition: MzTab.h:1234
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:144
std::vector< MzTabString > uri
Definition: MzTab.h:1229
void set(const bool &value)
Definition: MzTab.h:372
String & substitute(char from, char to)
Replaces all occurences of the character from by the character to.
bool null_
Definition: MzTab.h:107
void set(const std::vector< MzTabParameter > &parameters)
Definition: MzTab.h:719
String name_
Definition: MzTab.h:643
virtual void setNull(bool b)=0
void setInf()
Definition: MzTab.h:145
MzTabString database
Definition: MzTab.h:1321
std::vector< String > colunit_protein
Definition: MzTab.h:1243
void fromCellString(const String &s)
Definition: MzTab.h:903
MzTabInteger num_peptides_unambiguous
Definition: MzTab.h:1272
std::vector< MzTabStringList > publication
Definition: MzTab.h:1225
MzTabString uri
Definition: MzTab.h:1300
void setMetaData(const MzTabMetaData &md)
Definition: MzTab.h:1369
virtual void fromCellString(const String &)=0
std::vector< String > getProteinOptionalColumnNames() const
Definition: MzTab.h:1405
std::vector< std::pair< Int, MzTabParameter > > getPositionsAndParameters() const
Definition: MzTab.h:840
MzTabParameter peptide_quantification_unit
Definition: MzTab.h:1233
std::vector< String > colunit_peptide
Definition: MzTab.h:1244
std::vector< MzTabString > entries_
Definition: MzTab.h:811
MzTabInteger reliability
Definition: MzTab.h:1323
MzTabParameterList search_engine_score
Definition: MzTab.h:1268
bool isNull() const
Definition: MzTab.h:454
void setSpecRef(String spec_ref)
Definition: MzTab.h:1126
std::vector< MzTabString > contact_affiliation
Definition: MzTab.h:1227
MzTabInteger taxid
Definition: MzTab.h:1263
bool isNull() const
Definition: MzTab.h:120
void setNull(bool b)
Definition: MzTab.h:459
void fromCellString(const String &s)
Definition: MzTab.h:685
bool isNull() const
Definition: MzTab.h:230
std::vector< MzTabOptionalColumnEntry > opt_
Definition: MzTab.h:1281
void fromCellString(const String &s)
Definition: MzTab.h:1168
MzTabString database_version
Definition: MzTab.h:1322
MzTabString chemical_formula
Definition: MzTab.h:1312
MzTabString database_version
Definition: MzTab.h:1292
Definition: MzTab.h:1309
Definition: MzTab.h:961
void fromCellString(const String &s)
Definition: MzTab.h:342
int Int
Signed integer type.
Definition: Types.h:100
MzTabDouble charge
Definition: MzTab.h:1317
void setNull(bool b)
Definition: MzTab.h:497
void setAccession(const String &accession)
Definition: MzTab.h:513
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const
Splits a string into substrings using splitter as delimiter.
std::vector< MzTabParameterList > sample_processing
Definition: MzTab.h:1217
Definition: MzTab.h:300
void setNull(bool b)
Definition: MzTab.h:970
String value_
Definition: MzTab.h:644
void setNaN()
Definition: MzTab.h:135
std::vector< std::pair< Int, MzTabParameter > > pos_param_pairs_
Definition: MzTab.h:957
String toCellString() const
Definition: MzTab.h:383
std::vector< MzTabParameter > ms_file_location
Definition: MzTab.h:1236
void setSmallMoleculeSectionData(const MzTabSmallMoleculeSectionData &smsd)
Definition: MzTab.h:1399
std::vector< MzTabParameter > tissue
Definition: MzTab.h:1203
MzTabInteger num_peptides_distinct
Definition: MzTab.h:1271
MzTabString smiles
Definition: MzTab.h:1313
MzTabDoubleList()
Definition: MzTab.h:226
MzTabParameterList false_discovery_rate
Definition: MzTab.h:1224
std::pair< String, MzTabString > MzTabOptionalColumnEntry
Definition: MzTab.h:1248
Definition: MzTab.h:58
Data model of MzTab files. Please see the official MzTab specification at https://code.google.com/p/mztab/.
Definition: MzTab.h:1355
MzTabNullNaNAndInfAbleBase()
Definition: MzTab.h:115
void setNull(bool b)
Definition: MzTab.h:656

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:18 using doxygen 1.8.5