bio 0.7.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. data/bin/bioruby +71 -27
  2. data/bin/br_biofetch.rb +5 -17
  3. data/bin/br_bioflat.rb +14 -26
  4. data/bin/br_biogetseq.rb +6 -18
  5. data/bin/br_pmfetch.rb +6 -16
  6. data/doc/Changes-0.7.rd +35 -0
  7. data/doc/KEGG_API.rd +287 -172
  8. data/doc/KEGG_API.rd.ja +273 -160
  9. data/doc/Tutorial.rd +18 -9
  10. data/doc/Tutorial.rd.ja +656 -138
  11. data/lib/bio.rb +6 -24
  12. data/lib/bio/alignment.rb +5 -5
  13. data/lib/bio/appl/blast.rb +132 -98
  14. data/lib/bio/appl/blast/format0.rb +9 -19
  15. data/lib/bio/appl/blast/wublast.rb +5 -18
  16. data/lib/bio/appl/emboss.rb +40 -47
  17. data/lib/bio/appl/hmmer.rb +116 -82
  18. data/lib/bio/appl/hmmer/report.rb +509 -364
  19. data/lib/bio/appl/spidey/report.rb +7 -18
  20. data/lib/bio/data/na.rb +3 -21
  21. data/lib/bio/db.rb +3 -21
  22. data/lib/bio/db/aaindex.rb +147 -52
  23. data/lib/bio/db/embl/common.rb +27 -6
  24. data/lib/bio/db/embl/embl.rb +18 -10
  25. data/lib/bio/db/embl/sptr.rb +87 -67
  26. data/lib/bio/db/embl/swissprot.rb +32 -3
  27. data/lib/bio/db/embl/trembl.rb +32 -3
  28. data/lib/bio/db/embl/uniprot.rb +32 -3
  29. data/lib/bio/db/fasta.rb +327 -289
  30. data/lib/bio/db/medline.rb +25 -4
  31. data/lib/bio/db/nbrf.rb +12 -20
  32. data/lib/bio/db/pdb.rb +4 -1
  33. data/lib/bio/db/pdb/chemicalcomponent.rb +240 -0
  34. data/lib/bio/db/pdb/pdb.rb +13 -8
  35. data/lib/bio/db/rebase.rb +93 -97
  36. data/lib/bio/feature.rb +2 -31
  37. data/lib/bio/io/ddbjxml.rb +167 -139
  38. data/lib/bio/io/fastacmd.rb +89 -56
  39. data/lib/bio/io/flatfile.rb +994 -278
  40. data/lib/bio/io/flatfile/index.rb +257 -194
  41. data/lib/bio/io/flatfile/indexer.rb +37 -29
  42. data/lib/bio/reference.rb +147 -64
  43. data/lib/bio/sequence.rb +57 -417
  44. data/lib/bio/sequence/aa.rb +64 -0
  45. data/lib/bio/sequence/common.rb +175 -0
  46. data/lib/bio/sequence/compat.rb +68 -0
  47. data/lib/bio/sequence/format.rb +134 -0
  48. data/lib/bio/sequence/generic.rb +24 -0
  49. data/lib/bio/sequence/na.rb +189 -0
  50. data/lib/bio/shell.rb +9 -23
  51. data/lib/bio/shell/core.rb +130 -125
  52. data/lib/bio/shell/demo.rb +143 -0
  53. data/lib/bio/shell/{session.rb → interface.rb} +42 -40
  54. data/lib/bio/shell/object.rb +52 -0
  55. data/lib/bio/shell/plugin/codon.rb +4 -22
  56. data/lib/bio/shell/plugin/emboss.rb +23 -0
  57. data/lib/bio/shell/plugin/entry.rb +34 -25
  58. data/lib/bio/shell/plugin/flatfile.rb +5 -23
  59. data/lib/bio/shell/plugin/keggapi.rb +11 -24
  60. data/lib/bio/shell/plugin/midi.rb +5 -23
  61. data/lib/bio/shell/plugin/obda.rb +4 -22
  62. data/lib/bio/shell/plugin/seq.rb +6 -24
  63. data/lib/bio/shell/rails/Rakefile +10 -0
  64. data/lib/bio/shell/rails/app/controllers/application.rb +4 -0
  65. data/lib/bio/shell/rails/app/controllers/shell_controller.rb +94 -0
  66. data/lib/bio/shell/rails/app/helpers/application_helper.rb +3 -0
  67. data/lib/bio/shell/rails/app/models/shell_connection.rb +30 -0
  68. data/lib/bio/shell/rails/app/views/layouts/shell.rhtml +37 -0
  69. data/lib/bio/shell/rails/app/views/shell/history.rhtml +5 -0
  70. data/lib/bio/shell/rails/app/views/shell/index.rhtml +2 -0
  71. data/lib/bio/shell/rails/app/views/shell/show.rhtml +13 -0
  72. data/lib/bio/shell/rails/config/boot.rb +19 -0
  73. data/lib/bio/shell/rails/config/database.yml +85 -0
  74. data/lib/bio/shell/rails/config/environment.rb +53 -0
  75. data/lib/bio/shell/rails/config/environments/development.rb +19 -0
  76. data/lib/bio/shell/rails/config/environments/production.rb +19 -0
  77. data/lib/bio/shell/rails/config/environments/test.rb +19 -0
  78. data/lib/bio/shell/rails/config/routes.rb +19 -0
  79. data/lib/bio/shell/rails/doc/README_FOR_APP +2 -0
  80. data/lib/bio/shell/rails/public/404.html +8 -0
  81. data/lib/bio/shell/rails/public/500.html +8 -0
  82. data/lib/bio/shell/rails/public/dispatch.cgi +10 -0
  83. data/lib/bio/shell/rails/public/dispatch.fcgi +24 -0
  84. data/lib/bio/shell/rails/public/dispatch.rb +10 -0
  85. data/lib/bio/shell/rails/public/favicon.ico +0 -0
  86. data/lib/bio/shell/rails/public/images/icon.png +0 -0
  87. data/lib/bio/shell/rails/public/images/rails.png +0 -0
  88. data/lib/bio/shell/rails/public/index.html +277 -0
  89. data/lib/bio/shell/rails/public/javascripts/controls.js +750 -0
  90. data/lib/bio/shell/rails/public/javascripts/dragdrop.js +584 -0
  91. data/lib/bio/shell/rails/public/javascripts/effects.js +854 -0
  92. data/lib/bio/shell/rails/public/javascripts/prototype.js +1785 -0
  93. data/lib/bio/shell/rails/public/robots.txt +1 -0
  94. data/lib/bio/shell/rails/public/stylesheets/main.css +187 -0
  95. data/lib/bio/shell/rails/script/about +3 -0
  96. data/lib/bio/shell/rails/script/breakpointer +3 -0
  97. data/lib/bio/shell/rails/script/console +3 -0
  98. data/lib/bio/shell/rails/script/destroy +3 -0
  99. data/lib/bio/shell/rails/script/generate +3 -0
  100. data/lib/bio/shell/rails/script/performance/benchmarker +3 -0
  101. data/lib/bio/shell/rails/script/performance/profiler +3 -0
  102. data/lib/bio/shell/rails/script/plugin +3 -0
  103. data/lib/bio/shell/rails/script/process/reaper +3 -0
  104. data/lib/bio/shell/rails/script/process/spawner +3 -0
  105. data/lib/bio/shell/rails/script/process/spinner +3 -0
  106. data/lib/bio/shell/rails/script/runner +3 -0
  107. data/lib/bio/shell/rails/script/server +42 -0
  108. data/lib/bio/shell/rails/test/test_helper.rb +28 -0
  109. data/lib/bio/shell/web.rb +90 -0
  110. data/lib/bio/util/contingency_table.rb +231 -225
  111. data/sample/any2fasta.rb +59 -0
  112. data/test/data/HMMER/hmmpfam.out +64 -0
  113. data/test/data/HMMER/hmmsearch.out +88 -0
  114. data/test/data/aaindex/DAYM780301 +30 -0
  115. data/test/data/aaindex/PRAM900102 +20 -0
  116. data/test/data/bl2seq/cd8a_cd8b_blastp.bl2seq +53 -0
  117. data/test/data/bl2seq/cd8a_p53_e-5blastp.bl2seq +37 -0
  118. data/test/data/blast/{eco:b0002.faa → b0002.faa} +0 -0
  119. data/test/data/blast/{eco:b0002.faa.m0 → b0002.faa.m0} +2 -2
  120. data/test/data/blast/{eco:b0002.faa.m7 → b0002.faa.m7} +1 -1
  121. data/test/data/blast/{eco:b0002.faa.m8 → b0002.faa.m8} +0 -0
  122. data/test/unit/bio/appl/bl2seq/test_report.rb +134 -0
  123. data/test/unit/bio/appl/blast/test_report.rb +15 -12
  124. data/test/unit/bio/appl/blast/test_xmlparser.rb +4 -4
  125. data/test/unit/bio/appl/hmmer/test_report.rb +355 -0
  126. data/test/unit/bio/appl/test_blast.rb +5 -5
  127. data/test/unit/bio/data/test_na.rb +9 -18
  128. data/test/unit/bio/db/pdb/test_pdb.rb +169 -0
  129. data/test/unit/bio/db/test_aaindex.rb +197 -0
  130. data/test/unit/bio/io/test_fastacmd.rb +55 -0
  131. data/test/unit/bio/sequence/test_aa.rb +102 -0
  132. data/test/unit/bio/sequence/test_common.rb +178 -0
  133. data/test/unit/bio/sequence/test_compat.rb +82 -0
  134. data/test/unit/bio/sequence/test_na.rb +242 -0
  135. data/test/unit/bio/shell/plugin/test_seq.rb +29 -19
  136. data/test/unit/bio/test_alignment.rb +15 -7
  137. data/test/unit/bio/test_reference.rb +198 -0
  138. data/test/unit/bio/test_sequence.rb +4 -49
  139. data/test/unit/bio/test_shell.rb +2 -2
  140. metadata +118 -15
  141. data/lib/bio/io/brdb.rb +0 -103
  142. data/lib/bioruby.rb +0 -34
