bio 1.1.0 → 1.2.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.
@@ -5,7 +5,7 @@
5
5
  # Mitsuteru C. Nakao <n@bioruby.org>
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: test_aa.rb,v 1.4 2007/04/14 05:09:23 k Exp $
8
+ # $Id: test_aa.rb,v 1.5 2007/12/03 06:19:12 nakao Exp $
9
9
  #
10
10
 
11
11
  require 'pathname'
@@ -19,8 +19,8 @@ require 'bio/sequence/aa'
19
19
 
20
20
  module Bio
21
21
 
22
-
23
22
  class TestSequenceAANew < Test::Unit::TestCase
23
+
24
24
  def test_new
25
25
  str = "RRLEHTFVFL RNFSLMLLRY"
26
26
  assert(Bio::Sequence::AA.new(str))
@@ -86,6 +86,7 @@ module Bio
86
86
  "leucine", "leucine", "arginine", "tyrosine"]
87
87
  assert_equal(ary, @obj.names)
88
88
  end
89
+
89
90
  end
90
91
 
91
92
 
@@ -4,7 +4,7 @@
4
4
  # Copyright:: Copyright (C) 2006 Mitsuteru C. Nakao <n@bioruby.org>
5
5
  # License:: The Ruby License
6
6
  #
7
- # $Id: test_common.rb,v 1.4 2007/04/05 23:35:44 trevor Exp $
7
+ # $Id: test_common.rb,v 1.5 2007/12/03 06:19:12 nakao Exp $
8
8
  #
9
9
 
10
10
  require 'pathname'
@@ -31,18 +31,27 @@ module Bio
31
31
  assert_equal('atgcatgcatgcatgcaaaa', @obj.to_s)
32
32
  end
33
33
 
34
+ def test_to_str
35
+ assert_equal('atgcatgcatgcatgcaaaa', @obj.to_str)
36
+ end
37
+
34
38
  def test_seq
35
39
  str = "atgcatgcatgcatgcaaaa"
36
40
  assert_equal(str, @obj.seq)
37
41
  end
38
42
 
39
-
40
43
  # <<(*arg)
41
44
  def test_push
42
45
  str = "atgcatgcatgcatgcaaaaA"
43
46
  assert_equal(str, @obj << "A")
44
47
  end
45
48
 
49
+ # concat(*arg)
50
+ def test_concat
51
+ str = "atgcatgcatgcatgcaaaaA"
52
+ assert_equal(str, @obj.concat("A"))
53
+ end
54
+
46
55
  # +(*arg)
47
56
  def test_sum
48
57
  str = "atgcatgcatgcatgcaaaaatgcatgcatgcatgcaaaa"
@@ -5,7 +5,7 @@
5
5
  # Mitsuteru C. Nakao <n@bioruby.org>
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: test_na.rb,v 1.5 2007/04/05 23:35:44 trevor Exp $
8
+ # $Id: test_na.rb,v 1.6 2007/12/03 06:19:12 nakao Exp $
9
9
  #
10
10
 
11
11
  require 'pathname'
@@ -175,6 +175,68 @@ module Bio
175
175
 
176
176
  end
177
177
 
178
+ class TestSequenceCommon < Test::Unit::TestCase
179
+
180
+ def setup
181
+ @obj = Bio::Sequence::NA.new('atgcatgcatgcatgcaaaa')
182
+ end
183
+
184
+ def test_to_s
185
+ assert_equal('atgcatgcatgcatgcaaaa', @obj.to_s)
186
+ end
187
+
188
+ def test_to_str
189
+ assert_equal('atgcatgcatgcatgcaaaa', @obj.to_str)
190
+ end
191
+
192
+ def test_seq
193
+ str = "atgcatgcatgcatgcaaaa"
194
+ assert_equal(str, @obj.seq)
195
+ end
196
+
197
+ # <<(*arg)
198
+ def test_push
199
+ str = "atgcatgcatgcatgcaaaaa"
200
+ assert_equal(str, @obj << "A")
201
+ end
202
+
203
+ # concat(*arg)
204
+ def test_concat
205
+ str = "atgcatgcatgcatgcaaaaa"
206
+ assert_equal(str, @obj.concat("A"))
207
+ end
208
+
209
+ # +(*arg)
210
+ def test_sum
211
+ str = "atgcatgcatgcatgcaaaaatgcatgcatgcatgcaaaa"
212
+ assert_equal(str, @obj + @obj)
213
+ end
214
+
215
+ # window_search(window_size, step_size = 1)
216
+ def test_window_search
217
+ @obj.window_search(4) do |subseq|
218
+ assert_equal(20, @obj.size)
219
+ end
220
+ end
221
+
222
+ #total(hash)
223
+ def test_total
224
+ hash = {'a' => 1, 'c' => 2, 'g' => 4, 't' => 3}
225
+ assert_equal(44.0, @obj.total(hash))
226
+ end
227
+
228
+ def test_composition
229
+ composition = {"a"=>8, "c"=>4, "g"=>4, "t"=>4}
230
+ assert_equal(composition, @obj.composition)
231
+ end
232
+
233
+ def test_splicing
234
+ #(position)
235
+ assert_equal("atgcatgc", @obj.splicing("join(1..4, 13..16)"))
236
+ end
237
+ end
238
+
239
+
178
240
  class TestSequenceNATranslation < Test::Unit::TestCase
179
241
  def setup
180
242
 
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: bio
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.0
7
- date: 2007-07-19 00:00:00 +09:00
6
+ version: 1.2.0
7
+ date: 2007-12-15 00:00:00 +09:00
8
8
  summary: Bioinformatics library
9
9
  require_paths:
10
10
  - lib
@@ -220,7 +220,6 @@ files:
220
220
  - lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_modules.rhtml
221
221
  - lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_variables.rhtml
222
222
  - lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby-bg.gif
223
- - lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby-console.png
224
223
  - lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby-gem.png
225
224
  - lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby-link.gif
226
225
  - lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.css
@@ -230,6 +229,7 @@ files:
230
229
  - lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/commands.rhtml
231
230
  - lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/history.rhtml
232
231
  - lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/index.rhtml
232
+ - lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/spinner.gif
233
233
  - lib/bio/shell/script.rb
234
234
  - lib/bio/shell/setup.rb
235
235
  - lib/bio/shell/web.rb