PageRenderTime 65ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 1ms

/test/unit/bio/db/kegg/test_pathway.rb

https://github.com/phylogenomics/bioruby
Ruby | 1250 lines | 1060 code | 182 blank | 8 comment | 0 complexity | ff7af17db67bb071c0da99312e9eb257 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
  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. # loading helper routine for testing bioruby
  8. require 'pathname'
  9. load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
  10. 'bioruby_test_helper.rb')).cleanpath.to_s
  11. # libraries needed for the tests
  12. require 'test/unit'
  13. require 'bio/db/kegg/pathway'
  14. module Bio
  15. class TestKeggPathway_map00052 < Test::Unit::TestCase
  16. def setup
  17. testdata_kegg = Pathname.new(File.join(BioRubyTestDataPath, 'KEGG')).cleanpath.to_s
  18. entry = File.read(File.join(testdata_kegg, "map00052.pathway"))
  19. @obj = Bio::KEGG::PATHWAY.new(entry)
  20. end
  21. def test_entry_id
  22. assert_equal('map00052', @obj.entry_id)
  23. end
  24. def test_name
  25. assert_equal('Galactose metabolism', @obj.name)
  26. end
  27. def test_keggclass
  28. assert_equal('Metabolism; Carbohydrate Metabolism', @obj.keggclass)
  29. end
  30. def test_modules_as_hash
  31. expected = {
  32. "M00097"=>"UDP-glucose and UDP-galactose biosynthesis, Glc-1P/Gal-1P => UDP-Glc/UDP-Gal",
  33. "M00614"=>"PTS system, N-acetylgalactosamine-specific II component",
  34. "M00616"=>"PTS system, galactitol-specific II component",
  35. "M00618"=>"PTS system, lactose-specific II component",
  36. "M00624"=>"PTS system, galactosamine-specific II component"
  37. }
  38. assert_equal(expected, @obj.modules_as_hash)
  39. assert_equal(expected, @obj.modules)
  40. end
  41. def test_modules_as_strings
  42. expected =
  43. [ "M00097 UDP-glucose and UDP-galactose biosynthesis, Glc-1P/Gal-1P => UDP-Glc/UDP-Gal",
  44. "M00614 PTS system, N-acetylgalactosamine-specific II component",
  45. "M00616 PTS system, galactitol-specific II component",
  46. "M00618 PTS system, lactose-specific II component",
  47. "M00624 PTS system, galactosamine-specific II component"
  48. ]
  49. assert_equal(expected, @obj.modules_as_strings)
  50. end
  51. def test_rel_pathways_as_strings
  52. expected = [ "map00010 Glycolysis / Gluconeogenesis",
  53. "map00040 Pentose and glucuronate interconversions",
  54. "map00051 Fructose and mannose metabolism",
  55. "map00520 Amino sugar and nucleotide sugar metabolism"
  56. ]
  57. assert_equal(expected, @obj.rel_pathways_as_strings)
  58. end
  59. def test_rel_pathways_as_hash
  60. expected = {
  61. "map00010"=>"Glycolysis / Gluconeogenesis",
  62. "map00040"=>"Pentose and glucuronate interconversions",
  63. "map00051"=>"Fructose and mannose metabolism",
  64. "map00520"=>"Amino sugar and nucleotide sugar metabolism"
  65. }
  66. assert_equal(expected, @obj.rel_pathways_as_hash)
  67. assert_equal(expected, @obj.rel_pathways)
  68. end
  69. def test_references
  70. assert_equal([], @obj.references)
  71. end
  72. def test_dblinks_as_strings
  73. assert_equal([], @obj.dblinks_as_strings)
  74. end
  75. def test_dblinks_as_hash
  76. assert_equal({}, @obj.dblinks_as_hash)
  77. end
  78. def test_pathways_as_strings
  79. expected = ["map00052 Galactose metabolism"]
  80. assert_equal(expected, @obj.pathways_as_strings)
  81. end
  82. def test_pathways_as_hash
  83. expected = {"map00052"=>"Galactose metabolism"}
  84. assert_equal(expected, @obj.pathways_as_hash)
  85. end
  86. def test_orthologs_as_strings
  87. assert_equal([], @obj.orthologs_as_strings)
  88. end
  89. def test_orthologs_as_hash
  90. assert_equal({}, @obj.orthologs_as_hash)
  91. end
  92. def test_genes_as_strings
  93. assert_equal([], @obj.genes_as_strings)
  94. end
  95. def test_genes_as_hash
  96. assert_equal({}, @obj.genes_as_hash)
  97. end
  98. def test_diseases_as_strings
  99. assert_equal([], @obj.diseases_as_strings)
  100. end
  101. def test_diseases_as_hash
  102. assert_equal({}, @obj.diseases_as_hash)
  103. end
  104. def test_enzymes_as_strings
  105. assert_equal([], @obj.enzymes_as_strings)
  106. end
  107. def test_reactions_as_strings
  108. assert_equal([], @obj.reactions_as_strings)
  109. end
  110. def test_reactions_as_hash
  111. assert_equal({}, @obj.reactions_as_hash)
  112. end
  113. def test_compounds_as_strings
  114. assert_equal([], @obj.compounds_as_strings)
  115. end
  116. def test_compounds_as_hash
  117. assert_equal({}, @obj.compounds_as_hash)
  118. end
  119. def test_description
  120. assert_equal("", @obj.description)
  121. end
  122. def test_organism
  123. assert_equal("", @obj.organism)
  124. end
  125. def test_ko_pathway
  126. assert_equal("", @obj.ko_pathway)
  127. end
  128. end #class TestKeggPathway_map00052
  129. class TestBioKEGGPATHWAY_map00030 < Test::Unit::TestCase
  130. def setup
  131. filename = File.join(BioRubyTestDataPath, 'KEGG/map00030.pathway')
  132. @obj = Bio::KEGG::PATHWAY.new(File.read(filename))
  133. end
  134. def test_references
  135. data =
  136. [ { "authors" => [ "Nishizuka Y (ed)." ],
  137. "comments" => [ "(map 3)" ],
  138. "journal" => "Tokyo Kagaku Dojin",
  139. "title" => "[Metabolic Maps] (In Japanese)",
  140. "year" => "1980"
  141. },
  142. { "authors" => [ "Nishizuka Y", "Seyama Y", "Ikai A",
  143. "Ishimura Y", "Kawaguchi A (eds)." ],
  144. "comments" => [ "(map 4)" ],
  145. "journal" => "Tokyo Kagaku Dojin",
  146. "title"=>"[Cellular Functions and Metabolic Maps] (In Japanese)",
  147. "year" => "1997"
  148. },
  149. { "authors" => [ "Michal G." ],
  150. "journal" => "Wiley",
  151. "title" => "Biochemical Pathways",
  152. "year" => "1999"
  153. },
  154. { "authors" => [ "Hove-Jensen B", "Rosenkrantz TJ",
  155. "Haldimann A", "Wanner BL." ],
  156. "journal" => "J Bacteriol",
  157. "pages" => "2793-801",
  158. "pubmed" => "12700258",
  159. "title" => "Escherichia coli phnN, encoding ribose 1,5-bisphosphokinase activity (phosphoribosyl diphosphate forming): dual role in phosphonate degradation and NAD biosynthesis pathways.",
  160. "volume" => "185",
  161. "year" => "2003"
  162. }
  163. ]
  164. expected = data.collect { |h| Bio::Reference.new(h) }
  165. assert_equal(expected, @obj.references)
  166. end
  167. def test_new
  168. assert_instance_of(Bio::KEGG::PATHWAY, @obj)
  169. end
  170. def test_entry_id
  171. assert_equal("map00030", @obj.entry_id)
  172. end
  173. def test_name
  174. assert_equal("Pentose phosphate pathway", @obj.name)
  175. end
  176. def test_description
  177. 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]."
  178. assert_equal(expected, @obj.description)
  179. end
  180. def test_keggclass
  181. expected = "Metabolism; Carbohydrate Metabolism"
  182. assert_equal(expected, @obj.keggclass)
  183. end
  184. def test_modules_as_strings
  185. expected =
  186. [ "M00004 Pentose phosphate pathway (Pentose phosphate cycle) [PATH:map00030]",
  187. "M00005 PRPP biosynthesis, ribose 5P -> PRPP [PATH:map00030]",
  188. "M00006 Pentose phosphate pathway, oxidative phase, glucose 6P => ribulose 5P [PATH:map00030]",
  189. "M00007 Pentose phosphate pathway, non-oxidative phase, fructose 6P => ribose 5P [PATH:map00030]",
  190. "M00008 Entner-Doudoroff pathway, glucose-6P => glyceraldehyde-3P + pyruvate [PATH:map00030]",
  191. "M00680 Semi-phosphorylative Entner-Doudoroff pathway, gluconate => glyceraldehyde-3P + pyruvate [PATH:map00030]",
  192. "M00681 Non-phosphorylative Entner-Doudoroff pathway, gluconate => glyceraldehyde + pyruvate [PATH:map00030]"
  193. ]
  194. assert_equal(expected, @obj.modules_as_strings)
  195. end
  196. def test_modules_as_hash
  197. expected = {
  198. "M00008" => "Entner-Doudoroff pathway, glucose-6P => glyceraldehyde-3P + pyruvate [PATH:map00030]",
  199. "M00680" => "Semi-phosphorylative Entner-Doudoroff pathway, gluconate => glyceraldehyde-3P + pyruvate [PATH:map00030]",
  200. "M00681" => "Non-phosphorylative Entner-Doudoroff pathway, gluconate => glyceraldehyde + pyruvate [PATH:map00030]",
  201. "M00004" => "Pentose phosphate pathway (Pentose phosphate cycle) [PATH:map00030]",
  202. "M00005" => "PRPP biosynthesis, ribose 5P -> PRPP [PATH:map00030]",
  203. "M00006" => "Pentose phosphate pathway, oxidative phase, glucose 6P => ribulose 5P [PATH:map00030]",
  204. "M00007" => "Pentose phosphate pathway, non-oxidative phase, fructose 6P => ribose 5P [PATH:map00030]"
  205. }
  206. assert_equal(expected, @obj.modules_as_hash)
  207. assert_equal(expected, @obj.modules)
  208. end
  209. def test_rel_pathways_as_strings
  210. expected = [ "map00010 Glycolysis / Gluconeogenesis",
  211. "map00040 Pentose and glucuronate interconversions",
  212. "map00230 Purine metabolism",
  213. "map00240 Pyrimidine metabolism",
  214. "map00340 Histidine metabolism" ]
  215. assert_equal(expected, @obj.rel_pathways_as_strings)
  216. end
  217. def test_rel_pathways_as_hash
  218. expected = {
  219. "map00240" => "Pyrimidine metabolism",
  220. "map00340" => "Histidine metabolism",
  221. "map00230" => "Purine metabolism",
  222. "map00010" => "Glycolysis / Gluconeogenesis",
  223. "map00040" => "Pentose and glucuronate interconversions"
  224. }
  225. assert_equal(expected, @obj.rel_pathways_as_hash)
  226. assert_equal(expected, @obj.rel_pathways)
  227. end
  228. def test_dblinks_as_strings
  229. assert_equal(["GO: 0006098"], @obj.dblinks_as_strings)
  230. end
  231. def test_dblinks_as_hash
  232. assert_equal({"GO"=>["0006098"]}, @obj.dblinks_as_hash)
  233. end
  234. def test_pathways_as_strings
  235. expected = ["map00030 Pentose phosphate pathway"]
  236. assert_equal(expected, @obj.pathways_as_strings)
  237. end
  238. def test_pathways_as_hash
  239. expected = {"map00030"=>"Pentose phosphate pathway"}
  240. assert_equal(expected, @obj.pathways_as_hash)
  241. end
  242. def test_orthologs_as_strings
  243. assert_equal([], @obj.orthologs_as_strings)
  244. end
  245. def test_orthologs_as_hash
  246. assert_equal({}, @obj.orthologs_as_hash)
  247. end
  248. def test_genes_as_strings
  249. assert_equal([], @obj.genes_as_strings)
  250. end
  251. def test_genes_as_hash
  252. assert_equal({}, @obj.genes_as_hash)
  253. end
  254. def test_diseases_as_strings
  255. expected = ["H00196 Phosphoribosylpyrophosphate synthetase I superactivity"]
  256. assert_equal(expected, @obj.diseases_as_strings)
  257. end
  258. def test_diseases_as_hash
  259. expected = {"H00196"=>"Phosphoribosylpyrophosphate synthetase I superactivity"}
  260. assert_equal(expected, @obj.diseases_as_hash)
  261. end
  262. def test_enzymes_as_strings
  263. assert_equal([], @obj.enzymes_as_strings)
  264. end
  265. def test_reactions_as_strings
  266. assert_equal([], @obj.reactions_as_strings)
  267. end
  268. def test_reactions_as_hash
  269. assert_equal({}, @obj.reactions_as_hash)
  270. end
  271. def test_compounds_as_strings
  272. assert_equal([], @obj.compounds_as_strings)
  273. end
  274. def test_compounds_as_hash
  275. assert_equal({}, @obj.compounds_as_hash)
  276. end
  277. def test_organism
  278. assert_equal("", @obj.organism)
  279. end
  280. def test_ko_pathway
  281. assert_equal("ko00030", @obj.ko_pathway)
  282. end
  283. end #class TestBioKEGGPATHWAY
  284. class TestBioKeggPathway_rn00250 < Test::Unit::TestCase
  285. def setup
  286. filename = File.join(BioRubyTestDataPath, 'KEGG', 'rn00250.pathway')
  287. @obj = Bio::KEGG::PATHWAY.new(File.read(filename))
  288. end
  289. def test_dblinks_as_hash
  290. expected = {"GO"=>["0006522", "0006531", "0006536"]}
  291. assert_equal(expected, @obj.dblinks_as_hash)
  292. end
  293. def test_pathways_as_hash
  294. expected = {"rn00250"=>"Alanine, aspartate and glutamate metabolism"}
  295. assert_equal(expected, @obj.pathways_as_hash)
  296. end
  297. def test_orthologs_as_hash
  298. assert_equal({}, @obj.orthologs_as_hash)
  299. end
  300. def test_genes_as_hash
  301. assert_equal({}, @obj.genes_as_hash)
  302. end
  303. def test_references
  304. data =
  305. [ { "authors" => [ "Nishizuka Y", "Seyama Y", "Ikai A",
  306. "Ishimura Y", "Kawaguchi A (eds)." ],
  307. "journal" => "Tokyo Kagaku Dojin",
  308. "title"=>"[Cellular Functions and Metabolic Maps] (In Japanese)",
  309. "year" => "1997"
  310. },
  311. { "authors" => [ "Wu G" ],
  312. "journal" => "J Nutr",
  313. "pages" => "1249-52",
  314. "pubmed" => "9687539",
  315. "title" => "Intestinal mucosal amino acid catabolism.",
  316. "volume" => "128",
  317. "year" => "1998"
  318. }
  319. ]
  320. expected = data.collect { |h| Bio::Reference.new(h) }
  321. assert_equal(expected, @obj.references)
  322. end
  323. def test_modules_as_hash
  324. expected = {
  325. "M00019"=>
  326. "Glutamate biosynthesis, oxoglutarete => glutamate (glutamate synthase) [PATH:rn00250]",
  327. "M00021"=>
  328. "Aspartate biosynthesis, oxaloacetate => aspartate [PATH:rn00250]",
  329. "M00044"=>
  330. "Aspartate degradation, aspartate => fumarate [PATH:rn00250]",
  331. "M00022"=>
  332. "Asparagine biosynthesis, aspartate => asparagine [PATH:rn00250]",
  333. "M00045"=>
  334. "Aspartate degradation, aspartate => oxaloacetate [PATH:rn00250]",
  335. "M00046"=>
  336. "Asparagine degradation, asparagine => aspartate +NH3 [PATH:rn00250]",
  337. "M00026"=>
  338. "Alanine biosynthesis, pyruvate => alanine [PATH:rn00250]",
  339. "M00038"=>
  340. "Glutamine degradation, glutamine => glutamate + NH3 [PATH:rn00250]",
  341. "M00040"=>
  342. "GABA (gamma-Aminobutyrate) shunt [PATH:rn00250]",
  343. "M00017"=>
  344. "Glutamate biosynthesis, oxoglutarate => glutamate (glutamate dehydrogenase) [PATH:rn00250]",
  345. "M00018"=>
  346. "Glutamine biosynthesis, glutamate => glutamine [PATH:rn00250]"
  347. }
  348. assert_equal(expected, @obj.modules_as_hash)
  349. end
  350. def test_new
  351. assert_kind_of(Bio::KEGG::PATHWAY, @obj)
  352. end
  353. def test_entry_id
  354. assert_equal("rn00250", @obj.entry_id)
  355. end
  356. def test_name
  357. expected = "Alanine, aspartate and glutamate metabolism"
  358. assert_equal(expected, @obj.name)
  359. end
  360. def test_description
  361. assert_equal("", @obj.description)
  362. end
  363. def test_keggclass
  364. expected = "Metabolism; Amino Acid Metabolism"
  365. assert_equal(expected, @obj.keggclass)
  366. end
  367. def test_pathways_as_strings
  368. expected = ["rn00250 Alanine, aspartate and glutamate metabolism"]
  369. assert_equal(expected, @obj.pathways_as_strings)
  370. end
  371. def test_modules_as_strings
  372. expected =
  373. [ "M00017 Glutamate biosynthesis, oxoglutarate => glutamate (glutamate dehydrogenase) [PATH:rn00250]",
  374. "M00018 Glutamine biosynthesis, glutamate => glutamine [PATH:rn00250]",
  375. "M00019 Glutamate biosynthesis, oxoglutarete => glutamate (glutamate synthase) [PATH:rn00250]",
  376. "M00021 Aspartate biosynthesis, oxaloacetate => aspartate [PATH:rn00250]",
  377. "M00022 Asparagine biosynthesis, aspartate => asparagine [PATH:rn00250]",
  378. "M00026 Alanine biosynthesis, pyruvate => alanine [PATH:rn00250]",
  379. "M00038 Glutamine degradation, glutamine => glutamate + NH3 [PATH:rn00250]",
  380. "M00040 GABA (gamma-Aminobutyrate) shunt [PATH:rn00250]",
  381. "M00044 Aspartate degradation, aspartate => fumarate [PATH:rn00250]",
  382. "M00045 Aspartate degradation, aspartate => oxaloacetate [PATH:rn00250]",
  383. "M00046 Asparagine degradation, asparagine => aspartate +NH3 [PATH:rn00250]"
  384. ]
  385. assert_equal(expected, @obj.modules_as_strings)
  386. end
  387. def test_diseases_as_strings
  388. expected = [ "H00074 Canavan disease (CD)",
  389. "H00185 Citrullinemia (CTLN)",
  390. "H00197 Adenylosuccinate lyase deficiency" ]
  391. assert_equal(expected, @obj.diseases_as_strings)
  392. end
  393. def test_diseases_as_hash
  394. expected = {
  395. "H00197"=>"Adenylosuccinate lyase deficiency",
  396. "H00074"=>"Canavan disease (CD)",
  397. "H00185"=>"Citrullinemia (CTLN)"
  398. }
  399. assert_equal(expected, @obj.diseases_as_hash)
  400. end
  401. def test_dblinks_as_strings
  402. expected = ["GO: 0006522 0006531 0006536"]
  403. assert_equal(expected, @obj.dblinks_as_strings)
  404. end
  405. def test_orthologs_as_strings
  406. assert_equal([], @obj.orthologs_as_strings)
  407. end
  408. def test_organism
  409. assert_equal("", @obj.organism)
  410. end
  411. def test_genes_as_strings
  412. assert_equal([], @obj.genes_as_strings)
  413. end
  414. def test_enzymes_as_strings
  415. assert_equal([], @obj.enzymes_as_strings)
  416. end
  417. def test_reactions_as_strings
  418. expected =
  419. [ "R00093 L-glutamate:NAD+ oxidoreductase (transaminating)",
  420. "R00114 L-Glutamate:NADP+ oxidoreductase (transaminating)",
  421. "R00149 Carbon-dioxide:ammonia ligase (ADP-forming,carbamate-phosphorylating)",
  422. "R00243 L-Glutamate:NAD+ oxidoreductase (deaminating)",
  423. "R00248 L-Glutamate:NADP+ oxidoreductase (deaminating)",
  424. "R00253 L-Glutamate:ammonia ligase (ADP-forming)",
  425. "R00256 L-Glutamine amidohydrolase",
  426. "R00258 L-Alanine:2-oxoglutarate aminotransferase",
  427. "R00261 L-glutamate 1-carboxy-lyase (4-aminobutanoate-forming)",
  428. "R00269 2-Oxoglutaramate amidohydrolase",
  429. "R00348 2-Oxosuccinamate amidohydrolase",
  430. "R00355 L-Aspartate:2-oxoglutarate aminotransferase",
  431. "R00357 L-Aspartic acid:oxygen oxidoreductase (deaminating)",
  432. "R00359 D-Aspartate:oxygen oxidoreductase (deaminating)",
  433. "R00369 L-Alanine:glyoxylate aminotransferase",
  434. "R00396 L-Alanine:NAD+ oxidoreductase (deaminating)",
  435. "R00397 L-aspartate 4-carboxy-lyase (L-alanine-forming)",
  436. "R00400 L-alanine:oxaloacetate aminotransferase",
  437. "R00483 L-aspartate:ammonia ligase (AMP-forming)",
  438. "R00484 N-Carbamoyl-L-aspartate amidohydrolase",
  439. "R00485 L-Asparagine amidohydrolase",
  440. "R00487 Acetyl-CoA:L-aspartate N-acetyltransferase",
  441. "R00488 N-Acetyl-L-aspartate amidohydrolase",
  442. "R00490 L-Aspartate ammonia-lyase",
  443. "R00491 aspartate racemase",
  444. "R00575 hydrogen-carbonate:L-glutamine amido-ligase (ADP-forming, carbamate-phosphorylating)",
  445. "R00576 L-Glutamine:pyruvate aminotransferase",
  446. "R00578 L-aspartate:L-glutamine amido-ligase (AMP-forming)",
  447. "R00707 (S)-1-pyrroline-5-carboxylate:NAD+ oxidoreductase",
  448. "R00708 (S)-1-pyrroline-5-carboxylate:NADP+ oxidoreductase",
  449. "R00713 Succinate-semialdehyde:NAD+ oxidoreductase",
  450. "R00714 Succinate-semialdehyde:NADP+ oxidoreductase",
  451. "R00768 L-glutamine:D-fructose-6-phosphate isomerase (deaminating)",
  452. "R01072 5-phosphoribosylamine:diphosphate phospho-alpha-D-ribosyltransferase (glutamate-amidating)",
  453. "R01083 N6-(1,2-dicarboxyethyl)AMP AMP-lyase (fumarate-forming)",
  454. "R01086 2-(Nomega-L-arginino)succinate arginine-lyase (fumarate-forming)",
  455. "R01135 IMP:L-aspartate ligase (GDP-forming)",
  456. "R01346 L-Asparagine:2-oxo-acid aminotransferase",
  457. "R01397 carbamoyl-phosphate:L-aspartate carbamoyltransferase",
  458. "R01648 4-Aminobutanoate:2-oxoglutarate aminotransferase",
  459. "R01954 L-Citrulline:L-aspartate ligase (AMP-forming)"
  460. ]
  461. assert_equal(expected, @obj.reactions_as_strings)
  462. end
  463. def test_reactions_as_hash
  464. expected = {
  465. "R01648"=>"4-Aminobutanoate:2-oxoglutarate aminotransferase",
  466. "R00485"=>"L-Asparagine amidohydrolase",
  467. "R00397"=>"L-aspartate 4-carboxy-lyase (L-alanine-forming)",
  468. "R00243"=>"L-Glutamate:NAD+ oxidoreductase (deaminating)",
  469. "R01397"=>"carbamoyl-phosphate:L-aspartate carbamoyltransferase",
  470. "R00707"=>"(S)-1-pyrroline-5-carboxylate:NAD+ oxidoreductase",
  471. "R00575"=>
  472. "hydrogen-carbonate:L-glutamine amido-ligase (ADP-forming, carbamate-phosphorylating)",
  473. "R00487"=>"Acetyl-CoA:L-aspartate N-acetyltransferase",
  474. "R00355"=>"L-Aspartate:2-oxoglutarate aminotransferase",
  475. "R00256"=>"L-Glutamine amidohydrolase",
  476. "R01135"=>"IMP:L-aspartate ligase (GDP-forming)",
  477. "R00708"=>"(S)-1-pyrroline-5-carboxylate:NADP+ oxidoreductase",
  478. "R00576"=>"L-Glutamine:pyruvate aminotransferase",
  479. "R00488"=>"N-Acetyl-L-aspartate amidohydrolase",
  480. "R00400"=>"L-alanine:oxaloacetate aminotransferase",
  481. "R00114"=>"L-Glutamate:NADP+ oxidoreductase (transaminating)",
  482. "R00093"=>"L-glutamate:NAD+ oxidoreductase (transaminating)",
  483. "R00490"=>"L-Aspartate ammonia-lyase",
  484. "R00357"=>"L-Aspartic acid:oxygen oxidoreductase (deaminating)",
  485. "R00269"=>"2-Oxoglutaramate amidohydrolase",
  486. "R00258"=>"L-Alanine:2-oxoglutarate aminotransferase",
  487. "R01346"=>"L-Asparagine:2-oxo-acid aminotransferase",
  488. "R01083"=>"N6-(1,2-dicarboxyethyl)AMP AMP-lyase (fumarate-forming)",
  489. "R01072"=>
  490. "5-phosphoribosylamine:diphosphate phospho-alpha-D-ribosyltransferase (glutamate-amidating)",
  491. "R00578"=>"L-aspartate:L-glutamine amido-ligase (AMP-forming)",
  492. "R00491"=>"aspartate racemase",
  493. "R00369"=>"L-Alanine:glyoxylate aminotransferase",
  494. "R00248"=>"L-Glutamate:NADP+ oxidoreductase (deaminating)",
  495. "R00149"=>
  496. "Carbon-dioxide:ammonia ligase (ADP-forming,carbamate-phosphorylating)",
  497. "R00359"=>"D-Aspartate:oxygen oxidoreductase (deaminating)",
  498. "R00348"=>"2-Oxosuccinamate amidohydrolase",
  499. "R00261"=>"L-glutamate 1-carboxy-lyase (4-aminobutanoate-forming)",
  500. "R01954"=>"L-Citrulline:L-aspartate ligase (AMP-forming)",
  501. "R01086"=>"2-(Nomega-L-arginino)succinate arginine-lyase (fumarate-forming)",
  502. "R00768"=>"L-glutamine:D-fructose-6-phosphate isomerase (deaminating)",
  503. "R00713"=>"Succinate-semialdehyde:NAD+ oxidoreductase",
  504. "R00483"=>"L-aspartate:ammonia ligase (AMP-forming)",
  505. "R00714"=>"Succinate-semialdehyde:NADP+ oxidoreductase",
  506. "R00484"=>"N-Carbamoyl-L-aspartate amidohydrolase",
  507. "R00396"=>"L-Alanine:NAD+ oxidoreductase (deaminating)",
  508. "R00253"=>"L-Glutamate:ammonia ligase (ADP-forming)"
  509. }
  510. assert_equal(expected, @obj.reactions_as_hash)
  511. end
  512. def test_compounds_as_strings
  513. expected =
  514. [ "C00014 NH3",
  515. "C00022 Pyruvate",
  516. "C00025 L-Glutamate",
  517. "C00026 2-Oxoglutarate",
  518. "C00036 Oxaloacetate",
  519. "C00041 L-Alanine",
  520. "C00042 Succinate",
  521. "C00049 L-Aspartate",
  522. "C00064 L-Glutamine",
  523. "C00122 Fumarate",
  524. "C00152 L-Asparagine",
  525. "C00169 Carbamoyl phosphate",
  526. "C00232 Succinate semialdehyde",
  527. "C00334 4-Aminobutanoate",
  528. "C00352 D-Glucosamine 6-phosphate",
  529. "C00402 D-Aspartate",
  530. "C00438 N-Carbamoyl-L-aspartate",
  531. "C00940 2-Oxoglutaramate",
  532. "C01042 N-Acetyl-L-aspartate",
  533. "C02362 2-Oxosuccinamate",
  534. "C03090 5-Phosphoribosylamine",
  535. "C03406 N-(L-Arginino)succinate",
  536. "C03794 N6-(1,2-Dicarboxyethyl)-AMP",
  537. "C03912 (S)-1-Pyrroline-5-carboxylate"
  538. ]
  539. assert_equal(expected, @obj.compounds_as_strings)
  540. end
  541. def test_compounds_as_hash
  542. expected = {
  543. "C02362"=>"2-Oxosuccinamate",
  544. "C01042"=>"N-Acetyl-L-aspartate",
  545. "C00041"=>"L-Alanine",
  546. "C03912"=>"(S)-1-Pyrroline-5-carboxylate",
  547. "C03406"=>"N-(L-Arginino)succinate",
  548. "C00438"=>"N-Carbamoyl-L-aspartate",
  549. "C00152"=>"L-Asparagine",
  550. "C00064"=>"L-Glutamine",
  551. "C00042"=>"Succinate",
  552. "C00352"=>"D-Glucosamine 6-phosphate",
  553. "C00022"=>"Pyruvate",
  554. "C03794"=>"N6-(1,2-Dicarboxyethyl)-AMP",
  555. "C03090"=>"5-Phosphoribosylamine",
  556. "C00232"=>"Succinate semialdehyde",
  557. "C00122"=>"Fumarate",
  558. "C00036"=>"Oxaloacetate",
  559. "C00025"=>"L-Glutamate",
  560. "C00014"=>"NH3",
  561. "C00334"=>"4-Aminobutanoate",
  562. "C00169"=>"Carbamoyl phosphate",
  563. "C00026"=>"2-Oxoglutarate",
  564. "C00940"=>"2-Oxoglutaramate",
  565. "C00049"=>"L-Aspartate",
  566. "C00402"=>"D-Aspartate"
  567. }
  568. assert_equal(expected, @obj.compounds_as_hash)
  569. end
  570. def test_rel_pathways_as_strings
  571. expected =
  572. [ "rn00010 Glycolysis / Gluconeogenesis",
  573. "rn00020 Citrate cycle (TCA cycle)",
  574. "rn00230 Purine metabolism",
  575. "rn00240 Pyrimidine metabolism",
  576. "rn00253 Tetracycline biosynthesis",
  577. "rn00260 Glycine, serine and threonine metabolism",
  578. "rn00300 Lysine biosynthesis",
  579. "rn00330 Arginine and proline metabolism",
  580. "rn00340 Histidine metabolism",
  581. "rn00410 beta-Alanine metabolism",
  582. "rn00460 Cyanoamino acid metabolism",
  583. "rn00471 D-Glutamine and D-glutamate metabolism",
  584. "rn00473 D-Alanine metabolism",
  585. "rn00480 Glutathione metabolism",
  586. "rn00650 Butanoate metabolism",
  587. "rn00660 C5-Branched dibasic acid metabolism",
  588. "rn00760 Nicotinate and nicotinamide metabolism",
  589. "rn00770 Pantothenate and CoA biosynthesis",
  590. "rn00860 Porphyrin and chlorophyll metabolism",
  591. "rn00910 Nitrogen metabolism"
  592. ]
  593. assert_equal(expected, @obj.rel_pathways_as_strings)
  594. end
  595. def test_rel_pathways_as_hash
  596. expected = {
  597. "rn00770"=>"Pantothenate and CoA biosynthesis",
  598. "rn00660"=>"C5-Branched dibasic acid metabolism",
  599. "rn00473"=>"D-Alanine metabolism",
  600. "rn00330"=>"Arginine and proline metabolism",
  601. "rn00253"=>"Tetracycline biosynthesis",
  602. "rn00760"=>"Nicotinate and nicotinamide metabolism",
  603. "rn00650"=>"Butanoate metabolism",
  604. "rn00860"=>"Porphyrin and chlorophyll metabolism",
  605. "rn00410"=>"beta-Alanine metabolism",
  606. "rn00300"=>"Lysine biosynthesis",
  607. "rn00480"=>"Glutathione metabolism",
  608. "rn00260"=>"Glycine, serine and threonine metabolism",
  609. "rn00910"=>"Nitrogen metabolism",
  610. "rn00471"=>"D-Glutamine and D-glutamate metabolism",
  611. "rn00460"=>"Cyanoamino acid metabolism",
  612. "rn00240"=>"Pyrimidine metabolism",
  613. "rn00020"=>"Citrate cycle (TCA cycle)",
  614. "rn00340"=>"Histidine metabolism",
  615. "rn00230"=>"Purine metabolism",
  616. "rn00010"=>"Glycolysis / Gluconeogenesis"}
  617. assert_equal(expected, @obj.rel_pathways_as_hash)
  618. end
  619. def test_ko_pathway
  620. assert_equal("ko00250", @obj.ko_pathway)
  621. end
  622. end #class TestBioKeggPathway_rn00250
  623. class TestBioKEGGPATHWAY_ec00072 < Test::Unit::TestCase
  624. def setup
  625. filename = File.join(BioRubyTestDataPath, 'KEGG', 'ec00072.pathway')
  626. @obj = Bio::KEGG::PATHWAY.new(File.read(filename))
  627. end
  628. def test_dblinks_as_hash
  629. assert_equal({}, @obj.dblinks_as_hash)
  630. end
  631. def test_pathways_as_hash
  632. expected = {"ec00072"=>"Synthesis and degradation of ketone bodies"}
  633. assert_equal(expected, @obj.pathways_as_hash)
  634. end
  635. def test_orthologs_as_hash
  636. assert_equal({}, @obj.orthologs_as_hash)
  637. end
  638. def test_genes_as_hash
  639. assert_equal({}, @obj.genes_as_hash)
  640. end
  641. def test_references
  642. assert_equal([], @obj.references)
  643. end
  644. def test_modules_as_hash
  645. expected = { "M00177" =>
  646. "Ketone body biosynthesis, acetyl-CoA => acetoacetate/3-hydroxybutyrate/acetone [PATH:ec00072]" }
  647. assert_equal(expected, @obj.modules_as_hash)
  648. end
  649. def test_new
  650. assert_kind_of(Bio::KEGG::PATHWAY, @obj)
  651. end
  652. def test_entry_id
  653. assert_equal("ec00072", @obj.entry_id)
  654. end
  655. def test_name
  656. expected = "Synthesis and degradation of ketone bodies"
  657. assert_equal(expected, @obj.name)
  658. end
  659. def test_description
  660. assert_equal("", @obj.description)
  661. end
  662. def test_keggclass
  663. expected = "Metabolism; Lipid Metabolism"
  664. assert_equal(expected, @obj.keggclass)
  665. end
  666. def test_pathways_as_strings
  667. expected = ["ec00072 Synthesis and degradation of ketone bodies"]
  668. assert_equal(expected, @obj.pathways_as_strings)
  669. end
  670. def test_modules_as_strings
  671. expected = ["M00177 Ketone body biosynthesis, acetyl-CoA => acetoacetate/3-hydroxybutyrate/acetone [PATH:ec00072]"]
  672. assert_equal(expected, @obj.modules_as_strings)
  673. end
  674. def test_diseases_as_strings
  675. assert_equal([], @obj.diseases_as_strings)
  676. end
  677. def test_diseases_as_hash
  678. assert_equal({}, @obj.diseases_as_hash)
  679. end
  680. def test_dblinks_as_strings
  681. assert_equal([], @obj.dblinks_as_strings)
  682. end
  683. def test_orthologs_as_strings
  684. assert_equal([], @obj.orthologs_as_strings)
  685. end
  686. def test_organism
  687. assert_equal("", @obj.organism)
  688. end
  689. def test_genes_as_strings
  690. assert_equal([], @obj.genes_as_strings)
  691. end
  692. def test_enzymes_as_strings
  693. expected = [ "1.1.1.30", "2.3.1.9", "2.3.3.10", "2.8.3.5",
  694. "4.1.1.4", "4.1.3.4" ]
  695. assert_equal(expected, @obj.enzymes_as_strings)
  696. end
  697. def test_reactions_as_strings
  698. assert_equal([], @obj.reactions_as_strings)
  699. end
  700. def test_reactions_as_hash
  701. assert_equal({}, @obj.reactions_as_hash)
  702. end
  703. def test_compounds_as_strings
  704. expected =
  705. [ "C00024 Acetyl-CoA",
  706. "C00164 Acetoacetate",
  707. "C00207 Acetone",
  708. "C00332 Acetoacetyl-CoA",
  709. "C00356 (S)-3-Hydroxy-3-methylglutaryl-CoA",
  710. "C01089 (R)-3-Hydroxybutanoate"
  711. ]
  712. assert_equal(expected, @obj.compounds_as_strings)
  713. end
  714. def test_compounds_as_hash
  715. expected = {
  716. "C00207"=>"Acetone",
  717. "C00164"=>"Acetoacetate",
  718. "C01089"=>"(R)-3-Hydroxybutanoate",
  719. "C00332"=>"Acetoacetyl-CoA",
  720. "C00024"=>"Acetyl-CoA",
  721. "C00356"=>"(S)-3-Hydroxy-3-methylglutaryl-CoA"
  722. }
  723. assert_equal(expected, @obj.compounds_as_hash)
  724. end
  725. def test_rel_pathways_as_strings
  726. expected =
  727. [ "ec00010 Glycolysis / Gluconeogenesis",
  728. "ec00071 Fatty acid metabolism",
  729. "ec00620 Pyruvate metabolism",
  730. "ec00650 Butanoate metabolism"
  731. ]
  732. assert_equal(expected, @obj.rel_pathways_as_strings)
  733. end
  734. def test_rel_pathways_as_hash
  735. expected = {
  736. "ec00620"=>"Pyruvate metabolism",
  737. "ec00071"=>"Fatty acid metabolism",
  738. "ec00010"=>"Glycolysis / Gluconeogenesis",
  739. "ec00650"=>"Butanoate metabolism"
  740. }
  741. assert_equal(expected, @obj.rel_pathways_as_hash)
  742. end
  743. def test_ko_pathway
  744. assert_equal("ko00072", @obj.ko_pathway)
  745. end
  746. end #class TestBioKEGGPATHWAY_ec00072
  747. class TestBioKEGGPATHWAY_hsa00790 < Test::Unit::TestCase
  748. def setup
  749. filename = File.join(BioRubyTestDataPath, 'KEGG', 'hsa00790.pathway')
  750. @obj = Bio::KEGG::PATHWAY.new(File.read(filename))
  751. end
  752. def test_dblinks_as_hash
  753. assert_equal({"GO"=>["0046656"]}, @obj.dblinks_as_hash)
  754. end
  755. def test_pathways_as_hash
  756. expected = {"hsa00790"=>"Folate biosynthesis"}
  757. assert_equal(expected, @obj.pathways_as_hash)
  758. end
  759. def test_orthologs_as_hash
  760. assert_equal({}, @obj.orthologs_as_hash)
  761. end
  762. def test_genes_as_hash
  763. expected = {
  764. "248" => "ALPI, IAP [KO:K01077] [EC:3.1.3.1]",
  765. "6697" => "SPR, SDR38C1 [KO:K00072] [EC:1.1.1.153]",
  766. "249" =>
  767. "ALPL, AP-TNAP, APTNAP, FLJ40094, FLJ93059, HOPS, MGC161443, MGC167935, TNAP, TNSALP [KO:K01077] [EC:3.1.3.1]",
  768. "2356" => "FPGS [KO:K01930] [EC:6.3.2.17]",
  769. "250" => "ALPP, ALP, FLJ61142, PALP, PLAP [KO:K01077] [EC:3.1.3.1]",
  770. "1719" => "DHFR, DHFRP1, DYR [KO:K00287] [EC:1.5.1.3]",
  771. "251" => "ALPPL2, ALPG, ALPPL, GCAP [KO:K01077] [EC:3.1.3.1]",
  772. "2643" =>
  773. "GCH1, DYT14, DYT5, DYT5a, GCH, GTP-CH-1, GTPCH1, HPABH4B [KO:K01495] [EC:3.5.4.16]",
  774. "8836" => "GGH, GH [KO:K01307] [EC:3.4.19.9]",
  775. "5860" =>
  776. "QDPR, DHPR, FLJ42391, PKU2, SDR33C1 [KO:K00357] [EC:1.5.1.34]",
  777. "5805" => "PTS, FLJ97081, PTPS [KO:K01737] [EC:4.2.3.12]"
  778. }
  779. assert_equal(expected, @obj.genes_as_hash)
  780. end
  781. def test_references
  782. assert_equal([], @obj.references)
  783. end
  784. def test_modules_as_hash
  785. expected = {
  786. "M00251"=>"Folate biosynthesis, GTP => THF [PATH:hsa00790]",
  787. "M00304"=>"Methanogenesis [PATH:hsa00790]"
  788. }
  789. assert_equal(expected, @obj.modules_as_hash)
  790. end
  791. def test_new
  792. assert_instance_of(Bio::KEGG::PATHWAY, @obj)
  793. end
  794. def test_entry_id
  795. assert_equal("hsa00790", @obj.entry_id)
  796. end
  797. def test_name
  798. expected = "Folate biosynthesis - Homo sapiens (human)"
  799. assert_equal(expected, @obj.name)
  800. end
  801. def test_description
  802. assert_equal("", @obj.description)
  803. end
  804. def test_keggclass
  805. expected = "Metabolism; Metabolism of Cofactors and Vitamins"
  806. assert_equal(expected, @obj.keggclass)
  807. end
  808. def test_pathways_as_strings
  809. expected = ["hsa00790 Folate biosynthesis"]
  810. assert_equal(expected, @obj.pathways_as_strings)
  811. end
  812. def test_modules_as_strings
  813. expected = ["M00251 Folate biosynthesis, GTP => THF [PATH:hsa00790]",
  814. "M00304 Methanogenesis [PATH:hsa00790]"]
  815. assert_equal(expected, @obj.modules_as_strings)
  816. end
  817. def test_diseases_as_strings
  818. expected = [ "H00167 Phenylketonuria (PKU)",
  819. "H00213 Hypophosphatasia" ]
  820. assert_equal(expected, @obj.diseases_as_strings)
  821. end
  822. def test_diseases_as_hash
  823. expected = {
  824. "H00167"=>"Phenylketonuria (PKU)",
  825. "H00213"=>"Hypophosphatasia"
  826. }
  827. assert_equal(expected, @obj.diseases_as_hash)
  828. end
  829. def test_dblinks_as_strings
  830. assert_equal(["GO: 0046656"], @obj.dblinks_as_strings)
  831. end
  832. def test_orthologs_as_strings
  833. assert_equal([], @obj.orthologs_as_strings)
  834. end
  835. def test_organism
  836. expected = "Homo sapiens (human) [GN:hsa]"
  837. assert_equal(expected, @obj.organism)
  838. end
  839. def test_genes_as_strings
  840. expected =
  841. [ "2643 GCH1, DYT14, DYT5, DYT5a, GCH, GTP-CH-1, GTPCH1, HPABH4B [KO:K01495] [EC:3.5.4.16]",
  842. "248 ALPI, IAP [KO:K01077] [EC:3.1.3.1]",
  843. "249 ALPL, AP-TNAP, APTNAP, FLJ40094, FLJ93059, HOPS, MGC161443, MGC167935, TNAP, TNSALP [KO:K01077] [EC:3.1.3.1]",
  844. "250 ALPP, ALP, FLJ61142, PALP, PLAP [KO:K01077] [EC:3.1.3.1]",
  845. "251 ALPPL2, ALPG, ALPPL, GCAP [KO:K01077] [EC:3.1.3.1]",
  846. "1719 DHFR, DHFRP1, DYR [KO:K00287] [EC:1.5.1.3]",
  847. "2356 FPGS [KO:K01930] [EC:6.3.2.17]",
  848. "8836 GGH, GH [KO:K01307] [EC:3.4.19.9]",
  849. "5805 PTS, FLJ97081, PTPS [KO:K01737] [EC:4.2.3.12]",
  850. "6697 SPR, SDR38C1 [KO:K00072] [EC:1.1.1.153]",
  851. "5860 QDPR, DHPR, FLJ42391, PKU2, SDR33C1 [KO:K00357] [EC:1.5.1.34]"
  852. ]
  853. assert_equal(expected, @obj.genes_as_strings)
  854. end
  855. def test_enzymes_as_strings
  856. assert_equal([], @obj.enzymes_as_strings)
  857. end
  858. def test_reactions_as_strings
  859. assert_equal([], @obj.reactions_as_strings)
  860. end
  861. def test_reactions_as_hash
  862. assert_equal({}, @obj.reactions_as_hash)
  863. end
  864. def test_compounds_as_strings
  865. expected =
  866. [ "C00044 GTP",
  867. "C00101 Tetrahydrofolate",
  868. "C00251 Chorismate",
  869. "C00266 Glycolaldehyde",
  870. "C00268 Dihydrobiopterin",
  871. "C00272 Tetrahydrobiopterin",
  872. "C00415 Dihydrofolate",
  873. "C00504 Folate",
  874. "C00568 4-Aminobenzoate",
  875. "C00921 Dihydropteroate",
  876. "C01217 5,6,7,8-Tetrahydromethanopterin",
  877. "C01300 2-Amino-4-hydroxy-6-hydroxymethyl-7,8-dihydropteridine",
  878. "C03541 Tetrahydrofolyl-[Glu](n)",
  879. "C03684 6-Pyruvoyltetrahydropterin",
  880. "C04244 6-Lactoyl-5,6,7,8-tetrahydropterin",
  881. "C04807 2-Amino-7,8-dihydro-4-hydroxy-6-(diphosphooxymethyl)pteridine",
  882. "C04874 2-Amino-4-hydroxy-6-(D-erythro-1,2,3-trihydroxypropyl)-7,8-dihydropteridine",
  883. "C04895 2-Amino-4-hydroxy-6-(erythro-1,2,3-trihydroxypropyl)dihydropteridine triphosphate",
  884. "C05922 Formamidopyrimidine nucleoside triphosphate",
  885. "C05923 2,5-Diaminopyrimidine nucleoside triphosphate",
  886. "C05924 Molybdopterin",
  887. "C05925 Dihydroneopterin phosphate",
  888. "C05926 Neopterin",
  889. "C05927 7,8-Dihydromethanopterin",
  890. "C06148 2,5-Diamino-6-(5'-triphosphoryl-3',4'-trihydroxy-2'-oxopentyl)-amino-4-oxopyrimidine",
  891. "C06149 6-(3'-Triphosphoryl-1'-methylglyceryl)-7-methyl-7,8-dihydrobiopterin",
  892. "C09332 Tetrahydrofolyl-[Glu](2)",
  893. "C11355 4-Amino-4-deoxychorismate"
  894. ]
  895. assert_equal(expected, @obj.compounds_as_strings)
  896. end
  897. def test_compounds_as_hash
  898. expected = {
  899. "C05925"=>"Dihydroneopterin phosphate",
  900. "C04244"=>"6-Lactoyl-5,6,7,8-tetrahydropterin",
  901. "C01217"=>"5,6,7,8-Tetrahydromethanopterin",
  902. "C00568"=>"4-Aminobenzoate",
  903. "C05926"=>"Neopterin",
  904. "C00921"=>"Dihydropteroate",
  905. "C00415"=>"Dihydrofolate",
  906. "C00272"=>"Tetrahydrobiopterin",
  907. "C05927"=>"7,8-Dihydromethanopterin",
  908. "C04895"=>
  909. "2-Amino-4-hydroxy-6-(erythro-1,2,3-trihydroxypropyl)dihydropteridine triphosphate",
  910. "C04807"=>"2-Amino-7,8-dihydro-4-hydroxy-6-(diphosphooxymethyl)pteridine",
  911. "C00504"=>"Folate",
  912. "C00251"=>"Chorismate",
  913. "C06148"=>
  914. "2,5-Diamino-6-(5'-triphosphoryl-3',4'-trihydroxy-2'-oxopentyl)-amino-4-oxopyrimidine",
  915. "C04874"=>
  916. "2-Amino-4-hydroxy-6-(D-erythro-1,2,3-trihydroxypropyl)-7,8-dihydropteridine",
  917. "C06149"=>
  918. "6-(3'-Triphosphoryl-1'-methylglyceryl)-7-methyl-7,8-dihydrobiopterin",
  919. "C00044"=>"GTP",
  920. "C03684"=>"6-Pyruvoyltetrahydropterin",
  921. "C03541"=>"Tetrahydrofolyl-[Glu](n)",
  922. "C01300"=>"2-Amino-4-hydroxy-6-hydroxymethyl-7,8-dihydropteridine",
  923. "C00266"=>"Glycolaldehyde",
  924. "C00101"=>"Tetrahydrofolate",
  925. "C05922"=>"Formamidopyrimidine nucleoside triphosphate",
  926. "C00268"=>"Dihydrobiopterin",
  927. "C11355"=>"4-Amino-4-deoxychorismate",
  928. "C05923"=>"2,5-Diaminopyrimidine nucleoside triphosphate",
  929. "C09332"=>"Tetrahydrofolyl-[Glu](2)",
  930. "C05924"=>"Molybdopterin"
  931. }
  932. assert_equal(expected, @obj.compounds_as_hash)
  933. end
  934. def test_rel_pathways_as_strings
  935. expected =
  936. [ "hsa00230 Purine metabolism",
  937. "hsa00400 Phenylalanine, tyrosine and tryptophan biosynthesis",
  938. "hsa00670 One carbon pool by folate",
  939. "hsa00680 Methane metabolism"
  940. ]
  941. assert_equal(expected, @obj.rel_pathways_as_strings)
  942. end
  943. def test_rel_pathways_as_hash
  944. expected = {
  945. "hsa00680"=>"Methane metabolism",
  946. "hsa00670"=>"One carbon pool by folate",
  947. "hsa00230"=>"Purine metabolism",
  948. "hsa00400"=>"Phenylalanine, tyrosine and tryptophan biosynthesis"
  949. }
  950. assert_equal(expected, @obj.rel_pathways_as_hash)
  951. end
  952. def test_ko_pathway
  953. assert_equal("ko00790", @obj.ko_pathway)
  954. end
  955. end #class TestBioKEGGPATHWAY_hsa00790
  956. class TestBioKEGGPATHWAY_ko00312 < Test::Unit::TestCase
  957. def setup
  958. filename = File.join(BioRubyTestDataPath, 'KEGG', 'ko00312.pathway')
  959. @obj = Bio::KEGG::PATHWAY.new(File.read(filename))
  960. end
  961. def test_dblinks_as_hash
  962. assert_equal({}, @obj.dblinks_as_hash)
  963. end
  964. def test_pathways_as_hash
  965. expected = {"ko00312"=>"beta-Lactam resistance"}
  966. assert_equal(expected, @obj.pathways_as_hash)
  967. end
  968. def test_orthologs_as_hash
  969. expected = {
  970. "K02545"=>"penicillin-binding protein 2 prime",
  971. "K02172"=>"bla regulator protein blaR1",
  972. "K02546"=>"methicillin resistance regulatory protein",
  973. "K02547"=>"methicillin resistance protein",
  974. "K02352"=>"drp35",
  975. "K01467"=>"beta-lactamase [EC:3.5.2.6]",
  976. "K02171"=>"penicillinase repressor"
  977. }
  978. assert_equal(expected, @obj.orthologs_as_hash)
  979. end
  980. def test_genes_as_hash
  981. assert_equal({}, @obj.genes_as_hash)
  982. end
  983. def test_references
  984. assert_equal([], @obj.references)
  985. end
  986. def test_modules_as_hash
  987. assert_equal({}, @obj.modules_as_hash)
  988. end
  989. def test_new
  990. assert_instance_of(Bio::KEGG::PATHWAY, @obj)
  991. end
  992. def test_entry_id
  993. assert_equal("ko00312", @obj.entry_id)
  994. end
  995. def test_name
  996. assert_equal("beta-Lactam resistance", @obj.name)
  997. end
  998. def test_description
  999. assert_equal("", @obj.description)
  1000. end
  1001. def test_keggclass
  1002. expected = "Metabolism; Biosynthesis of Other Secondary Metabolites"
  1003. assert_equal(expected, @obj.keggclass)
  1004. end
  1005. def test_pathways_as_strings
  1006. expected = ["ko00312 beta-Lactam resistance"]
  1007. assert_equal(expected, @obj.pathways_as_strings)
  1008. end
  1009. def test_modules_as_strings
  1010. assert_equal([], @obj.modules_as_strings)
  1011. end
  1012. def test_diseases_as_strings
  1013. assert_equal([], @obj.diseases_as_strings)
  1014. end
  1015. def test_diseases_as_hash
  1016. assert_equal({}, @obj.diseases_as_hash)
  1017. end
  1018. def test_dblinks_as_strings
  1019. assert_equal([], @obj.dblinks_as_strings)
  1020. end
  1021. def test_orthologs_as_strings
  1022. expected =
  1023. [ "K02172 bla regulator protein blaR1",
  1024. "K02171 penicillinase repressor",
  1025. "K01467 beta-lactamase [EC:3.5.2.6]",
  1026. "K02352 drp35",
  1027. "K02547 methicillin resistance protein",
  1028. "K02546 methicillin resistance regulatory protein",
  1029. "K02545 penicillin-binding protein 2 prime"
  1030. ]
  1031. assert_equal(expected, @obj.orthologs_as_strings)
  1032. end
  1033. def test_organism
  1034. assert_equal("", @obj.organism)
  1035. end
  1036. def test_genes_as_strings
  1037. assert_equal([], @obj.genes_as_strings)
  1038. end
  1039. def test_enzymes_as_strings
  1040. assert_equal([], @obj.enzymes_as_strings)
  1041. end
  1042. def test_reactions_as_strings
  1043. assert_equal([], @obj.reactions_as_strings)
  1044. end
  1045. def test_reactions_as_hash
  1046. assert_equal({}, @obj.reactions_as_hash)
  1047. end
  1048. def test_compounds_as_strings
  1049. expected = ["C00039 DNA", "C03438 beta-Lactam antibiotics"]
  1050. assert_equal(expected, @obj.compounds_as_strings)
  1051. end
  1052. def test_compounds_as_hash
  1053. expected = {"C03438"=>"beta-Lactam antibiotics", "C00039"=>"DNA"}
  1054. assert_equal(expected, @obj.compounds_as_hash)
  1055. end
  1056. def test_rel_pathways_as_strings
  1057. expected = ["ko00311 Penicillin and cephalosporin biosynthesis"]
  1058. assert_equal(expected, @obj.rel_pathways_as_strings)
  1059. end
  1060. def test_rel_pathways_as_hash
  1061. expected = {"ko00311"=>"Penicillin and cephalosporin biosynthesis"}
  1062. assert_equal(expected, @obj.rel_pathways_as_hash)
  1063. end
  1064. def test_ko_pathway
  1065. assert_equal("", @obj.ko_pathway)
  1066. end
  1067. end #class TestBioKEGGPATHWAY_ko00312
  1068. end #module Bio