@@ -1,23 +1,11 @@
1
1
  #
2
2
  # test/unit/bio/shell/plugin/test_seq.rb - Unit test for Bio::Shell plugin for biological sequence manipulations
3
3
  #
4
- # Copyright (C) 2005 Mitsuteru Nakao <n@bioruby.org>
4
+ # Copyright:: Copyright (C) 2005
5
+ # Mitsuteru Nakao <n@bioruby.org>
6
+ # License:: Ruby's
5
7
  #
6
- # This library is free software; you can redistribute it and/or
7
- # modify it under the terms of the GNU Lesser General Public
8
- # License as published by the Free Software Foundation; either
9
- # version 2 of the License, or (at your option) any later version.
10
- #
11
- # This library is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- # Lesser General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Lesser General Public
17
- # License along with this library; if not, write to the Free Software
18
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- #
20
- # $Id: test_seq.rb,v 1.5 2005/12/19 02:44:03 k Exp $
8
+ # $Id: test_seq.rb,v 1.7 2006/02/27 09:40:13 nakao Exp $
21
9
  #
22
10
 
23
11
  require 'pathname'
@@ -25,13 +13,30 @@ libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5, 'lib')).cle
25
13
  $:.unshift(libpath) unless $:.include?(libpath)
26
14
 
