bio 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. data/ChangeLog +1712 -0
  2. data/KNOWN_ISSUES.rdoc +11 -1
  3. data/README.rdoc +3 -2
  4. data/RELEASE_NOTES.rdoc +65 -127
  5. data/bioruby.gemspec +38 -2
  6. data/doc/RELEASE_NOTES-1.4.0.rdoc +167 -0
  7. data/doc/Tutorial.rd +74 -16
  8. data/doc/Tutorial.rd.html +68 -16
  9. data/lib/bio.rb +2 -0
  10. data/lib/bio/appl/clustalw/report.rb +18 -0
  11. data/lib/bio/appl/paml/codeml/report.rb +579 -21
  12. data/lib/bio/command.rb +149 -21
  13. data/lib/bio/db/aaindex.rb +11 -1
  14. data/lib/bio/db/embl/sptr.rb +1 -1
  15. data/lib/bio/db/fasta/defline.rb +7 -2
  16. data/lib/bio/db/fasta/qual.rb +24 -0
  17. data/lib/bio/db/fasta/qual_to_biosequence.rb +29 -0
  18. data/lib/bio/db/fastq.rb +15 -0
  19. data/lib/bio/db/go.rb +2 -2
  20. data/lib/bio/db/kegg/common.rb +109 -5
  21. data/lib/bio/db/kegg/genes.rb +61 -15
  22. data/lib/bio/db/kegg/genome.rb +43 -38
  23. data/lib/bio/db/kegg/module.rb +158 -0
  24. data/lib/bio/db/kegg/orthology.rb +40 -1
  25. data/lib/bio/db/kegg/pathway.rb +254 -0
  26. data/lib/bio/db/medline.rb +6 -2
  27. data/lib/bio/io/flatfile/autodetection.rb +6 -0
  28. data/lib/bio/location.rb +39 -0
  29. data/lib/bio/reference.rb +24 -0
  30. data/lib/bio/sequence.rb +2 -0
  31. data/lib/bio/sequence/adapter.rb +1 -0
  32. data/lib/bio/sequence/format.rb +14 -0
  33. data/lib/bio/sequence/sequence_masker.rb +95 -0
  34. data/lib/bio/tree.rb +4 -4
  35. data/lib/bio/util/restriction_enzyme/double_stranded/aligned_strands.rb +5 -0
  36. data/lib/bio/version.rb +1 -1
  37. data/setup.rb +5 -0
  38. data/test/data/KEGG/K02338.orthology +180 -52
  39. data/test/data/KEGG/M00118.module +44 -0
  40. data/test/data/KEGG/T00005.genome +140 -0
  41. data/test/data/KEGG/T00070.genome +34 -0
  42. data/test/data/KEGG/b0529.gene +47 -0
  43. data/test/data/KEGG/ec00072.pathway +23 -0
  44. data/test/data/KEGG/hsa00790.pathway +59 -0
  45. data/test/data/KEGG/ko00312.pathway +16 -0
  46. data/test/data/KEGG/map00030.pathway +37 -0
  47. data/test/data/KEGG/map00052.pathway +13 -0
  48. data/test/data/KEGG/rn00250.pathway +114 -0
  49. data/test/data/clustalw/example1.aln +58 -0
  50. data/test/data/go/selected_component.ontology +12 -0
  51. data/test/data/go/selected_gene_association.sgd +31 -0
  52. data/test/data/go/selected_wikipedia2go +13 -0
  53. data/test/data/medline/20146148_modified.medline +54 -0
  54. data/test/data/paml/codeml/models/aa.aln +26 -0
  55. data/test/data/paml/codeml/models/aa.dnd +13 -0
  56. data/test/data/paml/codeml/models/aa.ph +13 -0
  57. data/test/data/paml/codeml/models/alignment.phy +49 -0
  58. data/test/data/paml/codeml/models/results0-3.txt +312 -0
  59. data/test/data/paml/codeml/models/results7-8.txt +340 -0
  60. data/test/functional/bio/io/test_togows.rb +8 -8
  61. data/test/functional/bio/test_command.rb +7 -6
  62. data/test/unit/bio/appl/clustalw/test_report.rb +80 -0
  63. data/test/unit/bio/appl/paml/codeml/test_rates.rb +6 -6
  64. data/test/unit/bio/appl/paml/codeml/test_report.rb +231 -24
  65. data/test/unit/bio/appl/paml/codeml/test_report_single.rb +46 -0
  66. data/test/unit/bio/db/embl/test_sptr.rb +1 -1
  67. data/test/unit/bio/db/fasta/test_defline.rb +160 -0
  68. data/test/unit/bio/db/fasta/test_defline_misc.rb +490 -0
  69. data/test/unit/bio/db/kegg/test_genes.rb +281 -1
  70. data/test/unit/bio/db/kegg/test_genome.rb +408 -0
  71. data/test/unit/bio/db/kegg/test_module.rb +246 -0
  72. data/test/unit/bio/db/kegg/test_orthology.rb +95 -0
  73. data/test/unit/bio/db/kegg/test_pathway.rb +1250 -0
  74. data/test/unit/bio/db/test_aaindex.rb +8 -7
  75. data/test/unit/bio/db/test_fastq.rb +36 -0
  76. data/test/unit/bio/db/test_go.rb +171 -0
  77. data/test/unit/bio/db/test_medline.rb +148 -0
  78. data/test/unit/bio/db/test_qual.rb +9 -2
  79. data/test/unit/bio/sequence/test_sequence_masker.rb +169 -0
  80. data/test/unit/bio/test_tree.rb +260 -1
  81. data/test/unit/bio/util/test_contingency_table.rb +7 -7
  82. metadata +53 -6
