bio 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. data/ChangeLog +2105 -3728
  2. data/KNOWN_ISSUES.rdoc +35 -3
  3. data/README.rdoc +8 -2
  4. data/RELEASE_NOTES.rdoc +166 -0
  5. data/bin/bioruby +4 -1
  6. data/bioruby.gemspec +146 -1
  7. data/bioruby.gemspec.erb +3 -1
  8. data/doc/ChangeLog-before-1.3.1 +3961 -0
  9. data/doc/Tutorial.rd +154 -22
  10. data/doc/Tutorial.rd.html +125 -68
  11. data/lib/bio.rb +21 -6
  12. data/lib/bio/appl/bl2seq/report.rb +11 -202
  13. data/lib/bio/appl/blast/format0.rb +0 -193
  14. data/lib/bio/appl/blast/report.rb +2 -147
  15. data/lib/bio/appl/blast/wublast.rb +0 -208
  16. data/lib/bio/appl/fasta.rb +4 -19
  17. data/lib/bio/appl/fasta/format10.rb +0 -14
  18. data/lib/bio/appl/genscan/report.rb +0 -176
  19. data/lib/bio/appl/hmmer.rb +1 -15
  20. data/lib/bio/appl/hmmer/report.rb +0 -100
  21. data/lib/bio/appl/meme/mast.rb +156 -0
  22. data/lib/bio/appl/meme/mast/report.rb +91 -0
  23. data/lib/bio/appl/meme/motif.rb +48 -0
  24. data/lib/bio/appl/psort.rb +0 -111
  25. data/lib/bio/appl/psort/report.rb +1 -45
  26. data/lib/bio/appl/pts1.rb +2 -4
  27. data/lib/bio/appl/sosui/report.rb +5 -54
  28. data/lib/bio/appl/targetp/report.rb +1 -104
  29. data/lib/bio/appl/tmhmm/report.rb +0 -36
  30. data/lib/bio/command.rb +94 -10
  31. data/lib/bio/data/aa.rb +1 -77
  32. data/lib/bio/data/codontable.rb +1 -95
  33. data/lib/bio/data/na.rb +1 -26
  34. data/lib/bio/db/aaindex.rb +1 -38
  35. data/lib/bio/db/fasta.rb +1 -134
  36. data/lib/bio/db/fasta/format_qual.rb +204 -0
  37. data/lib/bio/db/fasta/qual.rb +102 -0
  38. data/lib/bio/db/fastq.rb +645 -0
  39. data/lib/bio/db/fastq/fastq_to_biosequence.rb +40 -0
  40. data/lib/bio/db/fastq/format_fastq.rb +175 -0
  41. data/lib/bio/db/genbank/genbank.rb +1 -86
  42. data/lib/bio/db/gff.rb +0 -17
  43. data/lib/bio/db/go.rb +4 -72
  44. data/lib/bio/db/kegg/common.rb +112 -0
  45. data/lib/bio/db/kegg/compound.rb +29 -20
  46. data/lib/bio/db/kegg/drug.rb +74 -34
  47. data/lib/bio/db/kegg/enzyme.rb +26 -5
  48. data/lib/bio/db/kegg/genes.rb +128 -15
  49. data/lib/bio/db/kegg/genome.rb +3 -41
  50. data/lib/bio/db/kegg/glycan.rb +19 -24
  51. data/lib/bio/db/kegg/orthology.rb +16 -56
  52. data/lib/bio/db/kegg/reaction.rb +81 -28
  53. data/lib/bio/db/kegg/taxonomy.rb +1 -52
  54. data/lib/bio/db/litdb.rb +1 -16
  55. data/lib/bio/db/phyloxml/phyloxml.xsd +582 -0
  56. data/lib/bio/db/phyloxml/phyloxml_elements.rb +1174 -0
  57. data/lib/bio/db/phyloxml/phyloxml_parser.rb +954 -0
  58. data/lib/bio/db/phyloxml/phyloxml_writer.rb +228 -0
  59. data/lib/bio/db/prosite.rb +2 -95
  60. data/lib/bio/db/rebase.rb +5 -6
  61. data/lib/bio/db/sanger_chromatogram/abif.rb +120 -0
  62. data/lib/bio/db/sanger_chromatogram/chromatogram.rb +133 -0
  63. data/lib/bio/db/sanger_chromatogram/chromatogram_to_biosequence.rb +32 -0
  64. data/lib/bio/db/sanger_chromatogram/scf.rb +210 -0
  65. data/lib/bio/io/das.rb +0 -44
  66. data/lib/bio/io/ddbjxml.rb +1 -181
  67. data/lib/bio/io/flatfile.rb +1 -7
  68. data/lib/bio/io/flatfile/autodetection.rb +6 -0
  69. data/lib/bio/io/keggapi.rb +0 -442
  70. data/lib/bio/io/ncbirest.rb +130 -132
  71. data/lib/bio/io/ncbisoap.rb +2 -1
  72. data/lib/bio/io/pubmed.rb +0 -88
  73. data/lib/bio/location.rb +0 -73
  74. data/lib/bio/pathway.rb +0 -171
  75. data/lib/bio/sequence.rb +18 -1
  76. data/lib/bio/sequence/adapter.rb +3 -0
  77. data/lib/bio/sequence/format.rb +16 -0
  78. data/lib/bio/sequence/quality_score.rb +205 -0
  79. data/lib/bio/tree.rb +70 -5
  80. data/lib/bio/util/restriction_enzyme/single_strand.rb +3 -2
  81. data/lib/bio/util/sirna.rb +1 -23
  82. data/lib/bio/version.rb +1 -1
  83. data/sample/demo_aaindex.rb +67 -0
  84. data/sample/demo_aminoacid.rb +101 -0
  85. data/sample/demo_bl2seq_report.rb +220 -0
  86. data/sample/demo_blast_report.rb +285 -0
  87. data/sample/demo_codontable.rb +119 -0
  88. data/sample/demo_das.rb +105 -0
  89. data/sample/demo_ddbjxml.rb +212 -0
  90. data/sample/demo_fasta_remote.rb +51 -0
  91. data/sample/demo_fastaformat.rb +105 -0
  92. data/sample/demo_genbank.rb +132 -0
  93. data/sample/demo_genscan_report.rb +202 -0
  94. data/sample/demo_gff1.rb +49 -0
  95. data/sample/demo_go.rb +98 -0
  96. data/sample/demo_hmmer_report.rb +149 -0
  97. data/sample/demo_kegg_compound.rb +57 -0
  98. data/sample/demo_kegg_drug.rb +65 -0
  99. data/sample/demo_kegg_genome.rb +74 -0
  100. data/sample/demo_kegg_glycan.rb +72 -0
  101. data/sample/demo_kegg_orthology.rb +62 -0
  102. data/sample/demo_kegg_reaction.rb +66 -0
  103. data/sample/demo_kegg_taxonomy.rb +92 -0
  104. data/sample/demo_keggapi.rb +502 -0
  105. data/sample/demo_litdb.rb +42 -0
  106. data/sample/demo_locations.rb +99 -0
  107. data/sample/demo_ncbi_rest.rb +130 -0
  108. data/sample/demo_nucleicacid.rb +49 -0
  109. data/sample/demo_pathway.rb +196 -0
  110. data/sample/demo_prosite.rb +120 -0
  111. data/sample/demo_psort.rb +138 -0
  112. data/sample/demo_psort_report.rb +70 -0
  113. data/sample/demo_pubmed.rb +118 -0
  114. data/sample/demo_sirna.rb +63 -0
  115. data/sample/demo_sosui_report.rb +89 -0
  116. data/sample/demo_targetp_report.rb +135 -0
  117. data/sample/demo_tmhmm_report.rb +68 -0
  118. data/sample/pmfetch.rb +13 -4
  119. data/sample/pmsearch.rb +15 -4
  120. data/sample/test_phyloxml_big.rb +205 -0
  121. data/test/bioruby_test_helper.rb +61 -0
  122. data/test/data/KEGG/1.1.1.1.enzyme +935 -0
  123. data/test/data/KEGG/C00025.compound +102 -0
  124. data/test/data/KEGG/D00063.drug +104 -0
  125. data/test/data/KEGG/G00024.glycan +47 -0
  126. data/test/data/KEGG/G01366.glycan +18 -0
  127. data/test/data/KEGG/K02338.orthology +902 -0
  128. data/test/data/KEGG/R00006.reaction +14 -0
  129. data/test/data/fastq/README.txt +109 -0
  130. data/test/data/fastq/error_diff_ids.fastq +20 -0
  131. data/test/data/fastq/error_double_qual.fastq +22 -0
  132. data/test/data/fastq/error_double_seq.fastq +22 -0
  133. data/test/data/fastq/error_long_qual.fastq +20 -0
  134. data/test/data/fastq/error_no_qual.fastq +20 -0
  135. data/test/data/fastq/error_qual_del.fastq +20 -0
  136. data/test/data/fastq/error_qual_escape.fastq +20 -0
  137. data/test/data/fastq/error_qual_null.fastq +0 -0
  138. data/test/data/fastq/error_qual_space.fastq +21 -0
  139. data/test/data/fastq/error_qual_tab.fastq +21 -0
  140. data/test/data/fastq/error_qual_unit_sep.fastq +20 -0
  141. data/test/data/fastq/error_qual_vtab.fastq +20 -0
  142. data/test/data/fastq/error_short_qual.fastq +20 -0
  143. data/test/data/fastq/error_spaces.fastq +20 -0
  144. data/test/data/fastq/error_tabs.fastq +21 -0
  145. data/test/data/fastq/error_trunc_at_plus.fastq +19 -0
  146. data/test/data/fastq/error_trunc_at_qual.fastq +19 -0
  147. data/test/data/fastq/error_trunc_at_seq.fastq +18 -0
  148. data/test/data/fastq/error_trunc_in_plus.fastq +19 -0
  149. data/test/data/fastq/error_trunc_in_qual.fastq +20 -0
  150. data/test/data/fastq/error_trunc_in_seq.fastq +18 -0
  151. data/test/data/fastq/error_trunc_in_title.fastq +17 -0
  152. data/test/data/fastq/illumina_full_range_as_illumina.fastq +8 -0
  153. data/test/data/fastq/illumina_full_range_as_sanger.fastq +8 -0
  154. data/test/data/fastq/illumina_full_range_as_solexa.fastq +8 -0
  155. data/test/data/fastq/illumina_full_range_original_illumina.fastq +8 -0
  156. data/test/data/fastq/longreads_as_illumina.fastq +40 -0
  157. data/test/data/fastq/longreads_as_sanger.fastq +40 -0
  158. data/test/data/fastq/longreads_as_solexa.fastq +40 -0
  159. data/test/data/fastq/longreads_original_sanger.fastq +120 -0
  160. data/test/data/fastq/misc_dna_as_illumina.fastq +16 -0
  161. data/test/data/fastq/misc_dna_as_sanger.fastq +16 -0
  162. data/test/data/fastq/misc_dna_as_solexa.fastq +16 -0
  163. data/test/data/fastq/misc_dna_original_sanger.fastq +16 -0
  164. data/test/data/fastq/misc_rna_as_illumina.fastq +16 -0
  165. data/test/data/fastq/misc_rna_as_sanger.fastq +16 -0
  166. data/test/data/fastq/misc_rna_as_solexa.fastq +16 -0
  167. data/test/data/fastq/misc_rna_original_sanger.fastq +16 -0
  168. data/test/data/fastq/sanger_full_range_as_illumina.fastq +8 -0
  169. data/test/data/fastq/sanger_full_range_as_sanger.fastq +8 -0
  170. data/test/data/fastq/sanger_full_range_as_solexa.fastq +8 -0
  171. data/test/data/fastq/sanger_full_range_original_sanger.fastq +8 -0
  172. data/test/data/fastq/solexa_full_range_as_illumina.fastq +8 -0
  173. data/test/data/fastq/solexa_full_range_as_sanger.fastq +8 -0
  174. data/test/data/fastq/solexa_full_range_as_solexa.fastq +8 -0
  175. data/test/data/fastq/solexa_full_range_original_solexa.fastq +8 -0
  176. data/test/data/fastq/wrapping_as_illumina.fastq +12 -0
  177. data/test/data/fastq/wrapping_as_sanger.fastq +12 -0
  178. data/test/data/fastq/wrapping_as_solexa.fastq +12 -0
  179. data/test/data/fastq/wrapping_original_sanger.fastq +24 -0
  180. data/test/data/meme/db +0 -0
  181. data/test/data/meme/mast +0 -0
  182. data/test/data/meme/mast.out +13 -0
  183. data/test/data/meme/meme.out +3 -0
  184. data/test/data/phyloxml/apaf.xml +666 -0
  185. data/test/data/phyloxml/bcl_2.xml +2097 -0
  186. data/test/data/phyloxml/made_up.xml +144 -0
  187. data/test/data/phyloxml/ncbi_taxonomy_mollusca_short.xml +65 -0
  188. data/test/data/phyloxml/phyloxml_examples.xml +415 -0
  189. data/test/data/sanger_chromatogram/test_chromatogram_abif.ab1 +0 -0
  190. data/test/data/sanger_chromatogram/test_chromatogram_scf_v2.scf +0 -0
  191. data/test/data/sanger_chromatogram/test_chromatogram_scf_v3.scf +0 -0
  192. data/test/functional/bio/appl/test_pts1.rb +7 -5
  193. data/test/functional/bio/io/test_ensembl.rb +4 -3
  194. data/test/functional/bio/io/test_pubmed.rb +9 -3
  195. data/test/functional/bio/io/test_soapwsdl.rb +5 -4
  196. data/test/functional/bio/io/test_togows.rb +5 -4
  197. data/test/functional/bio/sequence/test_output_embl.rb +6 -4
  198. data/test/functional/bio/test_command.rb +54 -5
  199. data/test/runner.rb +5 -3
  200. data/test/unit/bio/appl/bl2seq/test_report.rb +5 -4
  201. data/test/unit/bio/appl/blast/test_ncbioptions.rb +4 -2
  202. data/test/unit/bio/appl/blast/test_report.rb +5 -4
  203. data/test/unit/bio/appl/blast/test_rpsblast.rb +5 -4
  204. data/test/unit/bio/appl/gcg/test_msf.rb +5 -5
  205. data/test/unit/bio/appl/genscan/test_report.rb +8 -9
  206. data/test/unit/bio/appl/hmmer/test_report.rb +5 -4
  207. data/test/unit/bio/appl/iprscan/test_report.rb +6 -5
  208. data/test/unit/bio/appl/mafft/test_report.rb +6 -5
  209. data/test/unit/bio/appl/meme/mast/test_report.rb +46 -0
  210. data/test/unit/bio/appl/meme/test_mast.rb +103 -0
  211. data/test/unit/bio/appl/meme/test_motif.rb +38 -0
  212. data/test/unit/bio/appl/paml/codeml/test_rates.rb +5 -4
  213. data/test/unit/bio/appl/paml/codeml/test_report.rb +5 -4
  214. data/test/unit/bio/appl/paml/test_codeml.rb +5 -4
  215. data/test/unit/bio/appl/sim4/test_report.rb +5 -4
  216. data/test/unit/bio/appl/sosui/test_report.rb +6 -5
  217. data/test/unit/bio/appl/targetp/test_report.rb +5 -3
  218. data/test/unit/bio/appl/test_blast.rb +5 -4
  219. data/test/unit/bio/appl/test_fasta.rb +4 -2
  220. data/test/unit/bio/appl/test_pts1.rb +4 -2
  221. data/test/unit/bio/appl/tmhmm/test_report.rb +6 -5
  222. data/test/unit/bio/data/test_aa.rb +5 -3
  223. data/test/unit/bio/data/test_codontable.rb +5 -4
  224. data/test/unit/bio/data/test_na.rb +5 -3
  225. data/test/unit/bio/db/biosql/tc_biosql.rb +5 -1
  226. data/test/unit/bio/db/embl/test_common.rb +4 -2
  227. data/test/unit/bio/db/embl/test_embl.rb +6 -6
  228. data/test/unit/bio/db/embl/test_embl_rel89.rb +6 -6
  229. data/test/unit/bio/db/embl/test_embl_to_bioseq.rb +7 -8
  230. data/test/unit/bio/db/embl/test_sptr.rb +6 -8
  231. data/test/unit/bio/db/embl/test_uniprot.rb +6 -5
  232. data/test/unit/bio/db/fasta/test_format_qual.rb +346 -0
  233. data/test/unit/bio/db/kegg/test_compound.rb +146 -0
  234. data/test/unit/bio/db/kegg/test_drug.rb +194 -0
  235. data/test/unit/bio/db/kegg/test_enzyme.rb +241 -0
  236. data/test/unit/bio/db/kegg/test_genes.rb +32 -4
  237. data/test/unit/bio/db/kegg/test_glycan.rb +260 -0
  238. data/test/unit/bio/db/kegg/test_orthology.rb +50 -0
  239. data/test/unit/bio/db/kegg/test_reaction.rb +96 -0
  240. data/test/unit/bio/db/pdb/test_pdb.rb +4 -2
  241. data/test/unit/bio/db/sanger_chromatogram/test_abif.rb +76 -0
  242. data/test/unit/bio/db/sanger_chromatogram/test_scf.rb +98 -0
  243. data/test/unit/bio/db/test_aaindex.rb +6 -6
  244. data/test/unit/bio/db/test_fasta.rb +5 -46
  245. data/test/unit/bio/db/test_fastq.rb +829 -0
  246. data/test/unit/bio/db/test_gff.rb +4 -2
  247. data/test/unit/bio/db/test_lasergene.rb +7 -5
  248. data/test/unit/bio/db/test_medline.rb +4 -2
  249. data/test/unit/bio/db/test_newick.rb +6 -6
  250. data/test/unit/bio/db/test_nexus.rb +4 -2
  251. data/test/unit/bio/db/test_phyloxml.rb +769 -0
  252. data/test/unit/bio/db/test_phyloxml_writer.rb +328 -0
  253. data/test/unit/bio/db/test_prosite.rb +6 -5
  254. data/test/unit/bio/db/test_qual.rb +63 -0
  255. data/test/unit/bio/db/test_rebase.rb +5 -3
  256. data/test/unit/bio/db/test_soft.rb +7 -6
  257. data/test/unit/bio/io/flatfile/test_autodetection.rb +6 -7
  258. data/test/unit/bio/io/flatfile/test_buffer.rb +6 -5
  259. data/test/unit/bio/io/flatfile/test_splitter.rb +4 -4
  260. data/test/unit/bio/io/test_ddbjxml.rb +4 -3
  261. data/test/unit/bio/io/test_ensembl.rb +5 -3
  262. data/test/unit/bio/io/test_fastacmd.rb +4 -3
  263. data/test/unit/bio/io/test_flatfile.rb +6 -5
  264. data/test/unit/bio/io/test_soapwsdl.rb +4 -3
  265. data/test/unit/bio/io/test_togows.rb +4 -2
  266. data/test/unit/bio/sequence/test_aa.rb +5 -3
  267. data/test/unit/bio/sequence/test_common.rb +4 -2
  268. data/test/unit/bio/sequence/test_compat.rb +4 -2
  269. data/test/unit/bio/sequence/test_dblink.rb +5 -3
  270. data/test/unit/bio/sequence/test_na.rb +4 -2
  271. data/test/unit/bio/sequence/test_quality_score.rb +330 -0
  272. data/test/unit/bio/shell/plugin/test_seq.rb +5 -3
  273. data/test/unit/bio/test_alignment.rb +5 -3
  274. data/test/unit/bio/test_command.rb +4 -3
  275. data/test/unit/bio/test_db.rb +5 -3
  276. data/test/unit/bio/test_feature.rb +4 -2
  277. data/test/unit/bio/test_location.rb +4 -2
  278. data/test/unit/bio/test_map.rb +5 -3
  279. data/test/unit/bio/test_pathway.rb +4 -2
  280. data/test/unit/bio/test_reference.rb +4 -2
  281. data/test/unit/bio/test_sequence.rb +5 -3
  282. data/test/unit/bio/test_shell.rb +5 -3
  283. data/test/unit/bio/test_tree.rb +6 -6
  284. data/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb +4 -2
  285. data/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb +4 -2
  286. data/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb +4 -2
  287. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb +4 -2
  288. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb +4 -2
  289. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb +4 -2
  290. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb +4 -2
  291. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb +4 -2
  292. data/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb +4 -2
  293. data/test/unit/bio/util/restriction_enzyme/test_analysis.rb +4 -2
  294. data/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb +4 -2
  295. data/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb +4 -2
  296. data/test/unit/bio/util/restriction_enzyme/test_single_strand.rb +17 -13
  297. data/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb +17 -13
  298. data/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb +4 -2
  299. data/test/unit/bio/util/test_color_scheme.rb +5 -3
  300. data/test/unit/bio/util/test_contingency_table.rb +5 -3
  301. data/test/unit/bio/util/test_restriction_enzyme.rb +4 -2
  302. data/test/unit/bio/util/test_sirna.rb +6 -4
  303. metadata +147 -2