27
15
  require 'test/unit'
28
- require 'bioruby'
16
+ require 'bio/shell'
17
+ require 'bio/shell/plugin/seq'
29
18
 
30
19
  module Bio
20
+
31
21
  class TestShellPluginSeq < Test::Unit::TestCase
22
+ include Bio::Shell
23
+
24
+ Bio::Shell.config = {:color => false}
25
+
26
+ def test_htmlseq
27
+ str = 'ATGC'
28
+ html =<<END
29
+ <div style="font-family:monospace;">
30
+ <span style="background:#64F73F;">a</span>
31
+ <span style="background:#3C88EE;">t</span>
32
+ <span style="background:#EB413C;">g</span>
33
+ <span style="background:#FFB340;">c</span>
34
+ <br>
35
+ </div>
36
+ END
37
+ assert_equal(html, htmlseq(str))
38
+ end
32
39
 
33
- # include Bio::Shell
34
- # Bio::Shell.instance_variable_set :@config, {}
35
40
 
36
41
  def test_naseq
37
42
  str = 'ACGT'
@@ -40,6 +45,7 @@ module Bio
40
45
  assert_equal('acgt', seq(str))
41
46
  end
42
47
 
48
+
43
49
  def test_aaseq
44
50
  str = 'WD'
45
51
  assert_equal(Bio::Sequence::AA, seq(str).class)
@@ -47,6 +53,7 @@ module Bio
47
53
  assert_equal('WD', seq(str))
48
54
  end
49
55
 
56
+
50
57
  def test_na_seqstat
51
58
  naseq = 'atgcatgcatgc'
52
59
  output =<<END
@@ -112,6 +119,7 @@ END
112
119
  assert_equal(output, $str)
113
120
  end
114
121
 
122
+
115
123
  def test_aa_seqstat
116
124
  aaseq = 'WD'
117
125
  output =<<END
@@ -138,6 +146,7 @@ END
138
146
  assert_equal(output, $str)
139
147
  end
140
148
 
149
+
141
150
  def test_doublehelix
142
151
  seq = 'ACGTACGTACGTACGT'
143
152
  output = <<END
@@ -172,4 +181,5 @@ END
172
181
  end
173
182
 
174
183
  end
184
+
175
185
  end
@@ -18,7 +18,7 @@
18
18
  # License along with this library; if not, write to the Free Software
19
19
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
20
  #
21
- # $Id: test_alignment.rb,v 1.6 2005/12/02 13:01:49 ngoto Exp $
21
+ # $Id: test_alignment.rb,v 1.7 2006/01/24 14:11:34 ngoto Exp $
22
22
  #
23
23
 
24
24
  require 'pathname'
@@ -519,12 +519,20 @@ module Bio
519
519
  end
520
520
 
521
521
  def test_alignment_subseq
522
- a = A[ Sequence.new('a'), Sequence.new('at'), Sequence.new('atgca'),
523
- Sequence.new('atg'), Sequence.new('') ]
524
- assert_equal(Alignment::SequenceArray[ Sequence.new(''),
525
- Sequence.new('t'), Sequence.new('tgc'),
526
- Sequence.new('tg'), nil ],
527
- a.alignment_subseq(2,4))
522
+ a = A[
523
+ Sequence::NA.new('a'),
524
+ Sequence::NA.new('at'),
525
+ Sequence::NA.new('atgca'),
526
+ Sequence::NA.new('atg'),
527
+ Sequence::NA.new('')
528
+ ]
529
+ assert_equal(Alignment::SequenceArray[
530
+ Sequence::NA.new(''),
531
+ Sequence::NA.new('t'),
532
+ Sequence::NA.new('tgc'),
533
+ Sequence::NA.new('tg'),
534
+ nil
535
+ ], a.alignment_subseq(2,4))
528
536
  end
529
537
 
530
538
  def test_alignment_concat
