obo_parser 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/obo_parser.rb +17 -17
- data/obo_parser.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/lib/obo_parser.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# uses the PhyloTree parser/lexer engine by Krishna Dole which in turn was based on
|
3
2
|
# Thomas Mailund's <mailund@birc.dk> 'newick-1.0.5' Python library
|
4
3
|
|
@@ -37,7 +36,7 @@ module OboParser
|
|
37
36
|
|
38
37
|
class Stanza
|
39
38
|
# Make special reference to several specific types of tags (:name, :id), subclasses will remove additional special typs from :other_tags
|
40
|
-
attr_accessor :name, :id, :other_tags
|
39
|
+
attr_accessor :name, :id, :def, :other_tags
|
41
40
|
|
42
41
|
def initialize(tags)
|
43
42
|
@other_tags = []
|
@@ -56,6 +55,8 @@ module OboParser
|
|
56
55
|
@id = new_tag
|
57
56
|
when 'name'
|
58
57
|
@name = new_tag
|
58
|
+
when 'def'
|
59
|
+
@def = new_tag
|
59
60
|
else
|
60
61
|
@other_tags.push(new_tag)
|
61
62
|
end
|
@@ -75,24 +76,23 @@ module OboParser
|
|
75
76
|
|
76
77
|
end
|
77
78
|
|
79
|
+
# TODO: likely deprecate and run with one model (Stanza)
|
78
80
|
class Term < Stanza
|
79
|
-
|
81
|
+
# attr_accessor :some_term_specific_def
|
80
82
|
def initialize(tags)
|
81
83
|
super
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
end
|
95
|
-
@other_tags = anonymous_tags
|
84
|
+
# anonymous_tags = []
|
85
|
+
# # Loop through "unclaimed" tags and reference those specific to Term
|
86
|
+
# while @other_tags.size != 0
|
87
|
+
# t = @other_tags.shift
|
88
|
+
# case t.tag
|
89
|
+
# when 'def'
|
90
|
+
# @def = t
|
91
|
+
# else
|
92
|
+
# anonymous_tags.push(t)
|
93
|
+
# end
|
94
|
+
# end
|
95
|
+
# @other_tags = anonymous_tags
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
data/obo_parser.gemspec
CHANGED
metadata
CHANGED