@@ -0,0 +1,146 @@
1
+ #
2
+ # test/unit/bio/db/kegg/test_compound.rb - Unit test for Bio::KEGG::COMPOUND
3
+ #
4
+ # Copyright:: Copyright (C) 2009 Kozo Nishida <kozo-ni@is.naist.jp>
5
+ # License:: The Ruby License
6
+
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
+
12
+ # libraries needed for the tests
13
+ require 'test/unit'
14
+ require 'bio/db/kegg/compound'
15
+
16
+ module Bio
17
+ class TestKeggCompound < Test::Unit::TestCase
18
+
19
+ def setup
20
+ testdata_kegg = Pathname.new(File.join(BioRubyTestDataPath, 'KEGG')).cleanpath.to_s
21
+ entry = File.read(File.join(testdata_kegg, "C00025.compound"))
22
+ @obj = Bio::KEGG::COMPOUND.new(entry)
23
+ end
24
+
25
+ def test_entry_id
26
+ assert_equal('C00025', @obj.entry_id)
27
+ end
28
+
29
+ def test_name
30
+ assert_equal("L-Glutamate", @obj.name)
31
+ end
32
+
33
+ def test_names
34
+ assert_equal(["L-Glutamate", "L-Glutamic acid", "L-Glutaminic acid", "Glutamate"], @obj.names)
35
+ end
36
+
37
+ def test_formula
38
+ assert_equal("C5H9NO4", @obj.formula)
39
+ end
40
+
41
+ def test_mass
42
+ assert_equal(147.0532, @obj.mass)
43
+ end
44
+
45
+ def test_remark
46
+ assert_equal("Same as: D00007", @obj.remark)
47
+ end
48
+
49
+ def test_reactions
50
+ assert_equal(["R00021", "R00093", "R00114", "R00239", "R00241", "R00243", "R00245", "R00248", "R00250", "R00251", "R00253", "R00254", "R00256", "R00257", "R00258", "R00259", "R00260", "R00261", "R00262", "R00263", "R00355", "R00372", "R00411", "R00457", "R00494", "R00525", "R00573", "R00575", "R00578", "R00609", "R00667", "R00668", "R00684", "R00694", "R00707", "R00708", "R00734", "R00768", "R00894", "R00895", "R00908", "R00942", "R00986", "R01072", "R01090", "R01155", "R01161", "R01214", "R01231", "R01339", "R01585", "R01586", "R01648", "R01654", "R01684", "R01716", "R01939", "R01956", "R02040", "R02077", "R02199", "R02237", "R02274", "R02282", "R02283", "R02285", "R02287", "R02313", "R02315", "R02433", "R02619", "R02700", "R02772", "R02773", "R02929", "R02930", "R03053", "R03120", "R03189", "R03207", "R03243", "R03248", "R03266", "R03651", "R03905", "R03916", "R03952", "R03970", "R03971", "R04028", "R04029", "R04051", "R04171", "R04173", "R04188", "R04212", "R04217", "R04234", "R04241", "R04269", "R04338", "R04438", "R04463", "R04467", "R04475", "R04529", "R04558", "R04776", "R05052", "R05085", "R05197", "R05207", "R05224", "R05225", "R05507", "R05578", "R05815", "R06423", "R06426", "R06844", "R06977", "R07275", "R07276", "R07277", "R07396", "R07414", "R07419", "R07456", "R07613", "R07643", "R07659", "R08244"], @obj.reactions)
51
+ end
52
+
53
+ def test_rpairs
54
+ assert_equal([], @obj.rpairs)
55
+ end
56
+
57
+ def test_pathways_as_strings
58
+ assert_equal(["PATH: ko00250 Alanine, aspartate and glutamate metabolism", "PATH: ko00330 Arginine and proline metabolism", "PATH: ko00340 Histidine metabolism", "PATH: ko00471 D-Glutamine and D-glutamate metabolism", "PATH: ko00480 Glutathione metabolism", "PATH: ko00650 Butanoate metabolism", "PATH: ko00660 C5-Branched dibasic acid metabolism", "PATH: ko00860 Porphyrin and chlorophyll metabolism", "PATH: ko00910 Nitrogen metabolism", "PATH: ko00970 Aminoacyl-tRNA biosynthesis", "PATH: map01060 Biosynthesis of plant secondary metabolites", "PATH: ko01064 Biosynthesis of alkaloids derived from ornithine, lysine and nicotinic acid", "PATH: ko01100 Metabolic pathways", "PATH: ko02010 ABC transporters", "PATH: ko04080 Neuroactive ligand-receptor interaction", "PATH: ko04540 Gap junction", "PATH: ko04720 Long-term potentiation", "PATH: ko04730 Long-term depression", "PATH: ko04742 Taste transduction", "PATH: ko05014 Amyotrophic lateral sclerosis (ALS)", "PATH: ko05016 Huntington's disease"], @obj.pathways_as_strings)
59
+ end
60
+
61
+ def test_enzymes
62
+ assert_equal(["1.4.1.2", "1.4.1.3", "1.4.1.4", "1.4.1.13", "1.4.1.14", "1.4.3.11", "1.4.7.1", "1.5.1.9", "1.5.1.10", "1.5.1.12", "1.5.99.5", "2.1.1.21", "2.1.2.5", "2.3.1.1", "2.3.1.14", "2.3.1.35", "2.3.2.2", "2.3.2.-", "2.4.2.14", "2.4.2.-", "2.6.1.1", "2.6.1.2", "2.6.1.3", "2.6.1.4", "2.6.1.5", "2.6.1.6", "2.6.1.7", "2.6.1.8", "2.6.1.9", "2.6.1.11", "2.6.1.13", "2.6.1.16", "2.6.1.17", "2.6.1.19", "2.6.1.22", "2.6.1.23", "2.6.1.24", "2.6.1.26", "2.6.1.27", "2.6.1.29", "2.6.1.33", "2.6.1.34", "2.6.1.36", "2.6.1.38", "2.6.1.39", "2.6.1.40", "2.6.1.42", "2.6.1.48", "2.6.1.49", "2.6.1.52", "2.6.1.55", "2.6.1.57", "2.6.1.59", "2.6.1.65", "2.6.1.67", "2.6.1.68", "2.6.1.72", "2.6.1.75", "2.6.1.76", "2.6.1.79", "2.6.1.80", "2.6.1.81", "2.6.1.82", "2.6.1.83", "2.6.1.85", "2.6.1.-", "2.7.2.11", "2.7.2.13", "3.5.1.2", "3.5.1.38", "3.5.1.55", "3.5.1.65", "3.5.1.68", "3.5.1.87", "3.5.1.94", "3.5.1.96", "3.5.2.9", "3.5.3.8", "4.1.1.15", "4.1.3.27", "4.1.3.-", "5.1.1.3", "5.4.99.1", "6.1.1.17", "6.1.1.24", "6.3.1.2", "6.3.1.6", "6.3.1.11", "6.3.1.-", "6.3.2.2", "6.3.2.12", "6.3.2.17", "6.3.2.18", "6.3.4.2", "6.3.4.12", "6.3.5.1", "6.3.5.2", "6.3.5.3", "6.3.5.4", "6.3.5.5", "6.3.5.6", "6.3.5.7", "6.3.5.9", "6.3.5.10"], @obj.enzymes)
63
+ end
64
+
65
+ def test_dblinks_as_strings
66
+ assert_equal([ "CAS: 56-86-0",
67
+ "PubChem: 3327",
68
+ "ChEBI: 16015",
69
+ "KNApSAcK: C00001358",
70
+ "PDB-CCD: GLU",
71
+ "3DMET: B00007",
72
+ "NIKKAJI: J9.171E" ], @obj.dblinks_as_strings)
73
+ end
74
+
75
+ def test_dblinks_as_hash
76
+ expected = {
77
+ "CAS" => [ "56-86-0" ],
78
+ "PubChem" => [ "3327" ],
79
+ "ChEBI" => [ "16015" ],
80
+ "KNApSAcK" => [ "C00001358" ],
81
+ "PDB-CCD" => [ "GLU" ],
82
+ "3DMET" => [ "B00007" ],
83
+ "NIKKAJI" => [ "J9.171E" ]
84
+ }
85
+ assert_equal(expected, @obj.dblinks_as_hash)
86
+ assert_equal(expected, @obj.dblinks)
87
+ end
88
+
89
+ def test_pathways_as_hash
90
+ expected = {
91
+ "ko00250" => "Alanine, aspartate and glutamate metabolism",
92
+ "ko00330" => "Arginine and proline metabolism",
93
+ "ko00340" => "Histidine metabolism",
94
+ "ko00471" => "D-Glutamine and D-glutamate metabolism",
95
+ "ko00480" => "Glutathione metabolism",
96
+ "ko00650" => "Butanoate metabolism",
97
+ "ko00660" => "C5-Branched dibasic acid metabolism",
98
+ "ko00860" => "Porphyrin and chlorophyll metabolism",
99
+ "ko00910" => "Nitrogen metabolism",
100
+ "ko00970" => "Aminoacyl-tRNA biosynthesis",
101
+ "map01060" => "Biosynthesis of plant secondary metabolites",
102
+ "ko01064" =>
103
+ "Biosynthesis of alkaloids derived from ornithine, lysine and nicotinic acid",
104
+ "ko01100" => "Metabolic pathways",
105
+ "ko02010" => "ABC transporters",
106
+ "ko04080" => "Neuroactive ligand-receptor interaction",
107
+ "ko04540" => "Gap junction",
108
+ "ko04720" => "Long-term potentiation",
109
+ "ko04730" => "Long-term depression",
110
+ "ko04742" => "Taste transduction",
111
+ "ko05014" => "Amyotrophic lateral sclerosis (ALS)",
112
+ "ko05016" => "Huntington's disease"
113
+ }
114
+ assert_equal(expected, @obj.pathways_as_hash)
115
+ assert_equal(expected, @obj.pathways)
116
+ end
117
+
118
+ def test_kcf
119
+ assert_equal("ATOM 10
120
+ 1 C1c C 23.8372 -17.4608
121
+ 2 C1b C 25.0252 -16.7233
122
+ 3 C6a C 22.6023 -16.7994
123
+ 4 N1a N 23.8781 -18.8595
124
+ 5 C1b C 26.2601 -17.3788
125
+ 6 O6a O 21.4434 -17.5954
126
+ 7 O6a O 22.6198 -15.4007
127
+ 8 C6a C 27.4482 -16.6414
128
+ 9 O6a O 28.6830 -17.3028
129
+ 10 O6a O 27.4714 -15.2426
130
+ BOND 9
131
+ 1 1 2 1
132
+ 2 1 3 1
133
+ 3 1 4 1 #Down
134
+ 4 2 5 1
135
+ 5 3 6 1
136
+ 6 3 7 2
137
+ 7 5 8 1
138
+ 8 8 9 1
139
+ 9 8 10 2", @obj.kcf)
140
+ end
141
+
142
+ def test_comment
143
+ assert_equal('The name "glutamate" also means DL-Glutamate (see [CPD:C00302])', @obj.comment)
144
+ end
145
+ end
146
+ end
@@ -0,0 +1,194 @@
1
+ #
2
+ # test/unit/bio/db/kegg/test_drug.rb - Unit test for Bio::KEGG::DRUG
3
+ #
4
+ # Copyright:: Copyright (C) 2009 Naohisa Goto <ng@bioruby.org>
5
+ # License:: The Ruby License
6
+ #
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/drug.rb'
16
+
17
+ module Bio
18
+ class TestBioKeggDRUG < Test::Unit::TestCase
19
+
20
+ def setup
21
+ filename = File.join(BioRubyTestDataPath, 'KEGG/D00063.drug')
22
+ @obj = Bio::KEGG::DRUG.new(File.read(filename))
23
+ end
24
+
25
+ def test_dblinks_as_hash
26
+ expected = {
27
+ "ChEBI"=>["28864"],
28
+ "PubChem"=>["7847131"],
29
+ "NIKKAJI"=>["J4.533K"],
30
+ "PDB-CCD"=>["TOY"],
31
+ "DrugBank"=>["DB00684"],
32
+ "LigandBox"=>["D00063"],
33
+ "CAS"=>["32986-56-4"]
34
+ }
35
+ assert_equal(expected, @obj.dblinks_as_hash)
36
+ assert_equal(expected, @obj.dblinks)
37
+ end
38
+
39
+ def test_pathways_as_hash
40
+ expected = {"map07021"=>"Aminoglycosides"}
41
+ assert_equal(expected, @obj.pathways_as_hash)
42
+ assert_equal(expected, @obj.pathways)
43
+ end
44
+
45
+ def test_entry_id
46
+ assert_equal("D00063", @obj.entry_id)
47
+ end
48
+
49
+ def test_names
50
+ expected = [ "Tobramycin (JP15/USP)",
51
+ "TOB", "Tobracin (TN)", "Tobrex (TN)" ]
52
+ assert_equal(expected, @obj.names)
53
+ end
54
+
55
+ def test_name
56
+ expected = "Tobramycin (JP15/USP)"
57
+ assert_equal(expected, @obj.name)
58
+ end
59
+
60
+ def test_formula
61
+ assert_equal("C18H37N5O9", @obj.formula)
62
+ end
63
+
64
+ def test_mass
65
+ assert_equal(467.2591, @obj.mass)
66
+ end
67
+
68
+ def test_activity
69
+ expected = "Antibacterial"
70
+ assert_equal(expected, @obj.activity)
71
+ end
72
+
73
+ def test_remark
74
+ expected = "Same as: C00397 Therapeutic category: 1317 6123 ATC code: J01GB01 S01AA12"
75
+ assert_equal(expected, @obj.remark)
76
+ end
77
+
78
+ def test_pathways_as_strings
79
+ expected = [ "PATH: map07021 Aminoglycosides" ]
80
+ assert_equal(expected, @obj.pathways_as_strings)
81
+ end
82
+
83
+ def test_dblinks_as_strings
84
+ expected = [ "CAS: 32986-56-4",
85
+ "PubChem: 7847131",
86
+ "ChEBI: 28864",
87
+ "DrugBank: DB00684",
88
+ "PDB-CCD: TOY",
89
+ "LigandBox: D00063",
90
+ "NIKKAJI: J4.533K" ]
91
+ assert_equal(expected, @obj.dblinks_as_strings)
92
+ end
93
+
94
+ def test_kcf
95
+ expected = <<END_OF_EXPECTED_KCF
96
+ ATOM 32
97
+ 1 C1y C 20.6560 -20.0968
98
+ 2 C1y C 20.6560 -21.4973
99
+ 3 C1y C 21.8689 -22.1975
100
+ 4 C1y C 23.0818 -21.4973
101
+ 5 C1y C 23.0818 -20.0968
102
+ 6 O2x O 21.8689 -19.3965
103
+ 7 C1b C 19.4432 -19.3965
104
+ 8 O1a O 18.2473 -20.0872
105
+ 9 O1a O 19.4432 -22.1975
106
+ 10 N1a N 21.8689 -23.5978
107
+ 11 O1a O 24.3134 -22.2085
108
+ 12 O2a O 24.3134 -19.3855
109
+ 13 C1y C 25.4878 -18.6963
110
+ 14 C1y C 26.7056 -19.3879
111
+ 15 C1x C 27.9134 -18.6791
112
+ 16 C1y C 27.9035 -17.2786
113
+ 17 C1y C 26.6857 -16.5869
114
+ 18 C1y C 25.4779 -17.2958
115
+ 19 N1a N 26.7157 -20.7965
116
+ 20 N1a N 29.0779 -16.5893
117
+ 21 O1a O 24.2675 -16.6084
118
+ 22 O2a O 26.6757 -15.1950
119
+ 23 C1y C 27.8854 -14.4851
120
+ 24 O2x O 29.0946 -15.1718
121
+ 25 C1y C 30.3025 -14.4631
122
+ 26 C1y C 30.2926 -13.0626
123
+ 27 C1x C 29.0835 -12.3758
124
+ 28 C1y C 27.8755 -13.0846
125
+ 29 C1b C 31.5468 -15.1693
126
+ 30 N1a N 31.5569 -16.5953
127
+ 31 O1a O 31.5060 -12.3503
128
+ 32 N1a N 26.6567 -12.3923
129
+ BOND 34
130
+ 1 1 2 1
131
+ 2 2 3 1
132
+ 3 3 4 1
133
+ 4 4 5 1
134
+ 5 5 6 1
135
+ 6 1 6 1
136
+ 7 1 7 1 #Up
137
+ 8 7 8 1
138
+ 9 2 9 1 #Down
139
+ 10 3 10 1 #Up
140
+ 11 4 11 1 #Down
141
+ 12 5 12 1 #Down
142
+ 13 13 12 1 #Down
143
+ 14 13 14 1
144
+ 15 14 15 1
145
+ 16 15 16 1
146
+ 17 16 17 1
147
+ 18 17 18 1
148
+ 19 13 18 1
149
+ 20 14 19 1 #Up
150
+ 21 16 20 1 #Up
151
+ 22 18 21 1 #Up
152
+ 23 17 22 1 #Down
153
+ 24 23 22 1 #Down
154
+ 25 23 24 1
155
+ 26 24 25 1
156
+ 27 25 26 1
157
+ 28 26 27 1
158
+ 29 27 28 1
159
+ 30 23 28 1
160
+ 31 25 29 1 #Up
161
+ 32 29 30 1
162
+ 33 26 31 1 #Down
163
+ 34 28 32 1 #Down
164
+ END_OF_EXPECTED_KCF
165
+ assert_equal(expected, @obj.kcf)
166
+ end
167
+
168
+ def test_comment
169
+ expected = "natural product"
170
+ assert_equal(expected, @obj.comment)
171
+ end
172
+
173
+ def test_products
174
+ expected =
175
+ [
176
+ "TOBI (Novartis Pharma) 94F9E516-6BF6-4E30-8DDE-8833C25C2560",
177
+ "TOBRAMYCIN (Bristol-Myers Squibb) 7305F9BB-622B-43C0-981A-56E2F226CFD7",
178
+ "TOBRAMYCIN (Hospira) C5A005B0-7B6F-4E30-DF92-9A20B1CA66A1",
179
+ "Tobramycin (Akorn-Strides) 49151A62-191A-4BA8-8B8C-BD8535F2FDB3",
180
+ "Tobramycin (Bausch and Lomb) A5693EC9-D2F7-4D45-90B0-A113C54840D7",
181
+ "Tobramycin (Falcon Pharma) 27E2C16E-19B0-4745-93EB-5CF99F94BB92",
182
+ "Tobramycin (Hospira) 4E115874-3637-4AED-B6AF-77D53A850208",
183
+ "Tobramycin (Hospira) EB02166C-18F6-4BE0-F493-AC89D65DA759",
184
+ "Tobramycin (X-Gen Pharma) A384641C-04E3-4AB5-B152-7408CD07B64D",
185
+ "Tobramycin in Sodium Chloride (Hospira) EE907146-E4A8-4578-A9B0-C8E9790E3D55",
186
+ "Tobrex (Alcon Lab) 4B8716C4-0FFD-49AA-9006-A3BF5B6D19A6",
187
+ "Tobrex (Alcon Lab) CDD423C5-A231-47D4-BF51-00B5C29E6A60"
188
+ ]
189
+ assert_equal(expected, @obj.products)
190
+ end
191
+
192
+ end #class TestBioKeggDRUG
193
+ end #module Bio
194
+
@@ -0,0 +1,241 @@
1
+ #
2
+ # test/unit/bio/db/kegg/test_enzyme.rb - Unit test for Bio::KEGG::ENZYME
3
+ #
4
+ # Copyright:: Copyright (C) 2009 Naohisa Goto <ng@bioruby.org>
5
+ # License:: The Ruby License
6
+ #
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 'digest/sha1'
16
+ require 'bio/db/kegg/enzyme'
17
+
18
+ module Bio
19
+ class TestKeggEnzyme < Test::Unit::TestCase
20
+
21
+ def setup
22
+ testdata_kegg = Pathname.new(File.join(BioRubyTestDataPath,
23
+ 'KEGG')).cleanpath.to_s
24
+ entry = File.read(File.join(testdata_kegg, "1.1.1.1.enzyme"))
25
+ @obj = Bio::KEGG::ENZYME.new(entry)
26
+ end
27
+
28
+ def test_entry
29
+ assert_equal("EC 1.1.1.1 Enzyme", @obj.entry)
30
+ end
31
+
32
+ def test_entry_id
33
+ assert_equal("1.1.1.1", @obj.entry_id)
34
+ end
35
+
36
+ def test_obsolete?
37
+ assert_equal(false, @obj.obsolete?)
38
+ end
39
+
40
+ def test_names
41
+ expected = [ "alcohol dehydrogenase",
42
+ "aldehyde reductase",
43
+ "ADH",
44
+ "alcohol dehydrogenase (NAD)",
45
+ "aliphatic alcohol dehydrogenase",
46
+ "ethanol dehydrogenase",
47
+ "NAD-dependent alcohol dehydrogenase",
48
+ "NAD-specific aromatic alcohol dehydrogenase",
49
+ "NADH-alcohol dehydrogenase",
50
+ "NADH-aldehyde dehydrogenase",
51
+ "primary alcohol dehydrogenase",
52
+ "yeast alcohol dehydrogenase" ]
53
+ assert_equal(expected, @obj.names)
54
+ end
55
+
56
+ def test_name
57
+ assert_equal("alcohol dehydrogenase", @obj.name)
58
+ end
59
+
60
+ def test_classes
61
+ assert_equal([ "Oxidoreductases;",
62
+ "Acting on the CH-OH group of donors;",
63
+ "With NAD+ or NADP+ as acceptor" ], @obj.classes)
64
+ end
65
+
66
+ def test_sysname
67
+ assert_equal("alcohol:NAD+ oxidoreductase", @obj.sysname)
68
+ end
69
+
70
+ def test_reaction
71
+ expected = "an alcohol + NAD+ = an aldehyde or ketone + NADH + H+ [RN:R07326 R07327]"
72
+ assert_equal(expected, @obj.reaction)
73
+ end
74
+
75
+ def test_all_reac
76
+ expected = "R07326 > R00623 R00754 R02124 R04805 R04880 R05233 R05234 R06917 R06927 R08281 R08306 R08557 R08558; R07327 > R00624 R08310; (other) R07105"
77
+ assert_equal(expected, @obj.all_reac)
78
+ end
79
+
80
+ def test_iubmb_reactions
81
+ expected = [ "R07326 > R00623 R00754 R02124 R04805 R04880 R05233 R05234 R06917 R06927 R08281 R08306 R08557 R08558",
82
+ "R07327 > R00624 R08310" ]
83
+ assert_equal(expected, @obj.iubmb_reactions)
84
+ end
85
+
86
+ def test_kegg_reactions
87
+ assert_equal(["R07105"], @obj.kegg_reactions)
88
+ end
89
+
90
+ def test_substrates
91
+ expected = [ "alcohol [CPD:C00069]", "NAD+ [CPD:C00003]" ]
92
+ assert_equal(expected, @obj.substrates)
93
+ end
94
+
95
+ def test_products
96
+ expected = [ "aldehyde [CPD:C00071]",
97
+ "ketone [CPD:C01450]",
98
+ "NADH [CPD:C00004]",
99
+ "H+ [CPD:C00080]" ]
100
+ assert_equal(expected, @obj.products)
101
+ end
102
+
103
+ def test_inhibitors
104
+ assert_equal([], @obj.inhibitors)
105
+ end
106
+
107
+ def test_cofactors
108
+ assert_equal(["Zinc [CPD:C00038]"], @obj.cofactors)
109
+ end
110
+
111
+ def test_comment
112
+ expected = "A zinc protein. Acts on primary or secondary alcohols or hemi-acetals; the animal, but not the yeast, enzyme acts also on cyclic secondary alcohols."
113
+ assert_equal(expected, @obj.comment)
114
+ end
115
+
116
+ def test_pathways_as_strings
117
+ expected = [ "PATH: ec00010 Glycolysis / Gluconeogenesis",
118
+ "PATH: ec00071 Fatty acid metabolism",
119
+ "PATH: ec00260 Glycine, serine and threonine metabolism",
120
+ "PATH: ec00350 Tyrosine metabolism",
121
+ "PATH: ec00624 1- and 2-Methylnaphthalene degradation",
122
+ "PATH: ec00641 3-Chloroacrylic acid degradation",
123
+ "PATH: ec00830 Retinol metabolism",
124
+ "PATH: ec00980 Metabolism of xenobiotics by cytochrome P450",
125
+ "PATH: ec00982 Drug metabolism - cytochrome P450",
126
+ "PATH: ec01100 Metabolic pathways" ]
127
+ assert_equal(expected, @obj.pathways_as_strings)
128
+ end
129
+
130
+ def test_pathways_as_hash
131
+ expected = {
132
+ "ec01100" => "Metabolic pathways",
133
+ "ec00982" => "Drug metabolism - cytochrome P450",
134
+ "ec00641" => "3-Chloroacrylic acid degradation",
135
+ "ec00830" => "Retinol metabolism",
136
+ "ec00071" => "Fatty acid metabolism",
137
+ "ec00260" => "Glycine, serine and threonine metabolism",
138
+ "ec00624" => "1- and 2-Methylnaphthalene degradation",
139
+ "ec00350" => "Tyrosine metabolism",
140
+ "ec00010" => "Glycolysis / Gluconeogenesis",
141
+ "ec00980" => "Metabolism of xenobiotics by cytochrome P450"
142
+ }
143
+ assert_equal(expected, @obj.pathways_as_hash)
144
+ assert_equal(expected, @obj.pathways)
145
+ end
146
+
147
+ def test_orthologs_as_strings
148
+ expected = [ "KO: K00001 alcohol dehydrogenase",
149
+ "KO: K11440 choline dehydrogenase" ]
150
+ assert_equal(expected, @obj.orthologs_as_strings)
151
+ end
152
+
153
+ def test_orthologs_as_hash
154
+ expected = {
155
+ "K11440" => "choline dehydrogenase",
156
+ "K00001" => "alcohol dehydrogenase"
157
+ }
158
+ assert_equal(expected, @obj.orthologs_as_hash)
159
+ assert_equal(expected, @obj.orthologs)
160
+ end
161
+
162
+ def test_genes_as_strings
163
+ assert_equal(759, @obj.genes_as_strings.size)
164
+ assert_equal("0b01addd884266d7e80fdc34f112b9a89b90cc54",
165
+ Digest::SHA1.hexdigest(@obj.genes_as_strings.join("\n")))
166
+ end
167
+
168
+ def test_genes_as_hash
169
+ assert_equal(759, @obj.genes_as_hash.size)
170
+ assert_equal("025e77f866a7edb0eccaaabcff31df90d8e1fca1",
171
+ Digest::SHA1.hexdigest(@obj.genes_as_hash.keys.sort.join(";")))
172
+ assert_equal(["124", "125", "126", "127", "128", "130", "131"],
173
+ @obj.genes_as_hash['hsa'])
174
+ assert_equal(["BSU18430", "BSU26970", "BSU31050"],
175
+ @obj.genes_as_hash['bsu'])
176
+ assert_equal(["Tpen_1006", "Tpen_1516"],
177
+ @obj.genes_as_hash['tpe'])
178
+ end
179
+
180
+ def test_genes
181
+ assert_equal(759, @obj.genes.size)
182
+ assert_equal("025e77f866a7edb0eccaaabcff31df90d8e1fca1",
183
+ Digest::SHA1.hexdigest(@obj.genes.keys.sort.join(";")))
184
+ assert_equal(["124", "125", "126", "127", "128", "130", "131"],
185
+ @obj.genes['hsa'])
186
+ assert_equal(["BSU18430", "BSU26970", "BSU31050"],
187
+ @obj.genes['bsu'])
188
+ assert_equal(["Tpen_1006", "Tpen_1516"],
189
+ @obj.genes['tpe'])
190
+ end
191
+
192
+ def test_diseases
193
+ assert_equal([], @obj.diseases)
194
+ end
195
+
196
+ def test_motifs
197
+ assert_equal([], @obj.motifs)
198
+ end
199
+
200
+ def test_structures
201
+ expected = ["1A4U", "1A71", "1A72", "1ADB", "1ADC", "1ADF", "1ADG",
202
+ "1AGN", "1AXE", "1AXG", "1B14", "1B15", "1B16", "1B2L",
203
+ "1BTO", "1CDO", "1D1S", "1D1T", "1DEH", "1E3E", "1E3I",
204
+ "1E3L", "1EE2", "1H2B", "1HDX", "1HDY", "1HDZ", "1HET",
205
+ "1HEU", "1HF3", "1HLD", "1HSO", "1HSZ", "1HT0", "1HTB",
206
+ "1JU9", "1JVB", "1LDE", "1LDY", "1LLU", "1M6H", "1M6W",
207
+ "1MA0", "1MC5", "1MG0", "1MG5", "1MGO", "1MP0", "1N8K",
208
+ "1N92", "1NTO", "1NVG", "1O2D", "1P1R", "1QLH", "1QLJ",
209
+ "1QV6", "1QV7", "1R37", "1RJW", "1SBY", "1TEH", "1U3T",
210
+ "1U3U", "1U3V", "1U3W", "1VJ0", "1YE3", "2EER", "2FZE",
211
+ "2FZW", "2HCY", "2JHF", "2JHG", "2OHX", "2OXI", "3BTO",
212
+ "3COS", "3HUD", "3I4C", "5ADH", "6ADH", "7ADH"]
213
+ assert_equal(expected, @obj.structures)
214
+ end
215
+
216
+ def test_dblinks_as_strings
217
+ expected = [ "ExplorEnz - The Enzyme Database: 1.1.1.1",
218
+ "IUBMB Enzyme Nomenclature: 1.1.1.1",
219
+ "ExPASy - ENZYME nomenclature database: 1.1.1.1",
220
+ "UM-BBD (Biocatalysis/Biodegradation Database): 1.1.1.1",
221
+ "BRENDA, the Enzyme Database: 1.1.1.1",
222
+ "CAS: 9031-72-5" ]
223
+ assert_equal(expected, @obj.dblinks_as_strings)
224
+ end
225
+
226
+ def test_dblinks_as_hash
227
+ expected = {
228
+ "UM-BBD (Biocatalysis/Biodegradation Database)" => [ "1.1.1.1" ],
229
+ "ExPASy - ENZYME nomenclature database" => [ "1.1.1.1" ],
230
+ "IUBMB Enzyme Nomenclature" => [ "1.1.1.1" ],
231
+ "BRENDA, the Enzyme Database" => [ "1.1.1.1" ],
232
+ "ExplorEnz - The Enzyme Database" => [ "1.1.1.1" ],
233
+ "CAS" => [ "9031-72-5" ]
234
+ }
235
+ assert_equal(expected, @obj.dblinks_as_hash)
236
+ assert_equal(expected, @obj.dblinks)
237
+ end
238
+
239
+ end #class TestKeggEnzyme < Test::Unit::TestCase
240
+ end #module Bio
241
+