@@ -0,0 +1,198 @@
1
+ #
2
+ # = test/bio/tc_pathway.rb - Unit test for Bio::Pathway
3
+ #
4
+ # Copyright:: Copyright (C) 2006
5
+ # Mitsuteru C. Nakao <n@bioruby.org>
6
+ # Lisence:: Ruby's
7
+ #
8
+ # $Id: test_reference.rb,v 1.1 2006/02/08 15:06:26 nakao Exp $
9
+ #
10
+
11
+ require 'pathname'
12
+ libpath = Pathname.new(File.join(File.dirname(__FILE__), [".."] * 3, "lib")).cleanpath.to_s
13
+ $:.unshift(libpath) unless $:.include?(libpath)
14
+
15
+ require 'test/unit'
16
+ require 'bio/reference'
17
+
18
+
19
+ module Bio
20
+ class TestReference < Test::Unit::TestCase
21
+
22
+ def setup
23
+ hash = {'authors' => [ "Hoge, J.P.", "Fuga, F.B." ], 'title' => "Title of the study.",
24
+ 'journal' => "Theor. J. Hoge", 'volume' => 12, 'issue' => 3, 'pages' => "123-145",
25
+ 'year' => 2001, 'pubmed' => 12345678, 'medline' => 98765432, 'abstract' => "Hoge fuga. hoge fuga.",
26
+ 'url' => "http://example.com", 'mesh' => ['Hoge'], 'affiliations' => ['Tokyo']}
27
+ @obj = Bio::Reference.new(hash)
28
+ end
29
+
30
+ def test_authors
31
+ ary = [ "Hoge, J.P.", "Fuga, F.B." ]
32
+ assert_equal(ary, @obj.authors)
33
+ end
34
+
35
+ def test_journal
36
+ str = 'Theor. J. Hoge'
37
+ assert_equal(str, @obj.journal)
38
+ end
39
+
40
+ def test_volume
41
+ str = 12
42
+ assert_equal(str, @obj.volume)
43
+ end
44
+
45
+ def test_issue
46
+ str = 3
47
+ assert_equal(str, @obj.issue)
48
+ end
49
+
50
+ def test_pages
51
+ str = '123-145'
52
+ assert_equal(str, @obj.pages)
53
+ end
54
+
55
+ def test_year
56
+ str = 2001
57
+ assert_equal(str, @obj.year)
58
+ end
59
+
60
+ def test_pubmed
61
+ str = 12345678
62
+ assert_equal(str, @obj.pubmed)
63
+ end
64
+
65
+ def test_abstract
66
+ str = 'Hoge fuga. hoge fuga.'
67
+ assert_equal(str, @obj.abstract)
68
+ end
69
+
70
+ def test_url
71
+ str = 'http://example.com'
72
+ assert_equal(str, @obj.url)
73
+ end
74
+
75
+ def test_mesh
76
+ str = ['Hoge']
77
+ assert_equal(str, @obj.mesh)
78
+ end
79
+
80
+ def test_affiliations
81
+ str = ['Tokyo']
82
+ assert_equal(str, @obj.affiliations)
83
+ end
84
+
85
+ def test_format_general
86
+ str = 'Hoge, J.P., Fuga, F.B. (2001). "Title of the study." Theor. J. Hoge 12:123-145.'
87
+ assert_equal(str, @obj.format)
88
+ assert_equal(str, @obj.format('general'))
89
+ assert_equal(str, @obj.general)
90
+ end
91
+
92
+ def test_format_endnote
93
+ str = "%0 Journal Article\n%A Hoge, J.P.\n%A Fuga, F.B.\n%D 2001\n%T Title of the study.\n%J Theor. J. Hoge\n%V 12\n%N 3\n%P 123-145\n%M 12345678\n%U http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=12345678\n%X Hoge fuga. hoge fuga.\n%K Hoge\n%+ Tokyo"
94
+ assert_equal(str, @obj.format('endnote'))
95
+ assert_equal(str, @obj.endnote)
96
+ end
97
+
98
+ def test_format_bibitem
99
+ str = "\\bibitem{PMID:12345678}\nHoge, J.P., Fuga, F.B.\nTitle of the study.,\n{\\em Theor. J. Hoge}, 12(3):123--145, 2001."
100
+ assert_equal(str, @obj.format('bibitem'))
101
+ assert_equal(str, @obj.bibitem)
102
+ end
103
+
104
+ def test_format_bibtex
105
+ str =<<END
106
+ @article{PMID:12345678,
107
+ author = {Hoge, J.P. and Fuga, F.B.},
108
+ title = {Title of the study.},
109
+ journal = {Theor. J. Hoge},
110
+ year = {2001},
111
+ volume = {12},
112
+ number = {3},
113
+ pages = {123--145},
114
+ }
115
+ END
116
+ assert_equal(str, @obj.format('bibtex'))
117
+ assert_equal(str, @obj.bibtex)
118
+ end
119
+
120
+ def test_format_rd
121
+ str = "== Title of the study.\n\n* Hoge, J.P. and Fuga, F.B.\n\n* Theor. J. Hoge 2001 12:123-145 [PMID:12345678]\n\nHoge fuga. hoge fuga."
122
+ assert_equal(str, @obj.format('rd'))
123
+ assert_equal(str, @obj.rd)
124
+ end
125
+
126
+ def test_format_nature
127
+ str = 'Hoge, J.P. & Fuga, F.B. Title of the study. Theor. J. Hoge 12, 123-145 (2001).'
128
+ assert_equal(str, @obj.format('Nature'))
129
+ assert_equal(str, @obj.format('nature'))
130
+ assert_equal(str, @obj.nature)
131
+ end
132
+
133
+ def test_format_science
134
+ str = 'J.P. Hoge, F.B. Fuga, Theor. J. Hoge 12 123 (2001).'
135
+ assert_equal(str, @obj.format('Science'))
136
+ assert_equal(str, @obj.format('science'))
137
+ assert_equal(str, @obj.science)
138
+ end
139
+
140
+ def test_format_genome_biol
141
+ str = 'Hoge JP, Fuga FB: Title of the study. Theor J Hoge 2001, 12:123-145.'
142
+ assert_equal(str, @obj.format('genome biol'))
143
+ assert_equal(str, @obj.genome_biol)
144
+ end
145
+
146
+ def test_format_genome_res
147
+ str = "Hoge, J.P. and Fuga, F.B. 2001.\n Title of the study. Theor. J. Hoge 12: 123-145."
148
+ assert_equal(str, @obj.format('genome res'))
149
+ assert_equal(str, @obj.genome_res)
150
+ end
151
+
152
+ def test_format_nar
153
+ str = 'Hoge, J.P. and Fuga, F.B. (2001) Title of the study. Theor. J. Hoge, 12, 123-145.'
154
+ assert_equal(str, @obj.format('nar'))
155
+ assert_equal(str, @obj.nar)
156
+ end
157
+
158
+ def test_format_current
159
+ str = 'Hoge JP, Fuga FB: Title of the study. Theor J Hoge 2001, 12:123-145.'
160
+ assert_equal(str, @obj.format('current biology'))
161
+ end
162
+
163
+ def test_format_trends
164
+ str = 'Hoge, J.P. and Fuga, F.B. (2001) Title of the study. Theor. J. Hoge 12, 123-145'
165
+ assert_equal(str, @obj.trends)
166
+ end
167
+
168
+ def test_format_cell
169
+ str = 'Hoge, J.P. and Fuga, F.B. (2001). Title of the study. Theor. J. Hoge 12, 123-145.'
170
+ assert_equal(str, @obj.format('cell'))
171
+ end
172
+
173
+ end
174
+
175
+ class TestReferences < Test::Unit::TestCase
176
+
177
+ def setup
178
+ hash = {}
179
+ ary = [Bio::Reference.new(hash),
180
+ Bio::Reference.new(hash)]
181
+ @obj = Bio::References.new(ary)
182
+ end
183
+
184
+ def test_append
185
+ hash = {}
186
+ ref = Bio::Reference.new(hash)
187
+ assert(@obj.append(ref))
188
+ end
189
+
190
+ def test_each
191
+ @obj.each do |ref|
192
+ assert(ref)
193
+ end
194
+ end
195
+
196
+ end
197
+
198
+ end
@@ -1,7 +1,8 @@
1
1
  #