@@ -0,0 +1,246 @@
1
+ #
2
+ # test/unit/bio/db/kegg/test_module.rb - Unit test for Bio::KEGG::MODULE
3
+ #
4
+ # Copyright:: Copyright (C) 2010 Kozo Nishida <kozo-ni@is.naist.jp>
5
+ # Copyright (C) 2010 Naohisa Goto <ng@bioruby.org>
6
+ # License:: The Ruby License
7
+
8
+ # loading helper routine for testing bioruby
9
+ require 'pathname'
10
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
11
+ 'bioruby_test_helper.rb')).cleanpath.to_s
12
+
13
+ # libraries needed for the tests
14
+ require 'test/unit'
15
+ require 'bio/db/kegg/module'
16
+
17
+ module Bio
18
+ class TestKeggModule < Test::Unit::TestCase
19
+
20
+ def setup
21
+ filename = File.join(BioRubyTestDataPath, 'KEGG/M00118.module')
22
+ entry = File.read(filename)
23
+ @obj = Bio::KEGG::MODULE.new(entry)
24
+ end
25
+
26
+ def test_new
27
+ assert_instance_of(Bio::KEGG::MODULE, @obj)
28
+ end
29
+
30
+ def test_entry_id
31
+ assert_equal('M00118', @obj.entry_id)
32
+ end
33
+
34
+ def test_name
35
+ assert_equal('Pentose interconversion, arabinose/ribulose/xylulose/xylose', @obj.name)
36
+ end
37
+
38
+ def test_definition
39
+ expected = "K00011 K01804 K00853 (K01786,K03080) K03331 K05351 K00854 K00011 K01805 K01783 (K00853,K00875) K00039"
40
+ assert_equal(expected, @obj.definition)
41
+ end
42
+
43
+ def test_keggclass
44
+ assert_equal('Metabolism; Central metabolism; Other carbohydrate metabolism', @obj.keggclass)
45
+ end
46
+
47
+ def test_pathways_as_strings
48
+ expected = ["ko00040(K00011+K01804+K00853+K01786+K03080+K03331+K05351+K00854+K00011+K01805+K01783+K00853+K00875+K00039) Pentose and glucuronate interconversions"]
49
+ assert_equal(expected, @obj.pathways_as_strings)
50
+ end
51
+
52
+ def test_pathways_as_hash
53
+ expected = { "ko00040(K00011+K01804+K00853+K01786+K03080+K03331+K05351+K00854+K00011+K01805+K01783+K00853+K00875+K00039)" =>
54
+ "Pentose and glucuronate interconversions" }
55
+ assert_equal(expected, @obj.pathways_as_hash)
56
+ end
57
+
58
+ def test_pathways
59
+ expected = { "ko00040(K00011+K01804+K00853+K01786+K03080+K03331+K05351+K00854+K00011+K01805+K01783+K00853+K00875+K00039)" =>
60
+ "Pentose and glucuronate interconversions" }
61
+ assert_equal(expected, @obj.pathways)
62
+ end
63
+
64
+ def test_orthologs_as_strings
65
+ expected =
66
+ [ "K00011 aldehyde reductase [EC:1.1.1.21] [RN:R01758 R01759]",
67
+ "K01804 L-arabinose isomerase [EC:5.3.1.4] [RN:R01761]",
68
+ "K00853 L-ribulokinase [EC:2.7.1.16] [RN:R02439]",
69
+ "K01786,K03080 L-ribulose-5-phosphate 4-epimerase [EC:5.1.3.4] [RN:R05850]",
70
+ "K03331 L-xylulose reductase [EC:1.1.1.10] [RN:R01904]",
71
+ "K05351 D-xylulose reductase [EC:1.1.1.9] [RN:R01896]",
72
+ "K00854 xylulokinase [EC:2.7.1.17] [RN:R01639]",
73
+ "K00011 aldehyde reductase [EC:1.1.1.21] [RN:R01431]",
74
+ "K01805 xylose isomerase [EC:5.3.1.5] [RN:R01432]",
75
+ "K01783 ribulose-phosphate 3-epimerase [EC:5.1.3.1] [RN:R01529]",
76
+ "K00853,K00875 ribulokinase [EC:2.7.1.16 2.7.1.47] [RN:R01526]",
77
+ "K00039 ribitol 2-dehydrogenase [EC:1.1.1.56] [RN:R01895]"
78
+ ]
79
+ assert_equal(expected, @obj.orthologs_as_strings)
80
+ end
81
+
82
+ def test_orthologs_as_hash
83
+ expected = {
84
+ "K00039" => "ribitol 2-dehydrogenase [EC:1.1.1.56] [RN:R01895]",
85
+ "K00853" => "L-ribulokinase [EC:2.7.1.16] [RN:R02439]",
86
+ "K00854" => "xylulokinase [EC:2.7.1.17] [RN:R01639]",
87
+ "K05351" => "D-xylulose reductase [EC:1.1.1.9] [RN:R01896]",
88
+ "K00853,K00875" => "ribulokinase [EC:2.7.1.16 2.7.1.47] [RN:R01526]",
89
+ "K03331" => "L-xylulose reductase [EC:1.1.1.10] [RN:R01904]",
90
+ "K00011" => "aldehyde reductase [EC:1.1.1.21] [RN:R01431]",
91
+ "K01786,K03080" =>
92
+ "L-ribulose-5-phosphate 4-epimerase [EC:5.1.3.4] [RN:R05850]",
93
+ "K01804" => "L-arabinose isomerase [EC:5.3.1.4] [RN:R01761]",
94
+ "K01783" => "ribulose-phosphate 3-epimerase [EC:5.1.3.1] [RN:R01529]",
95
+ "K01805" => "xylose isomerase [EC:5.3.1.5] [RN:R01432]"
96
+ }
97
+ assert_equal(expected, @obj.orthologs_as_hash)
98
+ end
99
+
100
+ def test_orthologs
101
+ expected = {
102
+ "K00039" => "ribitol 2-dehydrogenase [EC:1.1.1.56] [RN:R01895]",
103
+ "K00853" => "L-ribulokinase [EC:2.7.1.16] [RN:R02439]",
104
+ "K00854" => "xylulokinase [EC:2.7.1.17] [RN:R01639]",
105
+ "K05351" => "D-xylulose reductase [EC:1.1.1.9] [RN:R01896]",
106
+ "K00853,K00875" => "ribulokinase [EC:2.7.1.16 2.7.1.47] [RN:R01526]",
107
+ "K03331" => "L-xylulose reductase [EC:1.1.1.10] [RN:R01904]",
108
+ "K00011" => "aldehyde reductase [EC:1.1.1.21] [RN:R01431]",
109
+ "K01786,K03080" =>
110
+ "L-ribulose-5-phosphate 4-epimerase [EC:5.1.3.4] [RN:R05850]",
111
+ "K01804" => "L-arabinose isomerase [EC:5.3.1.4] [RN:R01761]",
112
+ "K01783" => "ribulose-phosphate 3-epimerase [EC:5.1.3.1] [RN:R01529]",
113
+ "K01805" => "xylose isomerase [EC:5.3.1.5] [RN:R01432]"
114
+ }
115
+ assert_equal(expected, @obj.orthologs)
116
+ end
117
+
118
+ def test_orthologs_as_array
119
+ expected =
120
+ [ "K00011",
121
+ "K00039",
122
+ "K00853",
123
+ "K00854",
124
+ "K00875",
125
+ "K01783",
126
+ "K01786",
127
+ "K01804",
128
+ "K01805",
129
+ "K03080",
130
+ "K03331",
131
+ "K05351"
132
+ ]
133
+ assert_equal(expected, @obj.orthologs_as_array)
134
+ end
135
+
136
+ def test_reactions_as_strings
137
+ expected = [ "R01903 C00312 -> C00532",
138
+ "R01758,R01759 C00532 -> C00259",
139
+ "R01761 C00259 -> C00508",
140
+ "R02439 C00508 -> C01101",
141
+ "R05850 C01101 -> C00231",
142
+ "R01904 C00312 -> C00379",
143
+ "R01896 C00379 -> C00310",
144
+ "R01639 C00310 -> C00231",
145
+ "R01431 C00379 -> C00181",
146
+ "R01432 C00181 -> C00310",
147
+ "R01529 C00199 -> C00231",
148
+ "R01526 C00231 -> C00309",
149
+ "R01895 C00309 -> C00474"
150
+ ]
151
+ assert_equal(expected, @obj.reactions_as_strings)
152
+ end
153
+
154
+ def test_reactions_as_hash
155
+ expected = {
156
+ "R01529" => "C00199 -> C00231",
157
+ "R01431" => "C00379 -> C00181",
158
+ "R01639" => "C00310 -> C00231",
159
+ "R01761" => "C00259 -> C00508",
160
+ "R01903" => "C00312 -> C00532",
161
+ "R01904" => "C00312 -> C00379",
162
+ "R01432" => "C00181 -> C00310",
163
+ "R01758,R01759" => "C00532 -> C00259",
164
+ "R01895" => "C00309 -> C00474",
165
+ "R01896" => "C00379 -> C00310",
166
+ "R02439" => "C00508 -> C01101",
167
+ "R05850" => "C01101 -> C00231",
168
+ "R01526" => "C00231 -> C00309"
169
+ }
170
+ assert_equal(expected, @obj.reactions_as_hash)
171
+ end
172
+
173
+ def test_reactions
174
+ expected = {
175
+ "R01529" => "C00199 -> C00231",
176
+ "R01431" => "C00379 -> C00181",
177
+ "R01639" => "C00310 -> C00231",
178
+ "R01761" => "C00259 -> C00508",
179
+ "R01903" => "C00312 -> C00532",
180
+ "R01904" => "C00312 -> C00379",
181
+ "R01432" => "C00181 -> C00310",
182
+ "R01758,R01759" => "C00532 -> C00259",
183
+ "R01895" => "C00309 -> C00474",
184
+ "R01896" => "C00379 -> C00310",
185
+ "R02439" => "C00508 -> C01101",
186
+ "R05850" => "C01101 -> C00231",
187
+ "R01526" => "C00231 -> C00309"
188
+ }
189
+ assert_equal(expected, @obj.reactions)
190
+ end
191
+
192
+ def test_compounds_as_strings
193
+ expected = [ "C00312 L-Xylulose",
194
+ "C00532 L-Arabitol",
195
+ "C00259 L-Arabinose",
196
+ "C00508 L-Ribulose",
197
+ "C01101 L-Ribulose 5-phosphate",
198
+ "C00231 D-Xylulose 5-phosphate",
199
+ "C00379 Xylitol",
200
+ "C00310 D-Xylulose",
201
+ "C00181 D-Xylose",
202
+ "C00199 D-Ribulose 5-phosphate",
203
+ "C00309 D-Ribulose",
204
+ "C00474 Ribitol"
205
+ ]
206
+ assert_equal(expected, @obj.compounds_as_strings)
207
+ end
208
+
209
+ def test_compounds_as_hash
210
+ expected = {
211
+ "C00231" => "D-Xylulose 5-phosphate",
212
+ "C00474" => "Ribitol",
213
+ "C00309" => "D-Ribulose",
214
+ "C00199" => "D-Ribulose 5-phosphate",
215
+ "C01101" => "L-Ribulose 5-phosphate",
216
+ "C00310" => "D-Xylulose",
217
+ "C00508" => "L-Ribulose",
218
+ "C00532" => "L-Arabitol",
219
+ "C00312" => "L-Xylulose",
220
+ "C00181" => "D-Xylose",
221
+ "C00379" => "Xylitol",
222
+ "C00259" => "L-Arabinose"
223
+ }
224
+ assert_equal(expected, @obj.compounds_as_hash)
225
+ end
226
+
227
+ def test_compounds
228
+ expected = {
229
+ "C00231" => "D-Xylulose 5-phosphate",
230
+ "C00474" => "Ribitol",
231
+ "C00309" => "D-Ribulose",
232
+ "C00199" => "D-Ribulose 5-phosphate",
233
+ "C01101" => "L-Ribulose 5-phosphate",
234
+ "C00310" => "D-Xylulose",
235
+ "C00508" => "L-Ribulose",
236
+ "C00532" => "L-Arabitol",
237
+ "C00312" => "L-Xylulose",
238
+ "C00181" => "D-Xylose",
239
+ "C00379" => "Xylitol",
240
+ "C00259" => "L-Arabinose"
241
+ }
242
+ assert_equal(expected, @obj.compounds)
243
+ end
244
+
245
+ end
246
+ end
@@ -11,6 +11,7 @@ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
11
11
 
12
12
  # libraries needed for the tests
13
13
  require 'test/unit'
14
+ require 'bio/reference'
14
15
  require 'bio/db/kegg/orthology'
15
16
 
16
17
  module Bio
@@ -42,8 +43,102 @@ module Bio
42
43
  assert_equal({"COG"=>["COG0592"], "RN"=>["R00375", "R00376", "R00377", "R00378"], "GO"=>["0003887"]}, @obj.dblinks_as_hash)
43
44
  end
44
45
 
46
+ def test_dblinks
47
+ expected = {
48
+ "COG" => ["COG0592"],
49
+ "RN" => ["R00375", "R00376", "R00377", "R00378"],
50
+ "GO" => ["0003887"]
51
+ }
52
+ assert_equal(expected, @obj.dblinks)
53
+ end
54
+
45
55
  def test_genes_as_hash
56
+ assert_equal(1000, @obj.genes_as_hash.size)
46
57
  assert_equal(["BSU00020"], @obj.genes_as_hash["bsu"])
