26 #include <boost/filesystem/operations.hpp> 39 "format-version: 1.0\n" 40 "date: 01:10:2007 23:46\n" 42 "auto-generated-by: OBO-Edit 1.101\n" 43 "default-namespace: PSI-MS\n" 47 "name: MZ controlled vocabularies\t\n" 48 "def: \"MZ controlled vocabularies.\" [PSI:MS]\t\n" 52 "name: sample number\r\n" 53 "def: \"A reference number relevant to the sample under study.\" [PSI:MS]\r\n" 54 "relationship: part_of MS:1000548 ! sample attribute\r\n" 58 "name: mass resolution\n" 59 "def: \"The maximum m/z value at which two peaks can be resolved, according to one of the standard measures.\" [PSI:MS]\n" 60 "is_a: MS:1000503 ! scan attribute\n" 64 "name: magnetic field strength\n" 65 "def: \"A property of space that produces a force on a charged particle equal to qv x B where q is the particle charge and v its velocity.\" [PSI:MS]\n" 66 "related_synonym: \"Magnetic Field\" []\n" 67 "exact_synonym: \"B\" []\n" 68 "is_a: MS:1000480 ! mass analyzer attribute\n" 73 "def: \"Name of instrument vendor, replaced by MS:1000031 Model From Vendor.\" [PSI:MS]\n" 78 "name: obsolete by definition\n" 79 "def: \"OBSOLETE description\" [PSI:MS]\n" 83 "name: (?<=R)(?\\!P)\n" 88 "def: \"Accuracy is the degree of conformity of a measured mass to its actual value.\" [PSI:MS]\n" 89 "xref: value-type:xsd\\:float \"The allowed value-type for this CV term.\"\n" 90 "is_a: MS:1000480 ! mass analyzer attribute\n" 91 "relationship: has_units MS:1000040 ! m/z\n" 92 "relationship: has_units UO:0000169 ! parts per million\n" 97 "is_a: MS:1001045 ! cleavage agent name\n" 98 "relationship: has_regexp MS:1001272 ! (?<=R)(?!P)\n" 103 "name: magnetic field strength\n" 104 "def: \"A property of space that produces a force on a charged particle equal to qv x B where q is the particle charge and v its velocity.\" [PSI:MS]\n" 105 "synonym: \"B\" EXACT []\n" 106 "synonym: \"Magnetic Field\" RELATED []\n" 107 "is_a: MS:1000480 ! mass analyzer attribute\n" 112 "namespace: unit.ontology\n" 113 "def: \"description\" [ignore this Wikipedia:Wikipedia \"http://www.wikipedia.org/\"]\n" 117 "name: Label:2H(4)+GlyGly\n" 118 "def: \"Ubiquitination 2H4 lysine\" []\n" 119 "property_value: record_id=\"853\"\n" 120 "property_value: delta_mono_mass=\"118.068034\"\n" 121 "property_value: delta_avge_mass=\"118.1273\"\n" 122 "property_value: delta_composition=\"H(2) 2H(4) C(4) N(2) O(2)\"\n" 123 "property_value: spec_group1=\"1\"\n" 124 "property_value: spec_hidden_1=\"1\"\n" 125 "property_value: spec_site_1=\"K\"\n" 126 "property_value: spec_position_1=\"Anywhere\"\n" 127 "property_value: spec_classification_1=\"Post-translational\"\n" 128 "is_a: MS:0 ! unimod root node\n" 135 const string& filename =
"obotest_temp.txt";
136 ofstream temp(filename.c_str());
142 if (
os_) *
os_ << obo << endl;
149 set<Term>::const_iterator term = obo.
terms.begin();
152 unit_assert(term->name ==
"MZ controlled vocabularies");
153 unit_assert(term->def ==
"MZ controlled vocabularies.");
191 unit_assert(term->relations.begin()->first ==
"has_units");
192 unit_assert(term->relations.begin()->second.first ==
"MS");
193 unit_assert(term->relations.begin()->second.second == 1000040);
194 unit_assert(term->relations.rbegin()->second.first ==
"UO");
195 unit_assert(term->relations.rbegin()->second.second == 169);
201 unit_assert(term->relations.begin()->first ==
"has_regexp");
202 unit_assert(term->relations.begin()->second.first ==
"MS");
203 unit_assert(term->relations.begin()->second.second == 1001272);
220 unit_assert(term->def ==
"Ubiquitination 2H4 lysine");
222 unit_assert(term->propertyValues.find(
"record_id")->second ==
"853");
223 unit_assert(term->propertyValues.find(
"delta_mono_mass")->second ==
"118.068034");
224 unit_assert(term->propertyValues.find(
"delta_avge_mass")->second ==
"118.1273");
225 unit_assert(term->propertyValues.find(
"delta_composition")->second ==
"H(2) 2H(4) C(4) N(2) O(2)");
226 unit_assert(term->propertyValues.find(
"spec_classification_1")->second ==
"Post-translational");
228 boost::filesystem::remove(filename);
232 int main(
int argc,
char* argv[])
238 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
std::vector< std::string > header
int main(int argc, char *argv[])
Represents a selectively parsed OBO file.
#define TEST_PROLOG(argc, argv)