2
- # test/unit/bio/tc_sequence.rb - Unit test for Bio::Sequencce
2
+ # test/unit/bio/test_sequence.rb - Unit test for Bio::Sequencce
3
3
  #
4
4
  # Copyright (C) 2004 Moses Hohman <mmhohman@northwestern.edu>
5
+ # Copyright (C) 2006 Mitsuteru C. Nakao <n@bioruby.org>
5
6
  #
6
7
  # This library is free software; you can redistribute it and/or
7
8
  # modify it under the terms of the GNU Lesser General Public
@@ -17,7 +18,7 @@
17
18
  # License along with this library; if not, write to the Free Software
18
19
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
20
  #
20
- # $Id: test_sequence.rb,v 1.5 2005/11/26 06:51:45 nakao Exp $
21
+ # $Id: test_sequence.rb,v 1.6 2006/02/05 17:39:27 nakao Exp $
21
22
  #
22
23
 
23
24
  require 'pathname'
@@ -29,34 +30,14 @@ require 'bio/sequence'
29
30
 
30
31
  module Bio
31
32
  class TestSequence < Test::Unit::TestCase
33
+
32
34
  def setup
33
35
  @na = Sequence::NA.new('atgcatgcatgcatgcaaaa')
34
36
  @rna = Sequence::NA.new('augcaugcaugcaugcaaaa')
35
37
  @aa = Sequence::AA.new('ACDEFGHIKLMNPQRSTVWYU')
36
38
  end
37
39
 
38
- def test_to_s_returns_self_as_string
39
- s = "abcefghijklmnop"
40
- sequence = Sequence.new(s)
41
- assert_equal(s, sequence.to_s, "wrong value")
42
- assert_instance_of(String, sequence.to_s, "not a String")
43
- end
44
-
45
- def test_subseq_returns_nil_blank_sequence_default_end
46
- sequence = Sequence.new("")
47
- assert_nil(sequence.subseq(5))
48
- end
49
40
 
50
- def test_subseq_returns_nil_start_less_than_one
51
- sequence = Sequence.new("blahblah")
52
- assert_nil(sequence.subseq(0))
53
- end
54
-
55
- def test_subseq_returns_subsequence
56
- sequence = Sequence.new("hahasubhehe")
57
- assert_equal("sub", sequence.subseq(5,7))
58
- end
59
-
60
41
  # "main" method tests translated into unit tests
61
42
 
62
43
  # Test Sequence::NA.new
@@ -124,32 +105,6 @@ module Bio
124
105
  assert_equal(?t, sequence[1])
