ProteoWizard
Main Page
Namespaces
Classes
Files
File List
File Members
pwiz
data
common
obo.hpp
Go to the documentation of this file.
1
//
2
// $Id: obo.hpp 2778 2011-06-14 16:08:39Z chambm $
3
//
4
//
5
// Original author: Darren Kessner <darren@proteowizard.org>
6
//
7
// Copyright 2007 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
#ifndef _OBO_HPP_
25
#define _OBO_HPP_
26
27
28
#include "
pwiz/utility/misc/Export.hpp
"
29
#include <vector>
30
#include <set>
31
#include <map>
32
#include <string>
33
#include <limits>
34
35
36
namespace
pwiz {
37
namespace
data {
38
39
40
/// a single controlled vocabulary term
41
struct
PWIZ_API_DECL
Term
42
{
43
typedef
unsigned
int
id_type
;
44
typedef
std::vector<id_type>
id_list
;
45
typedef
std::multimap<std::string, std::pair<std::string, id_type> >
relation_map
;
46
const
static
id_type
MAX_ID
;
47
48
std::string
prefix
;
49
id_type
id
;
50
std::string
name
;
51
std::string
def
;
52
id_list
parentsIsA
;
53
id_list
parentsPartOf
;
54
relation_map
relations
;
// other than is_a and part_of
55
std::multimap<std::string, std::string>
propertyValues
;
56
std::vector<std::string>
exactSynonyms
;
57
bool
isObsolete
;
58
59
Term
(
id_type
id
= MAX_ID)
60
: id(id), isObsolete(false)
61
{}
62
63
bool
operator< (
const
Term
& rhs)
const
{
return
id
< rhs.
id
;}
64
};
65
66
67
///
68
/// Represents a selectively parsed OBO file.
69
///
70
/// Note that the following are currently ignored during parsing:
71
/// - comments
72
/// - dbxrefs
73
/// - synonym tags other than exact_synonym
74
/// - non-Term stanzas
75
///
76
struct
PWIZ_API_DECL
OBO
77
{
78
std::string
filename
;
79
std::vector<std::string>
header
;
80
std::string
prefix
;
// e.g. "MS", "UO"
81
std::set<Term>
terms
;
82
83
OBO
(){}
84
OBO
(
const
std::string& filename);
85
};
86
87
88
PWIZ_API_DECL
std::ostream&
operator<<
(std::ostream& os,
const
Term& term);
89
PWIZ_API_DECL
std::ostream&
operator<<
(std::ostream& os,
const
OBO& obo);
90
91
92
}
// namespace data
93
}
// namespace pwiz
94
95
96
#endif // _OBO_HPP_
97
98
Generated on Mon Nov 26 2012 18:05:47 for ProteoWizard by
1.8.1.1