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
@@ -2,6 +2,7 @@
2
2
  # test/unit/bio/db/kegg/test_genes.rb - Unit test for Bio::KEGG::GENES
3
3
  #
4
4
  # Copyright:: Copyright (C) 2005 Mitsuteru Nakao <n@bioruby.org>
5
+ # Copyright (C) 2010 Naohisa Goto <ng@bioruby.org>
5
6
  # License:: The Ruby License
6
7
  #
7
8
  # $Id:$
@@ -70,4 +71,283 @@ END
70
71
  assert_equal(['15230008', '42572267'], @obj.dblinks['NCBI-GI'])
71
72
  end
72
73
  end
73
- end
74
+
75
+ class TestBioKEGGGENES_b0529 < Test::Unit::TestCase
76
+
77
+ def setup
78
+ filename = File.join(BioRubyTestDataPath, 'KEGG/b0529.gene')
79
+ @obj = Bio::KEGG::GENES.new(File.read(filename))
80
+ end
81
+
82
+ def test_dblinks_as_hash
83
+ expected = {
84
+ "NCBI-GI"=>["16128513"],
85
+ "UniProt"=>["P24186"],
86
+ "NCBI-GeneID"=>["945221"],
87
+ "ECOCYC"=>["EG10328"],
88
+ "EcoGene"=>["EG10328"],
89
+ "RegulonDB"=>["B0529"]
90
+ }
91
+ assert_equal(expected, @obj.dblinks_as_hash)
92
+ end
93
+
94
+ def test_pathways_as_hash
95
+ expected = {
96
+ "eco00630" => "Glyoxylate and dicarboxylate metabolism",
97
+ "eco00670" => "One carbon pool by folate",
98
+ "eco01100" => "Metabolic pathways"
99
+ }
100
+ assert_equal(expected, @obj.pathways_as_hash)
101
+ end
102
+
103
+ def test_orthologs_as_hash
104
+ expected = { "K01491" => "methylenetetrahydrofolate dehydrogenase (NADP+) / methenyltetrahydrofolate cyclohydrolase [EC:1.5.1.5 3.5.4.9]" }
105
+ assert_equal(expected, @obj.orthologs_as_hash)
106
+ end
107
+
108
+ def test_new
109
+ assert_instance_of(Bio::KEGG::GENES, @obj)
110
+ end
111
+
112
+ def test_entry
113
+ expected = {"organism"=>"E.coli", "division"=>"CDS", "id"=>"b0529"}
114
+ assert_equal(expected, @obj.entry)
115
+ end
116
+
117
+ def test_entry_id
118
+ assert_equal("b0529", @obj.entry_id)
119
+ end
120
+
121
+ def test_division
122
+ assert_equal("CDS", @obj.division)
123
+ end
124
+
125
+ def test_organism
126
+ assert_equal("E.coli", @obj.organism)
127
+ end
128
+
129
+ def test_name
130
+ assert_equal("folD, ads, ECK0522, JW0518", @obj.name)
131
+ end
132
+
133
+ def test_names_as_array
134
+ expected = ["folD", "ads", "ECK0522", "JW0518"]
135
+ assert_equal(expected, @obj.names_as_array)
136
+ assert_equal(expected, @obj.names)
137
+ end
138
+
139
+ def test_genes
140
+ expected = ["folD", "ads", "ECK0522", "JW0518"]
141
+ assert_equal(expected, @obj.genes)
142
+ end
143
+
144
+ def test_gene
145
+ assert_equal("folD", @obj.gene)
146
+ end
147
+
148
+ def test_definition
149
+ expected = "bifunctional 5,10-methylene-tetrahydrofolate dehydrogenase/5,10-methylene-tetrahydrofolate cyclohydrolase (EC:1.5.1.5 3.5.4.9)"
150
+ assert_equal(expected, @obj.definition)
151
+ end
152
+
153
+ def test_eclinks
154
+ assert_equal(["1.5.1.5", "3.5.4.9"], @obj.eclinks)
155
+ end
156
+
157
+ def test_orthologs_as_strings
158
+ expected = ["K01491 methylenetetrahydrofolate dehydrogenase (NADP+) / methenyltetrahydrofolate cyclohydrolase [EC:1.5.1.5 3.5.4.9]"]
159
+ assert_equal(expected, @obj.orthologs_as_strings)
160
+ end
161
+
162
+ def test_pathway
163
+ expected = "eco00630 Glyoxylate and dicarboxylate metabolism eco00670 One carbon pool by folate eco01100 Metabolic pathways"
164
+ assert_equal(expected, @obj.pathway)
165
+ end
166
+
167
+ def test_pathways_as_strings
168
+ expected = [ "eco00630 Glyoxylate and dicarboxylate metabolism",
169
+ "eco00670 One carbon pool by folate",
170
+ "eco01100 Metabolic pathways" ]
171
+ assert_equal(expected, @obj.pathways_as_strings)
172
+ end
173
+
174
+ def test_position
175
+ assert_equal("complement(556098..556964)", @obj.position)
176
+ end
177
+
178
+ def test_chromosome
179
+ assert_equal(nil, @obj.chromosome)
180
+ end
181
+
182
+ def test_gbposition
183
+ assert_equal("complement(556098..556964)", @obj.gbposition)
184
+ end
185
+
186
+ def test_locations
187
+ expected = Bio::Locations.new("complement(556098..556964)")
188
+ assert_equal(expected, @obj.locations)
189
+ end
190
+
191
+ def test_motifs_as_strings
192
+ expected =
193
+ [ "Pfam: THF_DHG_CYH_C THF_DHG_CYH Amidohydro_1",
194
+ "PROSITE: THF_DHG_CYH_1 THF_DHG_CYH_2" ]
195
+ assert_equal(expected, @obj.motifs_as_strings)
196
+ end
197
+
198
+ def test_motifs_as_hash
199
+ expected = {
200
+ "Pfam" => ["THF_DHG_CYH_C", "THF_DHG_CYH", "Amidohydro_1"],
201
+ "PROSITE" => ["THF_DHG_CYH_1", "THF_DHG_CYH_2"]
202
+ }
203
+ assert_equal(expected, @obj.motifs_as_hash)
204
+ assert_equal(expected, @obj.motifs)
205
+ assert_equal(expected, @obj.motif)
206
+ end
207
+
208
+ def test_dblinks_as_strings
209
+ expected = [ "NCBI-GI: 16128513",
210
+ "NCBI-GeneID: 945221",
211
+ "RegulonDB: B0529",
212
+ "EcoGene: EG10328",
213
+ "ECOCYC: EG10328",
214
+ "UniProt: P24186" ]
215
+ assert_equal(expected, @obj.dblinks_as_strings)
216
+ end
217
+
218
+ def test_structure
219
+ assert_equal(["1B0A"], @obj.structure)
220
+ end
221
+
222
+ def test_codon_usage
223
+ expected = {
224
+ "gcg"=>nil,
225
+ "gtc"=>nil,
226
+ "cat"=>nil,
227
+ "ctg"=>nil,
228
+ "tac"=>nil,
229
+ "gga"=>nil,
230
+ "agg"=>nil,
231
+ "aaa"=>nil,
232
+ "acc"=>nil,
233
+ "att"=>nil,
234
+ "cca"=>nil,
235
+ "tgt"=>nil,
236
+ "tta"=>nil,
237
+ "gag"=>nil,
238
+ "gct"=>nil,
239
+ "tcg"=>nil,
240
+ "ggc"=>nil,
241
+ "agt"=>nil,
242
+ "aac"=>nil,
243
+ "ata"=>nil,
244
+ "cgg"=>nil,
245
+ "caa"=>nil,
246
+ "ccc"=>nil,
247
+ "ctt"=>nil,
248
+ "tga"=>nil,
249
+ "ttc"=>nil,
250
+ "gat"=>nil,
251
+ "gtg"=>nil,
252
+ "tag"=>nil,
253
+ "gca"=>nil,
254
+ "aga"=>nil,
255
+ "acg"=>nil,
256
+ "atc"=>nil,
257
+ "cgt"=>nil,
258
+ "cac"=>nil,
259
+ "cta"=>nil,
260
+ "tgc"=>nil,
261
+ "tct"=>nil,
262
+ "ggg"=>nil,
263
+ "gaa"=>nil,
264
+ "gcc"=>nil,
265
+ "gtt"=>nil,
266
+ "agc"=>nil,
267
+ "aag"=>nil,
268
+ "act"=>nil,
269
+ "cga"=>nil,
270
+ "ccg"=>nil,
271
+ "ctc"=>nil,
272
+ "tat"=>nil,
273
+ "tca"=>nil,
274
+ "ttg"=>nil,
275
+ "ggt"=>nil,
276
+ "gac"=>nil,
277
+ "gta"=>nil,
278
+ "aat"=>nil,
279
+ "aca"=>nil,
280
+ "atg"=>nil,
281
+ "cgc"=>nil,
282
+ "cag"=>nil,
283
+ "cct"=>nil,
284
+ "tgg"=>nil,
285
+ "taa"=>nil,
286
+ "tcc"=>nil,
287
+ "ttt"=>nil }
288
+ assert_equal(expected, @obj.codon_usage)
289
+ end
290
+
291
+ def test_cu_list
292
+ assert_equal([], @obj.cu_list)
293
+ end
294
+
295
+ def test_aaseq
296
+ expected = "MAAKIIDGKTIAQQVRSEVAQKVQARIAAGLRAPGLAVVLVGSNPASQIYVASKRKACEEVGFVSRSYDLPETTSEAELLELIDTLNADNTIDGILVQLPLPAGIDNVKVLERIHPDKDVDGFHPYNVGRLCQRAPRLRPCTPRGIVTLLERYNIDTFGLNAVVIGASNIVGRPMSMELLLAGCTTTVTHRFTKNLRHHVENADLLIVAVGKPGFIPGDWIKEGAIVIDVGINRLENGKVVGDVVFEDAAKRASYITPVPGGVGPMTVATLIENTLQACVEYHDPQDE"
297
+ assert_equal(expected, @obj.aaseq)
298
+ end
299
+
300
+ def test_aalen
301
+ assert_equal(288, @obj.aalen)
302
+ end
303
+
304
+ def test_ntseq
305
+ expected = "atggcagcaaagattattgacggtaaaacgattgcgcagcaggtgcgctctgaagttgctcaaaaagttcaggcgcgtattgcagccggactgcgggcaccaggactggccgttgtgctggtgggtagtaaccctgcatcgcaaatttatgtcgcaagcaaacgcaaggcttgtgaagaagtcgggttcgtctcccgctcttatgacctcccggaaaccaccagcgaagcggagctgctggagcttatcgatacgctgaatgccgacaacaccatcgatggcattctggttcaactgccgttaccggcgggtattgataacgtcaaagtgctggaacgtattcatccggacaaagacgtggacggtttccatccttacaacgtcggtcgtctgtgccagcgcgcgccgcgtctgcgtccctgcaccccgcgcggtatcgtcacgctgcttgagcgttacaacattgataccttcggcctcaacgccgtggtgattggcgcatcgaatatcgttggccgcccgatgagcatggaactgctgctggcaggttgcaccactacagtgactcaccgcttcactaaaaatctgcgtcatcacgtagaaaatgccgatctattgatcgttgccgttggcaagccaggctttattcccggtgactggatcaaagaaggcgcaattgtgattgatgtcggcatcaaccgtctggaaaatggcaaagttgtgggcgacgtcgtgtttgaagacgcggctaaacgcgcctcatacattacgcctgttcccggcggcgttggcccgatgacggttgccacgctgattgaaaacacgctacaggcgtgcgttgaatatcatgatccacaggatgagtaa"
306
+ assert_equal(expected, @obj.ntseq)
307
+ end
308
+
309
+ def test_ntlen
310
+ assert_equal(867, @obj.ntlen)
311
+ end
312
+
313
+ def test_pathway_after_pathways_as_strings
314
+ str = "eco00630 Glyoxylate and dicarboxylate metabolism eco00670 One carbon pool by folate eco01100 Metabolic pathways"
315
+ strary = [ "eco00630 Glyoxylate and dicarboxylate metabolism",
316
+ "eco00670 One carbon pool by folate",
317
+ "eco01100 Metabolic pathways" ]
318
+ 2.times {
319
+ assert_equal(str, @obj.pathway)
320
+ assert_equal(strary, @obj.pathways_as_strings)
321
+ }
322
+ end
323
+
324
+ def test_pathway_before_pathways_as_strings
325
+ str = "eco00630 Glyoxylate and dicarboxylate metabolism eco00670 One carbon pool by folate eco01100 Metabolic pathways"
326
+ strary = [ "eco00630 Glyoxylate and dicarboxylate metabolism",
327
+ "eco00670 One carbon pool by folate",
328
+ "eco01100 Metabolic pathways" ]
329
+ 2.times {
330
+ assert_equal(strary, @obj.pathways_as_strings)
331
+ assert_equal(str, @obj.pathway)
332
+ }
333
+ end
334
+
335
+ def test_keggclass
336
+ expected = "Metabolism; Carbohydrate Metabolism; Glyoxylate and dicarboxylate metabolism [PATH:eco00630] Metabolism; Metabolism of Cofactors and Vitamins; One carbon pool by folate [PATH:eco00670]"
337
+ assert_equal(expected, @obj.keggclass)
338
+ end
339
+
340
+ def test_keggclasses
341
+ expected =
342
+ [ "Metabolism; Carbohydrate Metabolism; Glyoxylate and dicarboxylate metabolism",
343
+ "Metabolism; Metabolism of Cofactors and Vitamins; One carbon pool by folate"
344
+ ]
345
+ assert_equal(expected, @obj.keggclasses)
346
+ end
347
+
348
+ end #class TestBioKEGGGENES_b0529
349
+ end #module Bio
350
+
351
+
352
+
353
+
@@ -0,0 +1,408 @@
1
+ #
2
+ # test/unit/bio/db/kegg/test_genome.rb - Unit test for Bio::KEGG::GENOME
3
+ #
4
+ # Copyright:: Copyright (C) 2010 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/genome.rb'
16
+
17
+ module Bio
18
+ class TestBioKEGGGENOME_T00005 < Test::Unit::TestCase
19
+
20
+ def setup
21
+ filename = File.join(BioRubyTestDataPath, 'KEGG/T00005.genome')
22
+ @obj = Bio::KEGG::GENOME.new(File.read(filename))
23
+ end
24
+
25
+ def test_new
26
+ assert_instance_of(Bio::KEGG::GENOME, @obj)
27
+ end
28
+
29
+ def test_entry_id
30
+ assert_equal("T00005", @obj.entry_id)
31
+ end
32
+
33
+ def test_name
34
+ expected = "sce, S.cerevisiae, YEAST, 4932"
35
+ assert_equal(expected, @obj.name)
36
+ end
37
+
38
+ def test_definition
39
+ expected = "Saccharomyces cerevisiae S288C"
40
+ assert_equal(expected, @obj.definition)
41
+ end
42
+
43
+ def test_taxonomy
44
+ expected = { "lineage"=>
45
+ "Eukaryota; Fungi; Dikarya; Ascomycota; Saccharomycotina; Saccharomycetes; Saccharomycetales; Saccharomycetaceae; Saccharomyces",
46
+ "taxid"=>"TAX:4932" }
47
+ assert_equal(expected, @obj.taxonomy)
48
+ end
49
+
50
+ def test_taxid
51
+ assert_equal("TAX:4932", @obj.taxid)
52
+ end
53
+
54
+ def test_lineage
55
+ expected = "Eukaryota; Fungi; Dikarya; Ascomycota; Saccharomycotina; Saccharomycetes; Saccharomycetales; Saccharomycetaceae; Saccharomyces"
56
+ assert_equal(expected, @obj.lineage)
57
+ end
58
+
59
+ def test_data_source
60
+ assert_equal("RefSeq", @obj.data_source)
61
+ end
62
+
63
+ def test_original_db
64
+ assert_equal("SGD MIPS", @obj.original_db)
65
+ end
66
+
67
+ def test_original_databases
68
+ assert_equal([ "SGD", "MIPS" ], @obj.original_databases)
69
+ end
70
+
71
+ def test_disease
72
+ assert_equal("", @obj.disease)
73
+ end
74
+
75
+ def test_comment
76
+ assert_equal("", @obj.comment)
77
+ end
78
+
79
+ def test_references
80
+ data =
81
+ [ { "authors" => ["Goffeau A", "et al."],
82
+ "comments" => nil,
83
+ "journal" => "Science",
84
+ "pages" => "546-67",
85
+ "pubmed" => "8849441",
86
+ "title" => "Life with 6000 genes.",
87
+ "volume" => "274",
88
+ "year" => "1996",
89
+ },
90
+ { "authors" => ["Bussey H", "et al."],
91
+ "comments" => ["(chromosome I)"],
92
+ "journal" => "Proc Natl Acad Sci U S A",
93
+ "pages" => "3809-13",
94
+ "pubmed" => "7731988",
95
+ "title" => "The nucleotide sequence of chromosome I from Saccharomyces cerevisiae.",
96
+ "volume" => "92",
97
+ "year" => "1995",
98
+ },
99
+ { "authors" => ["Feldmann, H.", "et al."],
100
+ "comments" => ["(chromosome II)"],
101
+ "journal" => "EMBO J",
102
+ "pages" => "5795-809",
103
+ "pubmed" => "7813418",
104
+ "title" => "Complete DNA sequence of yeast chromosome II.",
105
+ "volume" => "13",
106
+ "year" => "1994",
107
+ },
108
+ { "authors" => ["Oliver, S.G.", "et al."],
109
+ "comments" => ["(chromosome III)"],
110
+ "journal" => "Nature",
111
+ "pages" => "38-46",
112
+ "pubmed" => "1574125",
113
+ "title" => "The complete DNA sequence of yeast chromosome III.",
114
+ "volume" => "357",
115
+ "year" => "1992",
116
+ },
117
+ { "authors" => ["Jacq C", "et al."],
118
+ "comments" => ["(chromosome IV)"],
119
+ "journal" => "Nature",
120
+ "pages" => "75-8",
121
+ "pubmed" => "9169867",
122
+ "title" => "The nucleotide sequence of Saccharomyces cerevisiae chromosome IV.",
123
+ "volume" => "387(6632 Suppl)",
124
+ "year" => "1997",
125
+ },
126
+ { "authors" => ["Dietrich FS", "et al."],
127
+ "comments" => ["(chromosome V)"],
128
+ "journal" => "Nature",
129
+ "pages" => "78-81",
130
+ "pubmed" => "9169868",
131
+ "title" => "The nucleotide sequence of Saccharomyces cerevisiae chromosome V.",
132
+ "volume" => "387(6632 Suppl)",
133
+ "year" => "1997",
134
+ },
135
+ { "authors" => ["Murakami, Y.", "et al."],
136
+ "comments" => ["(chromosome VI)"],
137
+ "journal" => "Nat Genet",
138
+ "pages" => "261-8",
139
+ "pubmed" => "7670463",
140
+ "title" => "Analysis of the nucleotide sequence of chromosome VI from Saccharomyces cerevisiae.",
141
+ "volume" => "10",
142
+ "year" => "1995",
143
+ },
144
+ { "authors" => ["Tettelin H", "et al."],
145
+ "comments" => ["(chromosome VII)"],
146
+ "journal" => "Nature",
147
+ "pages" => "81-4",
148
+ "pubmed" => "9169869",
149
+ "title" => "The nucleotide sequence of Saccharomyces cerevisiae chromosome VII.",
150
+ "volume" => "387(6632 Suppl)",
151
+ "year" => "1997",
152
+ },
153
+ { "authors" => ["Johnston, M.", "et al."],
154
+ "comments" => ["(chromosome VIII)"],
155
+ "journal" => "Science",
156
+ "pages" => "2077-82",
157
+ "pubmed" => "8091229",
158
+ "title" => "Complete nucleotide sequence of Saccharomyces cerevisiae chromosome VIII.",
159
+ "volume" => "265",
160
+ "year" => "1994",
161
+ },
162
+ { "authors" => ["Churcher C", "et al."],
163
+ "comments" => ["(chromosome IX)"],
164
+ "journal" => "Nature",
165
+ "pages" => "84-7",
166
+ "pubmed" => "9169870",
167
+ "title" => "The nucleotide sequence of Saccharomyces cerevisiae chromosome IX.",
168
+ "volume" => "387(6632 Suppl)",
169
+ "year" => "1997",
170
+ },
171
+ { "authors" => ["Galibert, F.", "et al."],
172
+ "comments" => ["(chromosome X)"],
173
+ "journal" => "EMBO J",
174
+ "pages" => "2031-49",
175
+ "pubmed" => "8641269",
176
+ "title" => "Complete nucleotide sequence of Saccharomyces cerevisiae chromosome X.",
177
+ "volume" => "15",
178
+ "year" => "1996",
179
+ },
180
+ { "authors" => ["Dujon, B.", "et al."],
181
+ "comments" => ["(chromosome XI)"],
182
+ "journal" => "Nature",
183
+ "pages" => "371-8",
184
+ "pubmed" => "8196765",
185
+ "title" => "Complete DNA sequence of yeast chromosome XI.",
186
+ "volume" => "369",
187
+ "year" => "1994",
188
+ },
189
+ { "authors" => ["Johnston M", "et al."],
190
+ "comments" => ["(chromosome XII)"],
191
+ "journal" => "Nature",
192
+ "pages" => "87-90",
193
+ "pubmed" => "9169871",
194
+ "title" => "The nucleotide sequence of Saccharomyces cerevisiae chromosome XII.",
195
+ "volume" => "387(6632 Suppl)",
196
+ "year" => "1997",
197
+ },
198
+ { "authors" => ["Bowman S", "et al."],
199
+ "comments" => ["(chromosome XIII)"],
200
+ "journal" => "Nature",
201
+ "pages" => "90-3",
202
+ "pubmed" => "9169872",
203
+ "title" => "The nucleotide sequence of Saccharomyces cerevisiae chromosome XIII.",
204
+ "volume" => "387(6632 Suppl)",
205
+ "year" => "1997",
206
+ },
207
+ { "authors" => ["Philippsen P", "et al."],
208
+ "comments" => ["(chromosome XIV)"],
209
+ "journal" => "Nature",
210
+ "pages" => "93-8",
211
+ "pubmed" => "9169873",
212
+ "title" => "The nucleotide sequence of Saccharomyces cerevisiae chromosome XIV and its evolutionary implications.",
213
+ "volume" => "387(6632 Suppl)",
214
+ "year" => "1997",
215
+ },
216
+ { "authors" => ["Dujon B", "et al."],
217
+ "comments" => ["(chromosome XV)"],
218
+ "journal" => "Nature",
219
+ "pages" => "98-102",
220
+ "pubmed" => "9169874",
221
+ "title" => "The nucleotide sequence of Saccharomyces cerevisiae chromosome XV.",
222
+ "volume" => "387(6632 Suppl)",
223
+ "year" => "1997",
224
+ },
225
+ { "authors" => ["Bussey H", "et al."],
226
+ "comments" => ["(chromosome XVI)"],
227
+ "journal" => "Nature",
228
+ "pages" => "103-5",
229
+ "pubmed" => "9169875",
230
+ "title" => "The nucleotide sequence of Saccharomyces cerevisiae chromosome XVI.",
231
+ "volume" => "387(6632 Suppl)",
232
+ "year" => "1997",
233
+ }
234
+ ]
235
+ expected = data.collect { |h| Bio::Reference.new(h) }
236
+ #assert_equal(expected, @obj.references)
237
+ expected.each_with_index do |x, i|
238
+ assert_equal(x, @obj.references[i])
239
+ end
240
+ end
241
+
242
+ def test_chromosomes
243
+ expected =
244
+ [{"SEQUENCE"=>"RS:NC_001133", "LENGTH"=>"230208", "CHROMOSOME"=>"I"},
245
+ {"SEQUENCE"=>"RS:NC_001134", "LENGTH"=>"813178", "CHROMOSOME"=>"II"},
246
+ {"SEQUENCE"=>"RS:NC_001135", "LENGTH"=>"316617", "CHROMOSOME"=>"III"},
247
+ {"SEQUENCE"=>"RS:NC_001136", "LENGTH"=>"1531919", "CHROMOSOME"=>"IV"},
248
+ {"SEQUENCE"=>"RS:NC_001137", "LENGTH"=>"576869", "CHROMOSOME"=>"V"},
249
+ {"SEQUENCE"=>"RS:NC_001138", "LENGTH"=>"270148", "CHROMOSOME"=>"VI"},
250
+ {"SEQUENCE"=>"RS:NC_001139", "LENGTH"=>"1090947", "CHROMOSOME"=>"VII"},
251
+ {"SEQUENCE"=>"RS:NC_001140", "LENGTH"=>"562643", "CHROMOSOME"=>"VIII"},
252
+ {"SEQUENCE"=>"RS:NC_001141", "LENGTH"=>"439885", "CHROMOSOME"=>"IX"},
253
+ {"SEQUENCE"=>"RS:NC_001142", "LENGTH"=>"745741", "CHROMOSOME"=>"X"},
254
+ {"SEQUENCE"=>"RS:NC_001143", "LENGTH"=>"666454", "CHROMOSOME"=>"XI"},
255
+ {"SEQUENCE"=>"RS:NC_001144", "LENGTH"=>"1078175", "CHROMOSOME"=>"XII"},
256
+ {"SEQUENCE"=>"RS:NC_001145", "LENGTH"=>"924429", "CHROMOSOME"=>"XIII"},
257
+ {"SEQUENCE"=>"RS:NC_001146", "LENGTH"=>"784333", "CHROMOSOME"=>"XIV"},
258
+ {"SEQUENCE"=>"RS:NC_001147", "LENGTH"=>"1091289", "CHROMOSOME"=>"XV"},
259
+ {"SEQUENCE"=>"RS:NC_001148", "LENGTH"=>"948062", "CHROMOSOME"=>"XVI"},
260
+ {"SEQUENCE"=>"RS:NC_001224",
261
+ "LENGTH"=>"85779",
262
+ "CHROMOSOME"=>"MT (mitochondrion); Circular"}
263
+ ]
264
+ assert_equal(expected, @obj.chromosomes)
265
+ end
266
+
267
+ def test_plasmids
268
+ assert_equal([], @obj.plasmids)
269
+ end
270
+
271
+ def test_statistics
272
+ expected = {"num_rna"=>414, "num_nuc"=>12156676, "num_gene"=>5881}
273
+ assert_equal(expected, @obj.statistics)
274
+ end
275
+
276
+ def test_nalen
277
+ assert_equal(12156676, @obj.nalen)
278
+ end
279
+
280
+ def test_num_gene
281
+ assert_equal(5881, @obj.num_gene)
282
+ end
283
+
284
+ def test_num_rna
285
+ assert_equal(414, @obj.num_rna)
286
+ end
287
+
288
+ end #class TestBioKEGGGENOME_T00005
289
+
290
+ class TestBioKEGGGENOME_T00070 < Test::Unit::TestCase
291
+
292
+ def setup
293
+ filename = File.join(BioRubyTestDataPath, 'KEGG/T00070.genome')
294
+ @obj = Bio::KEGG::GENOME.new(File.read(filename))
295
+ end
296
+
297
+ def test_new
298
+ assert_instance_of(Bio::KEGG::GENOME, @obj)
299
+ end
300
+
301
+ def test_entry_id
302
+ assert_equal("T00070", @obj.entry_id)
303
+ end
304
+
305
+ def test_name
306
+ expected = "atu, A.tumefaciens, AGRT5, 176299"
307
+ assert_equal(expected, @obj.name)
308
+ end
309
+
310
+ def test_definition
311
+ expected = "Agrobacterium tumefaciens C58"
312
+ assert_equal(expected, @obj.definition)
313
+ end
314
+
315
+ def test_taxonomy
316
+ expected = { "lineage"=>
317
+ "Bacteria; Proteobacteria; Alphaproteobacteria; Rhizobiales; Rhizobiaceae; Rhizobium/Agrobacterium group; Agrobacterium",
318
+ "taxid" => "TAX:176299" }
319
+ assert_equal(expected, @obj.taxonomy)
320
+ end
321
+
322
+ def test_taxid
323
+ assert_equal("TAX:176299", @obj.taxid)
324
+ end
325
+
326
+ def test_lineage
327
+ expected = "Bacteria; Proteobacteria; Alphaproteobacteria; Rhizobiales; Rhizobiaceae; Rhizobium/Agrobacterium group; Agrobacterium"
328
+ assert_equal(expected, @obj.lineage)
329
+ end
330
+
331
+ def test_data_source
332
+ assert_equal("RefSeq", @obj.data_source)
333
+ end
334
+
335
+ def test_original_db
336
+ assert_equal("UWash", @obj.original_db)
337
+ end
338
+
339
+ def test_original_databases
340
+ assert_equal([ "UWash" ], @obj.original_databases)
341
+ end
342
+
343
+ def test_disease
344
+ expected = "Crown gall disease in plants"
345
+ assert_equal(expected, @obj.disease)
346
+ end
347
+
348
+ def test_comment
349
+ expected = "Originally called Agrobacterium tumefaciens C58 (U.Washington/Dupont) to distinguish from Agrobacterium tumefaciens C58 (Cereon) [GN:atc]"
350
+ assert_equal(expected, @obj.comment)
351
+ end
352
+
353
+ def test_references
354
+ h = {
355
+ "authors" => [ "Wood DW", "et al." ],
356
+ "journal" => "Science",
357
+ "pages" => "2317-23",
358
+ "pubmed" => "11743193",
359
+ "title" => "The genome of the natural genetic engineer Agrobacterium tumefaciens C58.",
360
+ "volume" => "294",
361
+ "year" => "2001"
362
+ }
363
+ expected = [ Bio::Reference.new(h) ]
364
+ assert_equal(expected, @obj.references)
365
+ end
366
+
367
+ def test_chromosomes
368
+ expected = [ { "SEQUENCE" => "RS:NC_003062",
369
+ "LENGTH" => "2841580",
370
+ "CHROMOSOME" => "Circular"},
371
+ { "SEQUENCE" => "RS:NC_003063",
372
+ "LENGTH" => "2075577",
373
+ "CHROMOSOME" => "L (linear chromosome)"} ]
374
+ assert_equal(expected, @obj.chromosomes)
375
+ end
376
+
377
+ def test_plasmids
378
+ expected =
379
+ [ { "SEQUENCE" => "RS:NC_003065",
380
+ "LENGTH" => "214233",
381
+ "PLASMID" => "Ti; Circular" },
382
+ { "SEQUENCE" => "RS:NC_003064",
383
+ "LENGTH" => "542868",
384
+ "PLASMID" => "AT; Circular" }
385
+ ]
386
+ assert_equal(expected, @obj.plasmids)
387
+ end
388
+
389
+ def test_statistics
390
+ expected = {"num_rna"=>74, "num_nuc"=>5674258, "num_gene"=>5355}
391
+ assert_equal(expected, @obj.statistics)
392
+ end
393
+
394
+ def test_nalen
395
+ assert_equal(5674258, @obj.nalen)
396
+ end
397
+
398
+ def test_num_gene
399
+ assert_equal(5355, @obj.num_gene)
400
+ end
401
+
402
+ def test_num_rna
403
+ assert_equal(74, @obj.num_rna)
404
+ end
405
+
406
+ end #class TestBioKEGGGENOME_T00070
407
+ end #module Bio
408
+