125
106
  end
126
107
 
127
- # Test Sequence#to_fasta
128
-
129
- def test_to_fasta
130
- sequence = Sequence.new("agtc"*10)
131
- header = "the header"
132
- assert_equal(">the header\n" + ("agtc"*5) + "\n" + ("agtc"*5) + "\n", sequence.to_fasta(header, 20))
133
- end
134
-
135
- # Test Sequence#window_wearch
136
-
137
- def test_window_search_with_width_3_default_step_no_residual
138
- sequence = Sequence.new("agtca")
139
- windows = []
140
- returned_value = sequence.window_search(3) { |window| windows << window }
141
- assert_equal(["agt", "gtc", "tca"], windows, "windows wrong")
142
- assert_equal("", returned_value, "returned value wrong")
143
- end
144
-
145
- # added
146
- def test_window_search_with_width_3_step_two_with_residual
147
- sequence = Sequence::NA.new("agtcat")
148
- windows = []
149
- returned_value = sequence.window_search(3, 2) { |window| windows << window }
150
- assert_equal(["agt", "tca"], windows, "windows wrong")
151
- assert_equal("t", returned_value, "returned value wrong")
152
- end
153
108
 
154
109
  # Test Sequence#total
155
110
 
@@ -17,7 +17,7 @@
17
17
  # License along with this library; if not, write to the Free Software
18
18
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
19
  #
20
- # $Id: test_shell.rb,v 1.4 2005/12/18 17:00:10 k Exp $
20
+ # $Id: test_shell.rb,v 1.5 2006/02/21 17:40:37 nakao Exp $
21
21
  #
22
22
 
23
23
  require 'pathname'
@@ -25,7 +25,7 @@ libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3, 'lib')).cle
25
25
  $:.unshift(libpath) unless $:.include?(libpath)
26
26
 
27
27
  require 'test/unit'
28
- require 'bioruby'
28
+ require 'bio/shell'
29
29
 
30
30
  module Bio
31
31
  end
metadata CHANGED
@@ -3,17 +3,17 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: bio
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.7.1
7
- date: 2006-01-20 00:00:00 +09:00
8
- summary: BioRuby is a library for bioinformatics (biology + information science).
6
+ version: 1.0.0
7
+ date: 2006-02-27 00:00:00 +09:00
8
+ summary: Bioinformatics library
9
9
  require_paths:
10
10
  - lib
11
11
  email: staff@bioruby.org
12
12
  homepage: http://bioruby.org/
13
- rubyforge_project:
14
- description:
13
+ rubyforge_project: bioruby
14
+ description: BioRuby is a library for bioinformatics (biology + information science).
15
15
  autorequire: bio
16
- default_executable:
16
+ default_executable: bioruby
17
17
  bindir: bin
18
18
  has_rdoc: false
19
19
  required_ruby_version: !ruby/object:Gem::Version::Requirement
@@ -45,7 +45,6 @@ files:
45
45
  - etc/bioinformatics/seqdatabase.ini
46
46
  - lib/bio
47
47
  - lib/bio.rb
48
- - lib/bioruby.rb
49
48
  - lib/bio/alignment.rb
50
49
  - lib/bio/appl
51
50
  - lib/bio/command.rb
@@ -57,6 +56,7 @@ files:
57
56
  - lib/bio/location.rb
58
57
  - lib/bio/pathway.rb
59
58
  - lib/bio/reference.rb
59
+ - lib/bio/sequence
60
60
  - lib/bio/sequence.rb
61
61
  - lib/bio/shell
62
62
  - lib/bio/shell.rb
@@ -147,11 +147,11 @@ files:
147
147
  - lib/bio/db/kegg/reaction.rb
148
148
  - lib/bio/db/pdb/atom.rb
149
149
  - lib/bio/db/pdb/chain.rb
150
+ - lib/bio/db/pdb/chemicalcomponent.rb
150
151
  - lib/bio/db/pdb/model.rb
151
152
  - lib/bio/db/pdb/pdb.rb
152
153
  - lib/bio/db/pdb/residue.rb
153
154
  - lib/bio/db/pdb/utils.rb
154
- - lib/bio/io/brdb.rb
155
155
  - lib/bio/io/das.rb
156
156
  - lib/bio/io/dbget.rb
157
157
  - lib/bio/io/ddbjxml.rb
@@ -168,16 +168,91 @@ files:
168
168
  - lib/bio/io/flatfile/bdb.rb
169
169
  - lib/bio/io/flatfile/index.rb
170
170
  - lib/bio/io/flatfile/indexer.rb
171
+ - lib/bio/sequence/aa.rb
172
+ - lib/bio/sequence/common.rb
173
+ - lib/bio/sequence/compat.rb
174
+ - lib/bio/sequence/format.rb
175
+ - lib/bio/sequence/generic.rb
176
+ - lib/bio/sequence/na.rb
171
177
  - lib/bio/shell/core.rb
178
+ - lib/bio/shell/demo.rb
179
+ - lib/bio/shell/interface.rb
180
+ - lib/bio/shell/object.rb
172
181
  - lib/bio/shell/plugin
173
- - lib/bio/shell/session.rb
182
+ - lib/bio/shell/rails
183
+ - lib/bio/shell/web.rb
174
184
  - lib/bio/shell/plugin/codon.rb