58
+ assert_equal(["SynWH7803_0001"], @obj.genes_as_hash["syx"])
59
+ end
60
+
61
+ def test_modules_as_hash
62
+ expected = {"M00597"=>"DNA polymerase III complex"}
63
+ assert_equal(expected, @obj.modules_as_hash)
64
+ end
65
+
66
+ def test_modules
67
+ expected = {"M00597"=>"DNA polymerase III complex"}
68
+ assert_equal(expected, @obj.modules)
69
+ end
70
+
71
+ def test_references
72
+ data =
73
+ [ { "authors" => [ "Stillman B." ],
74
+ "journal" => "Cell",
75
+ "pages" => "725-8",
76
+ "pubmed" => "8087839",
77
+ "title" => "Smart machines at the DNA replication fork.",
78
+ "volume" => "78",
79
+ "year" => "1994"
80
+ } ]
81
+ expected = data.collect { |h| Bio::Reference.new(h) }
82
+ assert_equal(expected, @obj.references)
83
+ end
84
+
85
+ def test_keggclass
86
+ expected = "Metabolism; Nucleotide Metabolism; Purine metabolism [PATH:ko00230] Metabolism; Nucleotide Metabolism; Pyrimidine metabolism [PATH:ko00240] Genetic Information Processing; Replication and Repair; DNA replication [PATH:ko03030] Genetic Information Processing; Replication and Repair; DNA replication proteins [BR:ko03032] Genetic Information Processing; Replication and Repair; Mismatch repair [PATH:ko03430] Genetic Information Processing; Replication and Repair; Homologous recombination [PATH:ko03440] Genetic Information Processing; Replication and Repair; DNA repair and recombination proteins [BR:ko03400]"
87
+ assert_equal(expected, @obj.keggclass)
88
+ end
89
+
90
+ def test_keggclasses
91
+ expected =
92
+ [ "Metabolism; Nucleotide Metabolism; Purine metabolism",
93
+ "Metabolism; Nucleotide Metabolism; Pyrimidine metabolism",
94
+ "Genetic Information Processing; Replication and Repair; DNA replication",
95
+ "Genetic Information Processing; Replication and Repair; DNA replication proteins",
96
+ "Genetic Information Processing; Replication and Repair; Mismatch repair",
97
+ "Genetic Information Processing; Replication and Repair; Homologous recombination",
98
+ "Genetic Information Processing; Replication and Repair; DNA repair and recombination proteins"
99
+ ]
100
+ assert_equal(expected, @obj.keggclasses)
101
+ end
102
+
103
+ def test_pathways_as_strings
104
+ expected = ["ko00230 Purine metabolism",
105
+ "ko00240 Pyrimidine metabolism",
106
+ "ko03030 DNA replication",
107
+ "ko03430 Mismatch repair",
108
+ "ko03440 Homologous recombination"]
109
+ assert_equal(expected, @obj.pathways_as_strings)
110
+ end
111
+
112
+ def test_pathways_in_keggclass
113
+ expected = ["ko00230", "ko00240", "ko03030", "ko03430", "ko03440"]
114
+ assert_equal(expected, @obj.pathways_in_keggclass)
115
+ end
116
+
117
+ def test_modules_as_strings
118
+ expected = ["M00597 DNA polymerase III complex"]
119
+ assert_equal(expected, @obj.modules_as_strings)
120
+ end
121
+
122
+ def test_dblinks_as_strings
123
+ expected = [ "RN: R00375 R00376 R00377 R00378",
124
+ "COG: COG0592", "GO: 0003887" ]
125
+ assert_equal(expected, @obj.dblinks_as_strings)
126
+ end
127
+
128
+ def test_genes_as_strings
129
+ assert_equal(1000, @obj.genes_as_strings.size)
130
+ assert_equal("ECO: b3701(dnaN)", @obj.genes_as_strings[0])
131
+ assert_equal("BPN: BPEN_015(dnaN)", @obj.genes_as_strings[100])
132
+ assert_equal("SVO: SVI_0032(dnaN)", @obj.genes_as_strings[200])
133
+ assert_equal("RFR: Rfer_0002 Rfer_4311", @obj.genes_as_strings[300])
134
+ assert_equal("OTS: OTBS_0002(dnaN)", @obj.genes_as_strings[400])
135
+ assert_equal("ACR: Acry_1437", @obj.genes_as_strings[500])
136
+ assert_equal("SPD: SPD_0002(dnaN)", @obj.genes_as_strings[600])
137
+ assert_equal("TEX: Teth514_0002", @obj.genes_as_strings[700])
138
+ assert_equal("FAL: FRAAL0004(dnaN) FRAAL1257",
139
+ @obj.genes_as_strings[800])
140
+ assert_equal("AMU: Amuc_0816", @obj.genes_as_strings[900])
141
+ assert_equal("DAP: Dacet_2869", @obj.genes_as_strings[-1])
47
142
  end
48
143
 
49
144
  end