185
+ - lib/bio/shell/plugin/emboss.rb
175
186
  - lib/bio/shell/plugin/entry.rb
176
187
  - lib/bio/shell/plugin/flatfile.rb
177
188
  - lib/bio/shell/plugin/keggapi.rb
178
189
  - lib/bio/shell/plugin/midi.rb
179
190
  - lib/bio/shell/plugin/obda.rb
180
191
  - lib/bio/shell/plugin/seq.rb
192
+ - lib/bio/shell/rails/app
193
+ - lib/bio/shell/rails/config
194
+ - lib/bio/shell/rails/doc
195
+ - lib/bio/shell/rails/public
196
+ - lib/bio/shell/rails/Rakefile
197
+ - lib/bio/shell/rails/script
198
+ - lib/bio/shell/rails/test
199
+ - lib/bio/shell/rails/app/controllers
200
+ - lib/bio/shell/rails/app/helpers
201
+ - lib/bio/shell/rails/app/models
202
+ - lib/bio/shell/rails/app/views
203
+ - lib/bio/shell/rails/app/controllers/application.rb
204
+ - lib/bio/shell/rails/app/controllers/shell_controller.rb
205
+ - lib/bio/shell/rails/app/helpers/application_helper.rb
206
+ - lib/bio/shell/rails/app/models/shell_connection.rb
207
+ - lib/bio/shell/rails/app/views/layouts
208
+ - lib/bio/shell/rails/app/views/shell
209
+ - lib/bio/shell/rails/app/views/layouts/shell.rhtml
210
+ - lib/bio/shell/rails/app/views/shell/history.rhtml
211
+ - lib/bio/shell/rails/app/views/shell/index.rhtml
212
+ - lib/bio/shell/rails/app/views/shell/show.rhtml
213
+ - lib/bio/shell/rails/config/boot.rb
214
+ - lib/bio/shell/rails/config/database.yml
215
+ - lib/bio/shell/rails/config/environment.rb
216
+ - lib/bio/shell/rails/config/environments
217
+ - lib/bio/shell/rails/config/routes.rb
218
+ - lib/bio/shell/rails/config/environments/development.rb
219
+ - lib/bio/shell/rails/config/environments/production.rb
220
+ - lib/bio/shell/rails/config/environments/test.rb
221
+ - lib/bio/shell/rails/doc/README_FOR_APP
222
+ - lib/bio/shell/rails/public/404.html
223
+ - lib/bio/shell/rails/public/500.html
224
+ - lib/bio/shell/rails/public/dispatch.cgi
225
+ - lib/bio/shell/rails/public/dispatch.fcgi
226
+ - lib/bio/shell/rails/public/dispatch.rb
227
+ - lib/bio/shell/rails/public/favicon.ico
228
+ - lib/bio/shell/rails/public/images
229
+ - lib/bio/shell/rails/public/index.html
230
+ - lib/bio/shell/rails/public/javascripts
231
+ - lib/bio/shell/rails/public/robots.txt
232
+ - lib/bio/shell/rails/public/stylesheets
233
+ - lib/bio/shell/rails/public/images/icon.png
234
+ - lib/bio/shell/rails/public/images/rails.png
235
+ - lib/bio/shell/rails/public/javascripts/controls.js
236
+ - lib/bio/shell/rails/public/javascripts/dragdrop.js
237
+ - lib/bio/shell/rails/public/javascripts/effects.js
238
+ - lib/bio/shell/rails/public/javascripts/prototype.js
239
+ - lib/bio/shell/rails/public/stylesheets/main.css
240
+ - lib/bio/shell/rails/script/about
241
+ - lib/bio/shell/rails/script/breakpointer
242
+ - lib/bio/shell/rails/script/console
243
+ - lib/bio/shell/rails/script/destroy
244
+ - lib/bio/shell/rails/script/generate
245
+ - lib/bio/shell/rails/script/performance
246
+ - lib/bio/shell/rails/script/plugin
247
+ - lib/bio/shell/rails/script/process
248
+ - lib/bio/shell/rails/script/runner
249
+ - lib/bio/shell/rails/script/server
250
+ - lib/bio/shell/rails/script/performance/benchmarker
251
+ - lib/bio/shell/rails/script/performance/profiler
252
+ - lib/bio/shell/rails/script/process/reaper
253
+ - lib/bio/shell/rails/script/process/spawner
254
+ - lib/bio/shell/rails/script/process/spinner
255
+ - lib/bio/shell/rails/test/test_helper.rb
181
256
  - lib/bio/util/color_scheme
182
257
  - lib/bio/util/color_scheme.rb
183
258
  - lib/bio/util/contingency_table.rb
@@ -190,6 +265,7 @@ files:
190
265
  - lib/bio/util/color_scheme/taylor.rb
191
266
  - lib/bio/util/color_scheme/turn.rb
192
267
  - lib/bio/util/color_scheme/zappo.rb
268
+ - sample/any2fasta.rb
193
269
  - sample/biofetch.rb
194
270
  - sample/color_scheme_na.rb
195
271
  - sample/dbget
@@ -216,20 +292,29 @@ files:
216
292
  - test/functional
217
293
  - test/runner.rb
218
294
  - test/unit
295
+ - test/data/aaindex
296
+ - test/data/bl2seq
219
297
  - test/data/blast
220
298
  - test/data/embl
221
299
  - test/data/genscan
300
+ - test/data/HMMER
222
301
  - test/data/prosite
223
302
  - test/data/refseq
224
303
  - test/data/SOSUI
225
304
  - test/data/TMHMM
226
305
  - test/data/uniprot
227
- - test/data/blast/eco:b0002.faa
228
- - test/data/blast/eco:b0002.faa.m0
229
- - test/data/blast/eco:b0002.faa.m7
230
- - test/data/blast/eco:b0002.faa.m8
306
+ - test/data/aaindex/DAYM780301
307
+ - test/data/aaindex/PRAM900102
308
+ - test/data/bl2seq/cd8a_cd8b_blastp.bl2seq
309
+ - test/data/bl2seq/cd8a_p53_e-5blastp.bl2seq
310
+ - test/data/blast/b0002.faa
311
+ - test/data/blast/b0002.faa.m0
312
+ - test/data/blast/b0002.faa.m7
313
+ - test/data/blast/b0002.faa.m8
231
314
  - test/data/embl/AB090716.embl
232
315
  - test/data/genscan/sample.report
316
+ - test/data/HMMER/hmmpfam.out
317
+ - test/data/HMMER/hmmsearch.out
233
318
  - test/data/prosite/prosite.dat
234
319
  - test/data/refseq/nm_126355.entret
235
320
  - test/data/SOSUI/sample.report
@@ -243,6 +328,7 @@ files:
243
328
  - test/unit/bio/data
244
329
  - test/unit/bio/db
245
330
  - test/unit/bio/io
331
+ - test/unit/bio/sequence
246
332
  - test/unit/bio/shell
247
333
  - test/unit/bio/test_alignment.rb
248
334
  - test/unit/bio/test_command.rb
@@ -250,19 +336,24 @@ files:
250
336
  - test/unit/bio/test_feature.rb
251
337
  - test/unit/bio/test_location.rb
252
338
  - test/unit/bio/test_pathway.rb
339
+ - test/unit/bio/test_reference.rb
253
340
  - test/unit/bio/test_sequence.rb
254
341
  - test/unit/bio/test_shell.rb
255
342
  - test/unit/bio/util
343
+ - test/unit/bio/appl/bl2seq
256
344
  - test/unit/bio/appl/blast
257
345
  - test/unit/bio/appl/genscan
346
+ - test/unit/bio/appl/hmmer
258
347
  - test/unit/bio/appl/sosui
259
348
  - test/unit/bio/appl/targetp
260
349
  - test/unit/bio/appl/test_blast.rb
261
350
  - test/unit/bio/appl/test_fasta.rb
262
351
  - test/unit/bio/appl/tmhmm
352
+ - test/unit/bio/appl/bl2seq/test_report.rb
263
353
  - test/unit/bio/appl/blast/test_report.rb
264
354
  - test/unit/bio/appl/blast/test_xmlparser.rb
265
355
  - test/unit/bio/appl/genscan/test_report.rb
356
+ - test/unit/bio/appl/hmmer/test_report.rb
266
357
  - test/unit/bio/appl/sosui/test_report.rb
267
358
  - test/unit/bio/appl/targetp/test_report.rb
268
359
  - test/unit/bio/appl/tmhmm/test_report.rb
@@ -271,6 +362,8 @@ files:
271
362
  - test/unit/bio/data/test_na.rb
272
363
  - test/unit/bio/db/embl
273
364
  - test/unit/bio/db/kegg
365
+ - test/unit/bio/db/pdb
366
+ - test/unit/bio/db/test_aaindex.rb
274
367
  - test/unit/bio/db/test_fasta.rb
275
368
  - test/unit/bio/db/test_gff.rb
276
369
  - test/unit/bio/db/test_prosite.rb
@@ -280,8 +373,14 @@ files:
280
373
  - test/unit/bio/db/embl/test_sptr.rb
281
374
  - test/unit/bio/db/embl/test_uniprot.rb
282
375
  - test/unit/bio/db/kegg/test_genes.rb
376
+ - test/unit/bio/db/pdb/test_pdb.rb
283
377
  - test/unit/bio/io/test_ddbjxml.rb
378
+ - test/unit/bio/io/test_fastacmd.rb
284
379
  - test/unit/bio/io/test_soapwsdl.rb
380
+ - test/unit/bio/sequence/test_aa.rb
381
+ - test/unit/bio/sequence/test_common.rb
382
+ - test/unit/bio/sequence/test_compat.rb
383
+ - test/unit/bio/sequence/test_na.rb
285
384
  - test/unit/bio/shell/plugin
286
385
  - test/unit/bio/shell/plugin/test_seq.rb
287
386
  - test/unit/bio/util/test_color_scheme.rb
@@ -293,8 +392,12 @@ rdoc_options: []
293
392
 
294
393
  extra_rdoc_files: []
295
394
 
296
- executables: []
297
-
395
+ executables:
396
+ - bioruby
397
+ - br_biofetch.rb
398
+ - br_biogetseq.rb
399
+ - br_bioflat.rb
400
+ - br_pmfetch.rb
298
401
  extensions: []
299
402
 
300
403
  requirements: []