@@ -0,0 +1,1250 @@
1
+ #
2
+ # test/unit/bio/db/kegg/test_pathway.rb - Unit test for Bio::KEGG::PATHWAY
3
+ #
4
+ # Copyright:: Copyright (C) 2010 Kozo Nishida <kozo-ni@is.naist.jp>
5
+ # Copyright (C) 2010 Naohisa Goto <ng@bioruby.org>
6
+ # License:: The Ruby License
7
+
8
+ # loading helper routine for testing bioruby
9
+ require 'pathname'
10
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
11
+ 'bioruby_test_helper.rb')).cleanpath.to_s
12
+
13
+ # libraries needed for the tests
14
+ require 'test/unit'
15
+ require 'bio/db/kegg/pathway'
16
+
17
+ module Bio
18
+ class TestKeggPathway_map00052 < Test::Unit::TestCase
19
+
20
+ def setup
21
+ testdata_kegg = Pathname.new(File.join(BioRubyTestDataPath, 'KEGG')).cleanpath.to_s
22
+ entry = File.read(File.join(testdata_kegg, "map00052.pathway"))
23
+ @obj = Bio::KEGG::PATHWAY.new(entry)
24
+ end
25
+
26
+ def test_entry_id
27
+ assert_equal('map00052', @obj.entry_id)
28
+ end
29
+
30
+ def test_name
31
+ assert_equal('Galactose metabolism', @obj.name)
32
+ end
33
+
34
+ def test_keggclass
35
+ assert_equal('Metabolism; Carbohydrate Metabolism', @obj.keggclass)
36
+ end
37
+
38
+ def test_modules_as_hash
39
+ expected = {
40
+ "M00097"=>"UDP-glucose and UDP-galactose biosynthesis, Glc-1P/Gal-1P => UDP-Glc/UDP-Gal",
41
+ "M00614"=>"PTS system, N-acetylgalactosamine-specific II component",
42
+ "M00616"=>"PTS system, galactitol-specific II component",
43
+ "M00618"=>"PTS system, lactose-specific II component",
44
+ "M00624"=>"PTS system, galactosamine-specific II component"
45
+ }
46
+ assert_equal(expected, @obj.modules_as_hash)
47
+ assert_equal(expected, @obj.modules)
48
+ end
49
+
50
+ def test_modules_as_strings
51
+ expected =
52
+ [ "M00097 UDP-glucose and UDP-galactose biosynthesis, Glc-1P/Gal-1P => UDP-Glc/UDP-Gal",
53
+ "M00614 PTS system, N-acetylgalactosamine-specific II component",
54
+ "M00616 PTS system, galactitol-specific II component",
55
+ "M00618 PTS system, lactose-specific II component",
56
+ "M00624 PTS system, galactosamine-specific II component"
57
+ ]
58
+ assert_equal(expected, @obj.modules_as_strings)
59
+ end
60
+
61
+ def test_rel_pathways_as_strings
62
+ expected = [ "map00010 Glycolysis / Gluconeogenesis",
63
+ "map00040 Pentose and glucuronate interconversions",
64
+ "map00051 Fructose and mannose metabolism",
65
+ "map00520 Amino sugar and nucleotide sugar metabolism"
66
+ ]
67
+ assert_equal(expected, @obj.rel_pathways_as_strings)
68
+ end
69
+
70
+ def test_rel_pathways_as_hash
71
+ expected = {
72
+ "map00010"=>"Glycolysis / Gluconeogenesis",
73
+ "map00040"=>"Pentose and glucuronate interconversions",
74
+ "map00051"=>"Fructose and mannose metabolism",
75
+ "map00520"=>"Amino sugar and nucleotide sugar metabolism"
76
+ }
77
+ assert_equal(expected, @obj.rel_pathways_as_hash)
78
+ assert_equal(expected, @obj.rel_pathways)
79
+ end
80
+
81
+ def test_references
82
+ assert_equal([], @obj.references)
83
+ end
84
+
85
+ def test_dblinks_as_strings
86
+ assert_equal([], @obj.dblinks_as_strings)
87
+ end
88
+
89
+ def test_dblinks_as_hash
90
+ assert_equal({}, @obj.dblinks_as_hash)
91
+ end
92
+
93
+ def test_pathways_as_strings
94
+ expected = ["map00052 Galactose metabolism"]
95
+ assert_equal(expected, @obj.pathways_as_strings)
96
+ end
97
+
98
+ def test_pathways_as_hash
99
+ expected = {"map00052"=>"Galactose metabolism"}
100
+ assert_equal(expected, @obj.pathways_as_hash)
101
+ end
102
+
103
+ def test_orthologs_as_strings
104
+ assert_equal([], @obj.orthologs_as_strings)
105
+ end
106
+
107
+ def test_orthologs_as_hash
108
+ assert_equal({}, @obj.orthologs_as_hash)
109
+ end
110
+
111
+ def test_genes_as_strings
112
+ assert_equal([], @obj.genes_as_strings)
113
+ end
114
+
115
+ def test_genes_as_hash
116
+ assert_equal({}, @obj.genes_as_hash)
117
+ end
118
+
119
+ def test_diseases_as_strings
120
+ assert_equal([], @obj.diseases_as_strings)
121
+ end
122
+
123
+ def test_diseases_as_hash
124
+ assert_equal({}, @obj.diseases_as_hash)
125
+ end
126
+
127
+ def test_enzymes_as_strings
128
+ assert_equal([], @obj.enzymes_as_strings)
129
+ end
130
+
131
+ def test_reactions_as_strings
132
+ assert_equal([], @obj.reactions_as_strings)
133
+ end
134
+
135
+ def test_reactions_as_hash
136
+ assert_equal({}, @obj.reactions_as_hash)
137
+ end
138
+
139
+ def test_compounds_as_strings
140
+ assert_equal([], @obj.compounds_as_strings)
141
+ end
142
+
143
+ def test_compounds_as_hash
144
+ assert_equal({}, @obj.compounds_as_hash)
145
+ end
146
+
147
+ def test_description
148
+ assert_equal("", @obj.description)
149
+ end
150
+
151
+ def test_organism
152
+ assert_equal("", @obj.organism)
153
+ end
154
+
155
+ def test_ko_pathway
156
+ assert_equal("", @obj.ko_pathway)
157
+ end
158
+
159
+ end #class TestKeggPathway_map00052
160
+
161
+ class TestBioKEGGPATHWAY_map00030 < Test::Unit::TestCase
162
+
163
+ def setup
164
+ filename = File.join(BioRubyTestDataPath, 'KEGG/map00030.pathway')
165
+ @obj = Bio::KEGG::PATHWAY.new(File.read(filename))
166
+ end
167
+
168
+ def test_references
169
+ data =
170
+ [ { "authors" => [ "Nishizuka Y (ed)." ],
171
+ "comments" => [ "(map 3)" ],
172
+ "journal" => "Tokyo Kagaku Dojin",
173
+ "title" => "[Metabolic Maps] (In Japanese)",
174
+ "year" => "1980"
175
+ },
176
+ { "authors" => [ "Nishizuka Y", "Seyama Y", "Ikai A",
177
+ "Ishimura Y", "Kawaguchi A (eds)." ],
178
+ "comments" => [ "(map 4)" ],
179
+ "journal" => "Tokyo Kagaku Dojin",
180
+ "title"=>"[Cellular Functions and Metabolic Maps] (In Japanese)",
181
+ "year" => "1997"
182
+ },
183
+ { "authors" => [ "Michal G." ],
184
+ "journal" => "Wiley",
185
+ "title" => "Biochemical Pathways",
186
+ "year" => "1999"
187
+ },
188
+ { "authors" => [ "Hove-Jensen B", "Rosenkrantz TJ",
189
+ "Haldimann A", "Wanner BL." ],
190
+ "journal" => "J Bacteriol",
191
+ "pages" => "2793-801",
192
+ "pubmed" => "12700258",
193
+ "title" => "Escherichia coli phnN, encoding ribose 1,5-bisphosphokinase activity (phosphoribosyl diphosphate forming): dual role in phosphonate degradation and NAD biosynthesis pathways.",
194
+ "volume" => "185",
195
+ "year" => "2003"
196
+ }
197
+ ]
198
+ expected = data.collect { |h| Bio::Reference.new(h) }
199
+ assert_equal(expected, @obj.references)
200
+ end
201
+
202
+ def test_new
203
+ assert_instance_of(Bio::KEGG::PATHWAY, @obj)
204
+ end
205
+
206
+ def test_entry_id
207
+ assert_equal("map00030", @obj.entry_id)
208
+ end
209
+
210
+ def test_name
211
+ assert_equal("Pentose phosphate pathway", @obj.name)
212
+ end
213
+
214
+ def test_description
215
+ expected = "The pentose phosphate pathway is a process of glucose turnover that produces NADPH as reducing equivalents and pentoses as essential parts of nucleotides. There are two different phases in the pathway. One is irreversible oxidative phase in which glucose-6P is converted to ribulose-5P by oxidative decarboxylation, and NADPH is generated [MD:M00006]. The other is reversible non-oxidative phase in which phosphorylated sugars are interconverted to generate xylulose-5P, ribulose-5P, and ribose-5P [MD:M00007]. Phosphoribosyl pyrophosphate (PRPP) formed from ribose-5P [MD:M00005] is an activated compound used in the biosynthesis of histidine and purine/pyrimidine nucleotides. This pathway map also shows the Entner-Doudoroff pathway where 6-P-gluconate is dehydrated and then cleaved into pyruvate and glyceraldehyde-3P [MD:M00008]."
216
+ assert_equal(expected, @obj.description)
217
+ end
218
+
219
+ def test_keggclass
220
+ expected = "Metabolism; Carbohydrate Metabolism"
221
+ assert_equal(expected, @obj.keggclass)
222
+ end
223
+
224
+ def test_modules_as_strings
225
+ expected =
226
+ [ "M00004 Pentose phosphate pathway (Pentose phosphate cycle) [PATH:map00030]",
227
+ "M00005 PRPP biosynthesis, ribose 5P -> PRPP [PATH:map00030]",
228
+ "M00006 Pentose phosphate pathway, oxidative phase, glucose 6P => ribulose 5P [PATH:map00030]",
229
+ "M00007 Pentose phosphate pathway, non-oxidative phase, fructose 6P => ribose 5P [PATH:map00030]",
230
+ "M00008 Entner-Doudoroff pathway, glucose-6P => glyceraldehyde-3P + pyruvate [PATH:map00030]",
231
+ "M00680 Semi-phosphorylative Entner-Doudoroff pathway, gluconate => glyceraldehyde-3P + pyruvate [PATH:map00030]",
232
+ "M00681 Non-phosphorylative Entner-Doudoroff pathway, gluconate => glyceraldehyde + pyruvate [PATH:map00030]"
233
+ ]
234
+ assert_equal(expected, @obj.modules_as_strings)
235
+ end
236
+
237
+ def test_modules_as_hash
238
+ expected = {
239
+ "M00008" => "Entner-Doudoroff pathway, glucose-6P => glyceraldehyde-3P + pyruvate [PATH:map00030]",
240
+ "M00680" => "Semi-phosphorylative Entner-Doudoroff pathway, gluconate => glyceraldehyde-3P + pyruvate [PATH:map00030]",
241
+ "M00681" => "Non-phosphorylative Entner-Doudoroff pathway, gluconate => glyceraldehyde + pyruvate [PATH:map00030]",
242
+ "M00004" => "Pentose phosphate pathway (Pentose phosphate cycle) [PATH:map00030]",
243
+ "M00005" => "PRPP biosynthesis, ribose 5P -> PRPP [PATH:map00030]",
244
+ "M00006" => "Pentose phosphate pathway, oxidative phase, glucose 6P => ribulose 5P [PATH:map00030]",
245
+ "M00007" => "Pentose phosphate pathway, non-oxidative phase, fructose 6P => ribose 5P [PATH:map00030]"
246
+ }
247
+ assert_equal(expected, @obj.modules_as_hash)
248
+ assert_equal(expected, @obj.modules)
249
+ end
250
+
251
+ def test_rel_pathways_as_strings
252
+ expected = [ "map00010 Glycolysis / Gluconeogenesis",
253
+ "map00040 Pentose and glucuronate interconversions",
254
+ "map00230 Purine metabolism",
255
+ "map00240 Pyrimidine metabolism",
256
+ "map00340 Histidine metabolism" ]
257
+ assert_equal(expected, @obj.rel_pathways_as_strings)
258
+ end
259
+
260
+ def test_rel_pathways_as_hash
261
+ expected = {
262
+ "map00240" => "Pyrimidine metabolism",
263
+ "map00340" => "Histidine metabolism",
264
+ "map00230" => "Purine metabolism",
265
+ "map00010" => "Glycolysis / Gluconeogenesis",
266
+ "map00040" => "Pentose and glucuronate interconversions"
267
+ }
268
+ assert_equal(expected, @obj.rel_pathways_as_hash)
269
+ assert_equal(expected, @obj.rel_pathways)
270
+ end
271
+
272
+ def test_dblinks_as_strings
273
+ assert_equal(["GO: 0006098"], @obj.dblinks_as_strings)
274
+ end
275
+
276
+ def test_dblinks_as_hash
277
+ assert_equal({"GO"=>["0006098"]}, @obj.dblinks_as_hash)
278
+ end
279
+
280
+ def test_pathways_as_strings
281
+ expected = ["map00030 Pentose phosphate pathway"]
282
+ assert_equal(expected, @obj.pathways_as_strings)
283
+ end
284
+
285
+ def test_pathways_as_hash
286
+ expected = {"map00030"=>"Pentose phosphate pathway"}
287
+ assert_equal(expected, @obj.pathways_as_hash)
288
+ end
289
+
290
+ def test_orthologs_as_strings
291
+ assert_equal([], @obj.orthologs_as_strings)
292
+ end
293
+
294
+ def test_orthologs_as_hash
295
+ assert_equal({}, @obj.orthologs_as_hash)
296
+ end
297
+
298
+ def test_genes_as_strings
299
+ assert_equal([], @obj.genes_as_strings)
300
+ end
301
+
302
+ def test_genes_as_hash
303
+ assert_equal({}, @obj.genes_as_hash)
304
+ end
305
+
306
+ def test_diseases_as_strings
307
+ expected = ["H00196 Phosphoribosylpyrophosphate synthetase I superactivity"]
308
+ assert_equal(expected, @obj.diseases_as_strings)
309
+ end
310
+
311
+ def test_diseases_as_hash
312
+ expected = {"H00196"=>"Phosphoribosylpyrophosphate synthetase I superactivity"}
313
+ assert_equal(expected, @obj.diseases_as_hash)
314
+ end
315
+
316
+ def test_enzymes_as_strings
317
+ assert_equal([], @obj.enzymes_as_strings)
318
+ end
319
+
320
+ def test_reactions_as_strings
321
+ assert_equal([], @obj.reactions_as_strings)
322
+ end
323
+
324
+ def test_reactions_as_hash
325
+ assert_equal({}, @obj.reactions_as_hash)
326
+ end
327
+
328
+ def test_compounds_as_strings
329
+ assert_equal([], @obj.compounds_as_strings)
330
+ end
331
+
332
+ def test_compounds_as_hash
333
+ assert_equal({}, @obj.compounds_as_hash)
334
+ end
335
+
336
+ def test_organism
337
+ assert_equal("", @obj.organism)
338
+ end
339
+
340
+ def test_ko_pathway
341
+ assert_equal("ko00030", @obj.ko_pathway)
342
+ end
343
+
344
+ end #class TestBioKEGGPATHWAY
345
+
346
+ class TestBioKeggPathway_rn00250 < Test::Unit::TestCase
347
+
348
+ def setup
349
+ filename = File.join(BioRubyTestDataPath, 'KEGG', 'rn00250.pathway')
350
+ @obj = Bio::KEGG::PATHWAY.new(File.read(filename))
351
+ end
352
+
353
+ def test_dblinks_as_hash
354
+ expected = {"GO"=>["0006522", "0006531", "0006536"]}
355
+ assert_equal(expected, @obj.dblinks_as_hash)
356
+ end
357
+
358
+ def test_pathways_as_hash
359
+ expected = {"rn00250"=>"Alanine, aspartate and glutamate metabolism"}
360
+ assert_equal(expected, @obj.pathways_as_hash)
361
+ end
362
+
363
+ def test_orthologs_as_hash
364
+ assert_equal({}, @obj.orthologs_as_hash)
365
+ end
366
+
367
+ def test_genes_as_hash
368
+ assert_equal({}, @obj.genes_as_hash)
369
+ end
370
+
371
+ def test_references
372
+ data =
373
+ [ { "authors" => [ "Nishizuka Y", "Seyama Y", "Ikai A",
374
+ "Ishimura Y", "Kawaguchi A (eds)." ],
375
+ "journal" => "Tokyo Kagaku Dojin",
376
+ "title"=>"[Cellular Functions and Metabolic Maps] (In Japanese)",
377
+ "year" => "1997"
378
+ },
379
+ { "authors" => [ "Wu G" ],
380
+ "journal" => "J Nutr",
381
+ "pages" => "1249-52",
382
+ "pubmed" => "9687539",
383
+ "title" => "Intestinal mucosal amino acid catabolism.",
384
+ "volume" => "128",
385
+ "year" => "1998"
386
+ }
387
+ ]
388
+ expected = data.collect { |h| Bio::Reference.new(h) }
389
+ assert_equal(expected, @obj.references)
390
+ end
391
+
392
+ def test_modules_as_hash
393
+ expected = {
394
+ "M00019"=>
395
+ "Glutamate biosynthesis, oxoglutarete => glutamate (glutamate synthase) [PATH:rn00250]",
396
+ "M00021"=>
397
+ "Aspartate biosynthesis, oxaloacetate => aspartate [PATH:rn00250]",
398
+ "M00044"=>
399
+ "Aspartate degradation, aspartate => fumarate [PATH:rn00250]",
400
+ "M00022"=>
401
+ "Asparagine biosynthesis, aspartate => asparagine [PATH:rn00250]",
402
+ "M00045"=>
403
+ "Aspartate degradation, aspartate => oxaloacetate [PATH:rn00250]",
404
+ "M00046"=>
405
+ "Asparagine degradation, asparagine => aspartate +NH3 [PATH:rn00250]",
406
+ "M00026"=>
407
+ "Alanine biosynthesis, pyruvate => alanine [PATH:rn00250]",
408
+ "M00038"=>
409
+ "Glutamine degradation, glutamine => glutamate + NH3 [PATH:rn00250]",
410
+ "M00040"=>
411
+ "GABA (gamma-Aminobutyrate) shunt [PATH:rn00250]",
412
+ "M00017"=>
413
+ "Glutamate biosynthesis, oxoglutarate => glutamate (glutamate dehydrogenase) [PATH:rn00250]",
414
+ "M00018"=>
415
+ "Glutamine biosynthesis, glutamate => glutamine [PATH:rn00250]"
416
+ }
417
+ assert_equal(expected, @obj.modules_as_hash)
418
+ end
419
+
420
+ def test_new
421
+ assert_kind_of(Bio::KEGG::PATHWAY, @obj)
422
+ end
423
+
424
+ def test_entry_id
425
+ assert_equal("rn00250", @obj.entry_id)
426
+ end
427
+
428
+ def test_name
429
+ expected = "Alanine, aspartate and glutamate metabolism"
430
+ assert_equal(expected, @obj.name)
431
+ end
432
+
433
+ def test_description
434
+ assert_equal("", @obj.description)
435
+ end
436
+
437
+ def test_keggclass
438
+ expected = "Metabolism; Amino Acid Metabolism"
439
+ assert_equal(expected, @obj.keggclass)
440
+ end
441
+
442
+ def test_pathways_as_strings
443
+ expected = ["rn00250 Alanine, aspartate and glutamate metabolism"]
444
+ assert_equal(expected, @obj.pathways_as_strings)
445
+ end
446
+
447
+ def test_modules_as_strings
448
+ expected =
449
+ [ "M00017 Glutamate biosynthesis, oxoglutarate => glutamate (glutamate dehydrogenase) [PATH:rn00250]",
450
+ "M00018 Glutamine biosynthesis, glutamate => glutamine [PATH:rn00250]",
451
+ "M00019 Glutamate biosynthesis, oxoglutarete => glutamate (glutamate synthase) [PATH:rn00250]",
452
+ "M00021 Aspartate biosynthesis, oxaloacetate => aspartate [PATH:rn00250]",
453
+ "M00022 Asparagine biosynthesis, aspartate => asparagine [PATH:rn00250]",
454
+ "M00026 Alanine biosynthesis, pyruvate => alanine [PATH:rn00250]",
455
+ "M00038 Glutamine degradation, glutamine => glutamate + NH3 [PATH:rn00250]",
456
+ "M00040 GABA (gamma-Aminobutyrate) shunt [PATH:rn00250]",
457
+ "M00044 Aspartate degradation, aspartate => fumarate [PATH:rn00250]",
458
+ "M00045 Aspartate degradation, aspartate => oxaloacetate [PATH:rn00250]",
459
+ "M00046 Asparagine degradation, asparagine => aspartate +NH3 [PATH:rn00250]"
460
+ ]
461
+ assert_equal(expected, @obj.modules_as_strings)
462
+ end
463
+
464
+ def test_diseases_as_strings
465
+ expected = [ "H00074 Canavan disease (CD)",
466
+ "H00185 Citrullinemia (CTLN)",
467
+ "H00197 Adenylosuccinate lyase deficiency" ]
468
+ assert_equal(expected, @obj.diseases_as_strings)
469
+ end
470
+
471
+ def test_diseases_as_hash
472
+ expected = {
473
+ "H00197"=>"Adenylosuccinate lyase deficiency",
474
+ "H00074"=>"Canavan disease (CD)",
475
+ "H00185"=>"Citrullinemia (CTLN)"
476
+ }
477
+ assert_equal(expected, @obj.diseases_as_hash)
478
+ end
479
+
480
+ def test_dblinks_as_strings
481
+ expected = ["GO: 0006522 0006531 0006536"]
482
+ assert_equal(expected, @obj.dblinks_as_strings)
483
+ end
484
+
485
+ def test_orthologs_as_strings
486
+ assert_equal([], @obj.orthologs_as_strings)
487
+ end
488
+
489
+ def test_organism
490
+ assert_equal("", @obj.organism)
491
+ end
492
+
493
+ def test_genes_as_strings
494
+ assert_equal([], @obj.genes_as_strings)
495
+ end
496
+
497
+ def test_enzymes_as_strings
498
+ assert_equal([], @obj.enzymes_as_strings)
499
+ end
500
+
501
+ def test_reactions_as_strings
502
+ expected =
503
+ [ "R00093 L-glutamate:NAD+ oxidoreductase (transaminating)",
504
+ "R00114 L-Glutamate:NADP+ oxidoreductase (transaminating)",
505
+ "R00149 Carbon-dioxide:ammonia ligase (ADP-forming,carbamate-phosphorylating)",
506
+ "R00243 L-Glutamate:NAD+ oxidoreductase (deaminating)",
507
+ "R00248 L-Glutamate:NADP+ oxidoreductase (deaminating)",
508
+ "R00253 L-Glutamate:ammonia ligase (ADP-forming)",
509
+ "R00256 L-Glutamine amidohydrolase",
510
+ "R00258 L-Alanine:2-oxoglutarate aminotransferase",
511
+ "R00261 L-glutamate 1-carboxy-lyase (4-aminobutanoate-forming)",
512
+ "R00269 2-Oxoglutaramate amidohydrolase",
513
+ "R00348 2-Oxosuccinamate amidohydrolase",
514
+ "R00355 L-Aspartate:2-oxoglutarate aminotransferase",
515
+ "R00357 L-Aspartic acid:oxygen oxidoreductase (deaminating)",
516
+ "R00359 D-Aspartate:oxygen oxidoreductase (deaminating)",
517
+ "R00369 L-Alanine:glyoxylate aminotransferase",
518
+ "R00396 L-Alanine:NAD+ oxidoreductase (deaminating)",
519
+ "R00397 L-aspartate 4-carboxy-lyase (L-alanine-forming)",
520
+ "R00400 L-alanine:oxaloacetate aminotransferase",
521
+ "R00483 L-aspartate:ammonia ligase (AMP-forming)",
522
+ "R00484 N-Carbamoyl-L-aspartate amidohydrolase",
523
+ "R00485 L-Asparagine amidohydrolase",
524
+ "R00487 Acetyl-CoA:L-aspartate N-acetyltransferase",
525
+ "R00488 N-Acetyl-L-aspartate amidohydrolase",
526
+ "R00490 L-Aspartate ammonia-lyase",
527
+ "R00491 aspartate racemase",
528
+ "R00575 hydrogen-carbonate:L-glutamine amido-ligase (ADP-forming, carbamate-phosphorylating)",
529
+ "R00576 L-Glutamine:pyruvate aminotransferase",
530
+ "R00578 L-aspartate:L-glutamine amido-ligase (AMP-forming)",
531
+ "R00707 (S)-1-pyrroline-5-carboxylate:NAD+ oxidoreductase",
532
+ "R00708 (S)-1-pyrroline-5-carboxylate:NADP+ oxidoreductase",
533
+ "R00713 Succinate-semialdehyde:NAD+ oxidoreductase",
534
+ "R00714 Succinate-semialdehyde:NADP+ oxidoreductase",
535
+ "R00768 L-glutamine:D-fructose-6-phosphate isomerase (deaminating)",
536
+ "R01072 5-phosphoribosylamine:diphosphate phospho-alpha-D-ribosyltransferase (glutamate-amidating)",
537
+ "R01083 N6-(1,2-dicarboxyethyl)AMP AMP-lyase (fumarate-forming)",
538
+ "R01086 2-(Nomega-L-arginino)succinate arginine-lyase (fumarate-forming)",
539
+ "R01135 IMP:L-aspartate ligase (GDP-forming)",
540
+ "R01346 L-Asparagine:2-oxo-acid aminotransferase",
541
+ "R01397 carbamoyl-phosphate:L-aspartate carbamoyltransferase",
542
+ "R01648 4-Aminobutanoate:2-oxoglutarate aminotransferase",
543
+ "R01954 L-Citrulline:L-aspartate ligase (AMP-forming)"
544
+ ]
545
+ assert_equal(expected, @obj.reactions_as_strings)
546
+ end
547
+
548
+ def test_reactions_as_hash
549
+ expected = {
550
+ "R01648"=>"4-Aminobutanoate:2-oxoglutarate aminotransferase",
551
+ "R00485"=>"L-Asparagine amidohydrolase",
552
+ "R00397"=>"L-aspartate 4-carboxy-lyase (L-alanine-forming)",
553
+ "R00243"=>"L-Glutamate:NAD+ oxidoreductase (deaminating)",
554
+ "R01397"=>"carbamoyl-phosphate:L-aspartate carbamoyltransferase",
555
+ "R00707"=>"(S)-1-pyrroline-5-carboxylate:NAD+ oxidoreductase",
556
+ "R00575"=>
557
+ "hydrogen-carbonate:L-glutamine amido-ligase (ADP-forming, carbamate-phosphorylating)",
558
+ "R00487"=>"Acetyl-CoA:L-aspartate N-acetyltransferase",
559
+ "R00355"=>"L-Aspartate:2-oxoglutarate aminotransferase",
560
+ "R00256"=>"L-Glutamine amidohydrolase",
561
+ "R01135"=>"IMP:L-aspartate ligase (GDP-forming)",
562
+ "R00708"=>"(S)-1-pyrroline-5-carboxylate:NADP+ oxidoreductase",
563
+ "R00576"=>"L-Glutamine:pyruvate aminotransferase",
564
+ "R00488"=>"N-Acetyl-L-aspartate amidohydrolase",
565
+ "R00400"=>"L-alanine:oxaloacetate aminotransferase",
566
+ "R00114"=>"L-Glutamate:NADP+ oxidoreductase (transaminating)",
567
+ "R00093"=>"L-glutamate:NAD+ oxidoreductase (transaminating)",
568
+ "R00490"=>"L-Aspartate ammonia-lyase",
569
+ "R00357"=>"L-Aspartic acid:oxygen oxidoreductase (deaminating)",
570
+ "R00269"=>"2-Oxoglutaramate amidohydrolase",
571
+ "R00258"=>"L-Alanine:2-oxoglutarate aminotransferase",
572
+ "R01346"=>"L-Asparagine:2-oxo-acid aminotransferase",
573
+ "R01083"=>"N6-(1,2-dicarboxyethyl)AMP AMP-lyase (fumarate-forming)",
574
+ "R01072"=>
575
+ "5-phosphoribosylamine:diphosphate phospho-alpha-D-ribosyltransferase (glutamate-amidating)",
576
+ "R00578"=>"L-aspartate:L-glutamine amido-ligase (AMP-forming)",
577
+ "R00491"=>"aspartate racemase",
578
+ "R00369"=>"L-Alanine:glyoxylate aminotransferase",
579
+ "R00248"=>"L-Glutamate:NADP+ oxidoreductase (deaminating)",
580
+ "R00149"=>
581
+ "Carbon-dioxide:ammonia ligase (ADP-forming,carbamate-phosphorylating)",
582
+ "R00359"=>"D-Aspartate:oxygen oxidoreductase (deaminating)",
583
+ "R00348"=>"2-Oxosuccinamate amidohydrolase",
584
+ "R00261"=>"L-glutamate 1-carboxy-lyase (4-aminobutanoate-forming)",
585
+ "R01954"=>"L-Citrulline:L-aspartate ligase (AMP-forming)",
586
+ "R01086"=>"2-(Nomega-L-arginino)succinate arginine-lyase (fumarate-forming)",
587
+ "R00768"=>"L-glutamine:D-fructose-6-phosphate isomerase (deaminating)",
588
+ "R00713"=>"Succinate-semialdehyde:NAD+ oxidoreductase",
589
+ "R00483"=>"L-aspartate:ammonia ligase (AMP-forming)",
590
+ "R00714"=>"Succinate-semialdehyde:NADP+ oxidoreductase",
591
+ "R00484"=>"N-Carbamoyl-L-aspartate amidohydrolase",
592
+ "R00396"=>"L-Alanine:NAD+ oxidoreductase (deaminating)",
593
+ "R00253"=>"L-Glutamate:ammonia ligase (ADP-forming)"
594
+ }
595
+ assert_equal(expected, @obj.reactions_as_hash)
596
+ end
597
+
598
+ def test_compounds_as_strings
599
+ expected =
600
+ [ "C00014 NH3",
601
+ "C00022 Pyruvate",
602
+ "C00025 L-Glutamate",
603
+ "C00026 2-Oxoglutarate",
604
+ "C00036 Oxaloacetate",
605
+ "C00041 L-Alanine",
606
+ "C00042 Succinate",
607
+ "C00049 L-Aspartate",
608
+ "C00064 L-Glutamine",
609
+ "C00122 Fumarate",
610
+ "C00152 L-Asparagine",
611
+ "C00169 Carbamoyl phosphate",
612
+ "C00232 Succinate semialdehyde",
613
+ "C00334 4-Aminobutanoate",
614
+ "C00352 D-Glucosamine 6-phosphate",
615
+ "C00402 D-Aspartate",
616
+ "C00438 N-Carbamoyl-L-aspartate",
617
+ "C00940 2-Oxoglutaramate",
618
+ "C01042 N-Acetyl-L-aspartate",
619
+ "C02362 2-Oxosuccinamate",
620
+ "C03090 5-Phosphoribosylamine",
621
+ "C03406 N-(L-Arginino)succinate",
622
+ "C03794 N6-(1,2-Dicarboxyethyl)-AMP",
623
+ "C03912 (S)-1-Pyrroline-5-carboxylate"
624
+ ]
625
+ assert_equal(expected, @obj.compounds_as_strings)
626
+ end
627
+
628
+ def test_compounds_as_hash
629
+ expected = {
630
+ "C02362"=>"2-Oxosuccinamate",
631
+ "C01042"=>"N-Acetyl-L-aspartate",
632
+ "C00041"=>"L-Alanine",
633
+ "C03912"=>"(S)-1-Pyrroline-5-carboxylate",
634
+ "C03406"=>"N-(L-Arginino)succinate",
635
+ "C00438"=>"N-Carbamoyl-L-aspartate",
636
+ "C00152"=>"L-Asparagine",
637
+ "C00064"=>"L-Glutamine",
638
+ "C00042"=>"Succinate",
639
+ "C00352"=>"D-Glucosamine 6-phosphate",
640
+ "C00022"=>"Pyruvate",
641
+ "C03794"=>"N6-(1,2-Dicarboxyethyl)-AMP",
642
+ "C03090"=>"5-Phosphoribosylamine",
643
+ "C00232"=>"Succinate semialdehyde",
644
+ "C00122"=>"Fumarate",
645
+ "C00036"=>"Oxaloacetate",
646
+ "C00025"=>"L-Glutamate",
647
+ "C00014"=>"NH3",
648
+ "C00334"=>"4-Aminobutanoate",
649
+ "C00169"=>"Carbamoyl phosphate",
650
+ "C00026"=>"2-Oxoglutarate",
651
+ "C00940"=>"2-Oxoglutaramate",
652
+ "C00049"=>"L-Aspartate",
653
+ "C00402"=>"D-Aspartate"
654
+ }
655
+ assert_equal(expected, @obj.compounds_as_hash)
656
+ end
657
+
658
+ def test_rel_pathways_as_strings
659
+ expected =
660
+ [ "rn00010 Glycolysis / Gluconeogenesis",
661
+ "rn00020 Citrate cycle (TCA cycle)",
662
+ "rn00230 Purine metabolism",
663
+ "rn00240 Pyrimidine metabolism",
664
+ "rn00253 Tetracycline biosynthesis",
665
+ "rn00260 Glycine, serine and threonine metabolism",
666
+ "rn00300 Lysine biosynthesis",
667
+ "rn00330 Arginine and proline metabolism",
668
+ "rn00340 Histidine metabolism",
669
+ "rn00410 beta-Alanine metabolism",
670
+ "rn00460 Cyanoamino acid metabolism",
671
+ "rn00471 D-Glutamine and D-glutamate metabolism",
672
+ "rn00473 D-Alanine metabolism",
673
+ "rn00480 Glutathione metabolism",
674
+ "rn00650 Butanoate metabolism",
675
+ "rn00660 C5-Branched dibasic acid metabolism",
676
+ "rn00760 Nicotinate and nicotinamide metabolism",
677
+ "rn00770 Pantothenate and CoA biosynthesis",
678
+ "rn00860 Porphyrin and chlorophyll metabolism",
679
+ "rn00910 Nitrogen metabolism"
680
+ ]
681
+ assert_equal(expected, @obj.rel_pathways_as_strings)
682
+ end
683
+
684
+ def test_rel_pathways_as_hash
685
+ expected = {
686
+ "rn00770"=>"Pantothenate and CoA biosynthesis",
687
+ "rn00660"=>"C5-Branched dibasic acid metabolism",
688
+ "rn00473"=>"D-Alanine metabolism",
689
+ "rn00330"=>"Arginine and proline metabolism",
690
+ "rn00253"=>"Tetracycline biosynthesis",
691
+ "rn00760"=>"Nicotinate and nicotinamide metabolism",
692
+ "rn00650"=>"Butanoate metabolism",
693
+ "rn00860"=>"Porphyrin and chlorophyll metabolism",
694
+ "rn00410"=>"beta-Alanine metabolism",
695
+ "rn00300"=>"Lysine biosynthesis",
696
+ "rn00480"=>"Glutathione metabolism",
697
+ "rn00260"=>"Glycine, serine and threonine metabolism",
698
+ "rn00910"=>"Nitrogen metabolism",
699
+ "rn00471"=>"D-Glutamine and D-glutamate metabolism",
700
+ "rn00460"=>"Cyanoamino acid metabolism",
701
+ "rn00240"=>"Pyrimidine metabolism",
702
+ "rn00020"=>"Citrate cycle (TCA cycle)",
703
+ "rn00340"=>"Histidine metabolism",
704
+ "rn00230"=>"Purine metabolism",
705
+ "rn00010"=>"Glycolysis / Gluconeogenesis"}
706
+ assert_equal(expected, @obj.rel_pathways_as_hash)
707
+ end
708
+
709
+ def test_ko_pathway
710
+ assert_equal("ko00250", @obj.ko_pathway)
711
+ end
712
+
713
+ end #class TestBioKeggPathway_rn00250
714
+
715
+ class TestBioKEGGPATHWAY_ec00072 < Test::Unit::TestCase
716
+
717
+ def setup
718
+ filename = File.join(BioRubyTestDataPath, 'KEGG', 'ec00072.pathway')
719
+ @obj = Bio::KEGG::PATHWAY.new(File.read(filename))
720
+ end
721
+
722
+ def test_dblinks_as_hash
723
+ assert_equal({}, @obj.dblinks_as_hash)
724
+ end
725
+
726
+ def test_pathways_as_hash
727
+ expected = {"ec00072"=>"Synthesis and degradation of ketone bodies"}
728
+ assert_equal(expected, @obj.pathways_as_hash)
729
+ end
730
+
731
+ def test_orthologs_as_hash
732
+ assert_equal({}, @obj.orthologs_as_hash)
733
+ end
734
+
735
+ def test_genes_as_hash
736
+ assert_equal({}, @obj.genes_as_hash)
737
+ end
738
+
739
+ def test_references
740
+ assert_equal([], @obj.references)
741
+ end
742
+
743
+ def test_modules_as_hash
744
+ expected = { "M00177" =>
745
+ "Ketone body biosynthesis, acetyl-CoA => acetoacetate/3-hydroxybutyrate/acetone [PATH:ec00072]" }
746
+ assert_equal(expected, @obj.modules_as_hash)
747
+ end
748
+
749
+ def test_new
750
+ assert_kind_of(Bio::KEGG::PATHWAY, @obj)
751
+ end
752
+
753
+ def test_entry_id
754
+ assert_equal("ec00072", @obj.entry_id)
755
+ end
756
+
757
+ def test_name
758
+ expected = "Synthesis and degradation of ketone bodies"
759
+ assert_equal(expected, @obj.name)
760
+ end
761
+
762
+ def test_description
763
+ assert_equal("", @obj.description)
764
+ end
765
+
766
+ def test_keggclass
767
+ expected = "Metabolism; Lipid Metabolism"
768
+ assert_equal(expected, @obj.keggclass)
769
+ end
770
+
771
+ def test_pathways_as_strings
772
+ expected = ["ec00072 Synthesis and degradation of ketone bodies"]
773
+ assert_equal(expected, @obj.pathways_as_strings)
774
+ end
775
+
776
+ def test_modules_as_strings
777
+ expected = ["M00177 Ketone body biosynthesis, acetyl-CoA => acetoacetate/3-hydroxybutyrate/acetone [PATH:ec00072]"]
778
+ assert_equal(expected, @obj.modules_as_strings)
779
+ end
780
+
781
+ def test_diseases_as_strings
782
+ assert_equal([], @obj.diseases_as_strings)
783
+ end
784
+
785
+ def test_diseases_as_hash
786
+ assert_equal({}, @obj.diseases_as_hash)
787
+ end
788
+
789
+ def test_dblinks_as_strings
790
+ assert_equal([], @obj.dblinks_as_strings)
791
+ end
792
+
793
+ def test_orthologs_as_strings
794
+ assert_equal([], @obj.orthologs_as_strings)
795
+ end
796
+
797
+ def test_organism
798
+ assert_equal("", @obj.organism)
799
+ end
800
+
801
+ def test_genes_as_strings
802
+ assert_equal([], @obj.genes_as_strings)
803
+ end
804
+
805
+ def test_enzymes_as_strings
806
+ expected = [ "1.1.1.30", "2.3.1.9", "2.3.3.10", "2.8.3.5",
807
+ "4.1.1.4", "4.1.3.4" ]
808
+ assert_equal(expected, @obj.enzymes_as_strings)
809
+ end
810
+
811
+ def test_reactions_as_strings
812
+ assert_equal([], @obj.reactions_as_strings)
813
+ end
814
+
815
+ def test_reactions_as_hash
816
+ assert_equal({}, @obj.reactions_as_hash)
817
+ end
818
+
819
+ def test_compounds_as_strings
820
+ expected =
821
+ [ "C00024 Acetyl-CoA",
822
+ "C00164 Acetoacetate",
823
+ "C00207 Acetone",
824
+ "C00332 Acetoacetyl-CoA",
825
+ "C00356 (S)-3-Hydroxy-3-methylglutaryl-CoA",
826
+ "C01089 (R)-3-Hydroxybutanoate"
827
+ ]
828
+ assert_equal(expected, @obj.compounds_as_strings)
829
+ end
830
+
831
+ def test_compounds_as_hash
832
+ expected = {
833
+ "C00207"=>"Acetone",
834
+ "C00164"=>"Acetoacetate",
835
+ "C01089"=>"(R)-3-Hydroxybutanoate",
836
+ "C00332"=>"Acetoacetyl-CoA",
837
+ "C00024"=>"Acetyl-CoA",
838
+ "C00356"=>"(S)-3-Hydroxy-3-methylglutaryl-CoA"
839
+ }
840
+ assert_equal(expected, @obj.compounds_as_hash)
841
+ end
842
+
843
+ def test_rel_pathways_as_strings
844
+ expected =
845
+ [ "ec00010 Glycolysis / Gluconeogenesis",
846
+ "ec00071 Fatty acid metabolism",
847
+ "ec00620 Pyruvate metabolism",
848
+ "ec00650 Butanoate metabolism"
849
+ ]
850
+ assert_equal(expected, @obj.rel_pathways_as_strings)
851
+ end
852
+
853
+ def test_rel_pathways_as_hash
854
+ expected = {
855
+ "ec00620"=>"Pyruvate metabolism",
856
+ "ec00071"=>"Fatty acid metabolism",
857
+ "ec00010"=>"Glycolysis / Gluconeogenesis",
858
+ "ec00650"=>"Butanoate metabolism"
859
+ }
860
+ assert_equal(expected, @obj.rel_pathways_as_hash)
861
+ end
862
+
863
+ def test_ko_pathway
864
+ assert_equal("ko00072", @obj.ko_pathway)
865
+ end
866
+
867
+ end #class TestBioKEGGPATHWAY_ec00072
868
+
869
+ class TestBioKEGGPATHWAY_hsa00790 < Test::Unit::TestCase
870
+
871
+ def setup
872
+ filename = File.join(BioRubyTestDataPath, 'KEGG', 'hsa00790.pathway')
873
+ @obj = Bio::KEGG::PATHWAY.new(File.read(filename))
874
+ end
875
+
876
+ def test_dblinks_as_hash
877
+ assert_equal({"GO"=>["0046656"]}, @obj.dblinks_as_hash)
878
+ end
879
+
880
+ def test_pathways_as_hash
881
+ expected = {"hsa00790"=>"Folate biosynthesis"}
882
+ assert_equal(expected, @obj.pathways_as_hash)
883
+ end
884
+
885
+ def test_orthologs_as_hash
886
+ assert_equal({}, @obj.orthologs_as_hash)
887
+ end
888
+
889
+ def test_genes_as_hash
890
+ expected = {
891
+ "248" => "ALPI, IAP [KO:K01077] [EC:3.1.3.1]",
892
+ "6697" => "SPR, SDR38C1 [KO:K00072] [EC:1.1.1.153]",
893
+ "249" =>
894
+ "ALPL, AP-TNAP, APTNAP, FLJ40094, FLJ93059, HOPS, MGC161443, MGC167935, TNAP, TNSALP [KO:K01077] [EC:3.1.3.1]",
895
+ "2356" => "FPGS [KO:K01930] [EC:6.3.2.17]",
896
+ "250" => "ALPP, ALP, FLJ61142, PALP, PLAP [KO:K01077] [EC:3.1.3.1]",
897
+ "1719" => "DHFR, DHFRP1, DYR [KO:K00287] [EC:1.5.1.3]",
898
+ "251" => "ALPPL2, ALPG, ALPPL, GCAP [KO:K01077] [EC:3.1.3.1]",
899
+ "2643" =>
900
+ "GCH1, DYT14, DYT5, DYT5a, GCH, GTP-CH-1, GTPCH1, HPABH4B [KO:K01495] [EC:3.5.4.16]",
901
+ "8836" => "GGH, GH [KO:K01307] [EC:3.4.19.9]",
902
+ "5860" =>
903
+ "QDPR, DHPR, FLJ42391, PKU2, SDR33C1 [KO:K00357] [EC:1.5.1.34]",
904
+ "5805" => "PTS, FLJ97081, PTPS [KO:K01737] [EC:4.2.3.12]"
905
+ }
906
+ assert_equal(expected, @obj.genes_as_hash)
907
+ end
908
+
909
+ def test_references
910
+ assert_equal([], @obj.references)
911
+ end
912
+
913
+ def test_modules_as_hash
914
+ expected = {
915
+ "M00251"=>"Folate biosynthesis, GTP => THF [PATH:hsa00790]",
916
+ "M00304"=>"Methanogenesis [PATH:hsa00790]"
917
+ }
918
+ assert_equal(expected, @obj.modules_as_hash)
919
+ end
920
+
921
+ def test_new
922
+ assert_instance_of(Bio::KEGG::PATHWAY, @obj)
923
+ end
924
+
925
+ def test_entry_id
926
+ assert_equal("hsa00790", @obj.entry_id)
927
+ end
928
+
929
+ def test_name
930
+ expected = "Folate biosynthesis - Homo sapiens (human)"
931
+ assert_equal(expected, @obj.name)
932
+ end
933
+
934
+ def test_description
935
+ assert_equal("", @obj.description)
936
+ end
937
+
938
+ def test_keggclass
939
+ expected = "Metabolism; Metabolism of Cofactors and Vitamins"
940
+ assert_equal(expected, @obj.keggclass)
941
+ end
942
+
943
+ def test_pathways_as_strings
944
+ expected = ["hsa00790 Folate biosynthesis"]
945
+ assert_equal(expected, @obj.pathways_as_strings)
946
+ end
947
+
948
+ def test_modules_as_strings
949
+ expected = ["M00251 Folate biosynthesis, GTP => THF [PATH:hsa00790]",
950
+ "M00304 Methanogenesis [PATH:hsa00790]"]
951
+ assert_equal(expected, @obj.modules_as_strings)
952
+ end
953
+
954
+ def test_diseases_as_strings
955
+ expected = [ "H00167 Phenylketonuria (PKU)",
956
+ "H00213 Hypophosphatasia" ]
957
+ assert_equal(expected, @obj.diseases_as_strings)
958
+ end
959
+
960
+ def test_diseases_as_hash
961
+ expected = {
962
+ "H00167"=>"Phenylketonuria (PKU)",
963
+ "H00213"=>"Hypophosphatasia"
964
+ }
965
+ assert_equal(expected, @obj.diseases_as_hash)
966
+ end
967
+
968
+ def test_dblinks_as_strings
969
+ assert_equal(["GO: 0046656"], @obj.dblinks_as_strings)
970
+ end
971
+
972
+ def test_orthologs_as_strings
973
+ assert_equal([], @obj.orthologs_as_strings)
974
+ end
975
+
976
+ def test_organism
977
+ expected = "Homo sapiens (human) [GN:hsa]"
978
+ assert_equal(expected, @obj.organism)
979
+ end
980
+
981
+ def test_genes_as_strings
982
+ expected =
983
+ [ "2643 GCH1, DYT14, DYT5, DYT5a, GCH, GTP-CH-1, GTPCH1, HPABH4B [KO:K01495] [EC:3.5.4.16]",
984
+ "248 ALPI, IAP [KO:K01077] [EC:3.1.3.1]",
985
+ "249 ALPL, AP-TNAP, APTNAP, FLJ40094, FLJ93059, HOPS, MGC161443, MGC167935, TNAP, TNSALP [KO:K01077] [EC:3.1.3.1]",
986
+ "250 ALPP, ALP, FLJ61142, PALP, PLAP [KO:K01077] [EC:3.1.3.1]",
987
+ "251 ALPPL2, ALPG, ALPPL, GCAP [KO:K01077] [EC:3.1.3.1]",
988
+ "1719 DHFR, DHFRP1, DYR [KO:K00287] [EC:1.5.1.3]",
989
+ "2356 FPGS [KO:K01930] [EC:6.3.2.17]",
990
+ "8836 GGH, GH [KO:K01307] [EC:3.4.19.9]",
991
+ "5805 PTS, FLJ97081, PTPS [KO:K01737] [EC:4.2.3.12]",
992
+ "6697 SPR, SDR38C1 [KO:K00072] [EC:1.1.1.153]",
993
+ "5860 QDPR, DHPR, FLJ42391, PKU2, SDR33C1 [KO:K00357] [EC:1.5.1.34]"
994
+ ]
995
+ assert_equal(expected, @obj.genes_as_strings)
996
+ end
997
+
998
+ def test_enzymes_as_strings
999
+ assert_equal([], @obj.enzymes_as_strings)
1000
+ end
1001
+
1002
+ def test_reactions_as_strings
1003
+ assert_equal([], @obj.reactions_as_strings)
1004
+ end
1005
+
1006
+ def test_reactions_as_hash
1007
+ assert_equal({}, @obj.reactions_as_hash)
1008
+ end
1009
+
1010
+ def test_compounds_as_strings
1011
+ expected =
1012
+ [ "C00044 GTP",
1013
+ "C00101 Tetrahydrofolate",
1014
+ "C00251 Chorismate",
1015
+ "C00266 Glycolaldehyde",
1016
+ "C00268 Dihydrobiopterin",
1017
+ "C00272 Tetrahydrobiopterin",
1018
+ "C00415 Dihydrofolate",
1019
+ "C00504 Folate",
1020
+ "C00568 4-Aminobenzoate",
1021
+ "C00921 Dihydropteroate",
1022
+ "C01217 5,6,7,8-Tetrahydromethanopterin",
1023
+ "C01300 2-Amino-4-hydroxy-6-hydroxymethyl-7,8-dihydropteridine",
1024
+ "C03541 Tetrahydrofolyl-[Glu](n)",
1025
+ "C03684 6-Pyruvoyltetrahydropterin",
1026
+ "C04244 6-Lactoyl-5,6,7,8-tetrahydropterin",
1027
+ "C04807 2-Amino-7,8-dihydro-4-hydroxy-6-(diphosphooxymethyl)pteridine",
1028
+ "C04874 2-Amino-4-hydroxy-6-(D-erythro-1,2,3-trihydroxypropyl)-7,8-dihydropteridine",
1029
+ "C04895 2-Amino-4-hydroxy-6-(erythro-1,2,3-trihydroxypropyl)dihydropteridine triphosphate",
1030
+ "C05922 Formamidopyrimidine nucleoside triphosphate",
1031
+ "C05923 2,5-Diaminopyrimidine nucleoside triphosphate",
1032
+ "C05924 Molybdopterin",
1033
+ "C05925 Dihydroneopterin phosphate",
1034
+ "C05926 Neopterin",
1035
+ "C05927 7,8-Dihydromethanopterin",
1036
+ "C06148 2,5-Diamino-6-(5'-triphosphoryl-3',4'-trihydroxy-2'-oxopentyl)-amino-4-oxopyrimidine",
1037
+ "C06149 6-(3'-Triphosphoryl-1'-methylglyceryl)-7-methyl-7,8-dihydrobiopterin",
1038
+ "C09332 Tetrahydrofolyl-[Glu](2)",
1039
+ "C11355 4-Amino-4-deoxychorismate"
1040
+ ]
1041
+ assert_equal(expected, @obj.compounds_as_strings)
1042
+ end
1043
+
1044
+ def test_compounds_as_hash
1045
+ expected = {
1046
+ "C05925"=>"Dihydroneopterin phosphate",
1047
+ "C04244"=>"6-Lactoyl-5,6,7,8-tetrahydropterin",
1048
+ "C01217"=>"5,6,7,8-Tetrahydromethanopterin",
1049
+ "C00568"=>"4-Aminobenzoate",
1050
+ "C05926"=>"Neopterin",
1051
+ "C00921"=>"Dihydropteroate",
1052
+ "C00415"=>"Dihydrofolate",
1053
+ "C00272"=>"Tetrahydrobiopterin",
1054
+ "C05927"=>"7,8-Dihydromethanopterin",
1055
+ "C04895"=>
1056
+ "2-Amino-4-hydroxy-6-(erythro-1,2,3-trihydroxypropyl)dihydropteridine triphosphate",
1057
+ "C04807"=>"2-Amino-7,8-dihydro-4-hydroxy-6-(diphosphooxymethyl)pteridine",
1058
+ "C00504"=>"Folate",
1059
+ "C00251"=>"Chorismate",
1060
+ "C06148"=>
1061
+ "2,5-Diamino-6-(5'-triphosphoryl-3',4'-trihydroxy-2'-oxopentyl)-amino-4-oxopyrimidine",
1062
+ "C04874"=>
1063
+ "2-Amino-4-hydroxy-6-(D-erythro-1,2,3-trihydroxypropyl)-7,8-dihydropteridine",
1064
+ "C06149"=>
1065
+ "6-(3'-Triphosphoryl-1'-methylglyceryl)-7-methyl-7,8-dihydrobiopterin",
1066
+ "C00044"=>"GTP",
1067
+ "C03684"=>"6-Pyruvoyltetrahydropterin",
1068
+ "C03541"=>"Tetrahydrofolyl-[Glu](n)",
1069
+ "C01300"=>"2-Amino-4-hydroxy-6-hydroxymethyl-7,8-dihydropteridine",
1070
+ "C00266"=>"Glycolaldehyde",
1071
+ "C00101"=>"Tetrahydrofolate",
1072
+ "C05922"=>"Formamidopyrimidine nucleoside triphosphate",
1073
+ "C00268"=>"Dihydrobiopterin",
1074
+ "C11355"=>"4-Amino-4-deoxychorismate",
1075
+ "C05923"=>"2,5-Diaminopyrimidine nucleoside triphosphate",
1076
+ "C09332"=>"Tetrahydrofolyl-[Glu](2)",
1077
+ "C05924"=>"Molybdopterin"
1078
+ }
1079
+ assert_equal(expected, @obj.compounds_as_hash)
1080
+ end
1081
+
1082
+ def test_rel_pathways_as_strings
1083
+ expected =
1084
+ [ "hsa00230 Purine metabolism",
1085
+ "hsa00400 Phenylalanine, tyrosine and tryptophan biosynthesis",
1086
+ "hsa00670 One carbon pool by folate",
1087
+ "hsa00680 Methane metabolism"
1088
+ ]
1089
+ assert_equal(expected, @obj.rel_pathways_as_strings)
1090
+ end
1091
+
1092
+ def test_rel_pathways_as_hash
1093
+ expected = {
1094
+ "hsa00680"=>"Methane metabolism",
1095
+ "hsa00670"=>"One carbon pool by folate",
1096
+ "hsa00230"=>"Purine metabolism",
1097
+ "hsa00400"=>"Phenylalanine, tyrosine and tryptophan biosynthesis"
1098
+ }
1099
+ assert_equal(expected, @obj.rel_pathways_as_hash)
1100
+ end
1101
+
1102
+ def test_ko_pathway
1103
+ assert_equal("ko00790", @obj.ko_pathway)
1104
+ end
1105
+
1106
+ end #class TestBioKEGGPATHWAY_hsa00790
1107
+
1108
+ class TestBioKEGGPATHWAY_ko00312 < Test::Unit::TestCase
1109
+
1110
+ def setup
1111
+ filename = File.join(BioRubyTestDataPath, 'KEGG', 'ko00312.pathway')
1112
+ @obj = Bio::KEGG::PATHWAY.new(File.read(filename))
1113
+ end
1114
+
1115
+ def test_dblinks_as_hash
1116
+ assert_equal({}, @obj.dblinks_as_hash)
1117
+ end
1118
+
1119
+ def test_pathways_as_hash
1120
+ expected = {"ko00312"=>"beta-Lactam resistance"}
1121
+ assert_equal(expected, @obj.pathways_as_hash)
1122
+ end
1123
+
1124
+ def test_orthologs_as_hash
1125
+ expected = {
1126
+ "K02545"=>"penicillin-binding protein 2 prime",
1127
+ "K02172"=>"bla regulator protein blaR1",
1128
+ "K02546"=>"methicillin resistance regulatory protein",
1129
+ "K02547"=>"methicillin resistance protein",
1130
+ "K02352"=>"drp35",
1131
+ "K01467"=>"beta-lactamase [EC:3.5.2.6]",
1132
+ "K02171"=>"penicillinase repressor"
1133
+ }
1134
+ assert_equal(expected, @obj.orthologs_as_hash)
1135
+ end
1136
+
1137
+ def test_genes_as_hash
1138
+ assert_equal({}, @obj.genes_as_hash)
1139
+ end
1140
+
1141
+ def test_references
1142
+ assert_equal([], @obj.references)
1143
+ end
1144
+
1145
+ def test_modules_as_hash
1146
+ assert_equal({}, @obj.modules_as_hash)
1147
+ end
1148
+
1149
+ def test_new
1150
+ assert_instance_of(Bio::KEGG::PATHWAY, @obj)
1151
+ end
1152
+
1153
+ def test_entry_id
1154
+ assert_equal("ko00312", @obj.entry_id)
1155
+ end
1156
+
1157
+ def test_name
1158
+ assert_equal("beta-Lactam resistance", @obj.name)
1159
+ end
1160
+
1161
+ def test_description
1162
+ assert_equal("", @obj.description)
1163
+ end
1164
+
1165
+ def test_keggclass
1166
+ expected = "Metabolism; Biosynthesis of Other Secondary Metabolites"
1167
+ assert_equal(expected, @obj.keggclass)
1168
+ end
1169
+
1170
+ def test_pathways_as_strings
1171
+ expected = ["ko00312 beta-Lactam resistance"]
1172
+ assert_equal(expected, @obj.pathways_as_strings)
1173
+ end
1174
+
1175
+ def test_modules_as_strings
1176
+ assert_equal([], @obj.modules_as_strings)
1177
+ end
1178
+
1179
+ def test_diseases_as_strings
1180
+ assert_equal([], @obj.diseases_as_strings)
1181
+ end
1182
+
1183
+ def test_diseases_as_hash
1184
+ assert_equal({}, @obj.diseases_as_hash)
1185
+ end
1186
+
1187
+ def test_dblinks_as_strings
1188
+ assert_equal([], @obj.dblinks_as_strings)
1189
+ end
1190
+
1191
+ def test_orthologs_as_strings
1192
+ expected =
1193
+ [ "K02172 bla regulator protein blaR1",
1194
+ "K02171 penicillinase repressor",
1195
+ "K01467 beta-lactamase [EC:3.5.2.6]",
1196
+ "K02352 drp35",
1197
+ "K02547 methicillin resistance protein",
1198
+ "K02546 methicillin resistance regulatory protein",
1199
+ "K02545 penicillin-binding protein 2 prime"
1200
+ ]
1201
+ assert_equal(expected, @obj.orthologs_as_strings)
1202
+ end
1203
+
1204
+ def test_organism
1205
+ assert_equal("", @obj.organism)
1206
+ end
1207
+
1208
+ def test_genes_as_strings
1209
+ assert_equal([], @obj.genes_as_strings)
1210
+ end
1211
+
1212
+ def test_enzymes_as_strings
1213
+ assert_equal([], @obj.enzymes_as_strings)
1214
+ end
1215
+
1216
+ def test_reactions_as_strings
1217
+ assert_equal([], @obj.reactions_as_strings)
1218
+ end
1219
+
1220
+ def test_reactions_as_hash
1221
+ assert_equal({}, @obj.reactions_as_hash)
1222
+ end
1223
+
1224
+ def test_compounds_as_strings
1225
+ expected = ["C00039 DNA", "C03438 beta-Lactam antibiotics"]
1226
+ assert_equal(expected, @obj.compounds_as_strings)
1227
+ end
1228
+
1229
+ def test_compounds_as_hash
1230
+ expected = {"C03438"=>"beta-Lactam antibiotics", "C00039"=>"DNA"}
1231
+ assert_equal(expected, @obj.compounds_as_hash)
1232
+ end
1233
+
1234
+ def test_rel_pathways_as_strings
1235
+ expected = ["ko00311 Penicillin and cephalosporin biosynthesis"]
1236
+ assert_equal(expected, @obj.rel_pathways_as_strings)
1237
+ end
1238
+
1239
+ def test_rel_pathways_as_hash
1240
+ expected = {"ko00311"=>"Penicillin and cephalosporin biosynthesis"}
1241
+ assert_equal(expected, @obj.rel_pathways_as_hash)
1242
+ end
1243
+
1244
+ def test_ko_pathway
1245
+ assert_equal("", @obj.ko_pathway)
1246
+ end
1247
+
1248
+ end #class TestBioKEGGPATHWAY_ko00312
1249
+
1250
+ end #module Bio