bio 1.4.2 → 1.4.3
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.
- data/.travis.yml +66 -0
- data/ChangeLog +989 -4524
- data/KNOWN_ISSUES.rdoc +67 -2
- data/README.rdoc +89 -23
- data/README_DEV.rdoc +93 -2
- data/RELEASE_NOTES.rdoc +167 -95
- data/Rakefile +199 -7
- data/bioruby.gemspec +27 -12
- data/bioruby.gemspec.erb +6 -3
- data/doc/ChangeLog-before-1.4.2 +5013 -0
- data/doc/RELEASE_NOTES-1.4.2.rdoc +132 -0
- data/doc/Tutorial.rd +21 -3
- data/doc/Tutorial.rd.html +20 -12
- data/etc/bioinformatics/seqdatabase.ini +13 -196
- data/gemfiles/Gemfile.travis-jruby1.8 +7 -0
- data/gemfiles/Gemfile.travis-jruby1.9 +10 -0
- data/gemfiles/Gemfile.travis-ruby1.8 +7 -0
- data/gemfiles/Gemfile.travis-ruby1.9 +10 -0
- data/gemfiles/modify-Gemfile.rb +28 -0
- data/gemfiles/prepare-gemspec.rb +25 -0
- data/lib/bio/alignment.rb +1 -1
- data/lib/bio/appl/bl2seq/report.rb +3 -3
- data/lib/bio/appl/blast/ddbj.rb +0 -3
- data/lib/bio/appl/blast/format0.rb +4 -22
- data/lib/bio/appl/blast/genomenet.rb +33 -16
- data/lib/bio/appl/blast/ncbioptions.rb +8 -3
- data/lib/bio/appl/blast/remote.rb +6 -5
- data/lib/bio/appl/blast/report.rb +10 -6
- data/lib/bio/appl/blast/rpsblast.rb +3 -2
- data/lib/bio/appl/blast/wublast.rb +3 -3
- data/lib/bio/command.rb +118 -36
- data/lib/bio/data/na.rb +1 -1
- data/lib/bio/db/embl/embl.rb +74 -0
- data/lib/bio/db/embl/format_embl.rb +0 -4
- data/lib/bio/db/fasta.rb +57 -45
- data/lib/bio/db/fasta/defline.rb +1 -1
- data/lib/bio/db/fasta/format_fasta.rb +0 -4
- data/lib/bio/db/fasta/format_qual.rb +0 -5
- data/lib/bio/db/fastq/format_fastq.rb +0 -1
- data/lib/bio/db/genbank/format_genbank.rb +0 -4
- data/lib/bio/db/gff.rb +41 -12
- data/lib/bio/db/kegg/genes.rb +3 -3
- data/lib/bio/db/kegg/kgml.rb +465 -64
- data/lib/bio/db/newick.rb +0 -244
- data/lib/bio/db/pdb.rb +1 -4
- data/lib/bio/db/pdb/atom.rb +3 -2
- data/lib/bio/db/pdb/chain.rb +2 -3
- data/lib/bio/db/pdb/chemicalcomponent.rb +3 -2
- data/lib/bio/db/pdb/model.rb +2 -2
- data/lib/bio/db/pdb/pdb.rb +2 -1
- data/lib/bio/db/pdb/residue.rb +2 -2
- data/lib/bio/db/pdb/utils.rb +7 -4
- data/lib/bio/db/phyloxml/phyloxml_parser.rb +52 -5
- data/lib/bio/feature.rb +2 -3
- data/lib/bio/io/flatfile/autodetection.rb +1 -1
- data/lib/bio/io/flatfile/buffer.rb +84 -0
- data/lib/bio/sequence.rb +6 -4
- data/lib/bio/sequence/aa.rb +3 -5
- data/lib/bio/sequence/adapter.rb +6 -6
- data/lib/bio/sequence/common.rb +3 -3
- data/lib/bio/sequence/compat.rb +2 -7
- data/lib/bio/sequence/dblink.rb +6 -5
- data/lib/bio/sequence/format.rb +0 -6
- data/lib/bio/sequence/format_raw.rb +0 -4
- data/lib/bio/sequence/generic.rb +3 -4
- data/lib/bio/sequence/na.rb +4 -6
- data/lib/bio/sequence/quality_score.rb +2 -0
- data/lib/bio/sequence/sequence_masker.rb +3 -0
- data/lib/bio/shell/core.rb +1 -0
- data/lib/bio/tree.rb +1 -2
- data/lib/bio/tree/output.rb +264 -0
- data/lib/bio/util/restriction_enzyme.rb +1 -3
- data/lib/bio/util/restriction_enzyme/analysis.rb +8 -5
- data/lib/bio/util/restriction_enzyme/analysis_basic.rb +4 -3
- data/lib/bio/util/restriction_enzyme/cut_symbol.rb +3 -2
- data/lib/bio/util/restriction_enzyme/dense_int_array.rb +3 -0
- data/lib/bio/util/restriction_enzyme/double_stranded.rb +3 -4
- data/lib/bio/util/restriction_enzyme/double_stranded/aligned_strands.rb +3 -4
- data/lib/bio/util/restriction_enzyme/double_stranded/cut_location_pair.rb +3 -4
- data/lib/bio/util/restriction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation.rb +3 -4
- data/lib/bio/util/restriction_enzyme/double_stranded/cut_locations.rb +3 -4
- data/lib/bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb +3 -4
- data/lib/bio/util/restriction_enzyme/range/cut_range.rb +3 -4
- data/lib/bio/util/restriction_enzyme/range/cut_ranges.rb +3 -4
- data/lib/bio/util/restriction_enzyme/range/horizontal_cut_range.rb +3 -4
- data/lib/bio/util/restriction_enzyme/range/sequence_range.rb +3 -4
- data/lib/bio/util/restriction_enzyme/range/sequence_range/calculated_cuts.rb +3 -4
- data/lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb +3 -4
- data/lib/bio/util/restriction_enzyme/range/sequence_range/fragments.rb +3 -4
- data/lib/bio/util/restriction_enzyme/range/vertical_cut_range.rb +3 -4
- data/lib/bio/util/restriction_enzyme/single_strand.rb +3 -3
- data/lib/bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation.rb +3 -4
- data/lib/bio/util/restriction_enzyme/single_strand_complement.rb +3 -4
- data/lib/bio/util/restriction_enzyme/sorted_num_array.rb +3 -0
- data/lib/bio/util/restriction_enzyme/string_formatting.rb +3 -4
- data/lib/bio/version.rb +11 -2
- data/sample/seqdatabase.ini +210 -0
- data/test/bioruby_test_helper.rb +37 -12
- data/test/data/KEGG/test.kgml +37 -0
- data/test/data/command/echoarg2.bat +0 -0
- data/test/data/command/echoarg2.sh +4 -0
- data/test/functional/bio/test_command.rb +58 -28
- data/test/{functional → network}/bio/appl/blast/test_remote.rb +0 -0
- data/test/{functional → network}/bio/appl/test_blast.rb +0 -0
- data/test/{functional → network}/bio/appl/test_pts1.rb +0 -0
- data/test/{functional → network}/bio/io/test_ddbjrest.rb +0 -0
- data/test/{functional → network}/bio/io/test_ensembl.rb +0 -0
- data/test/{functional → network}/bio/io/test_pubmed.rb +0 -0
- data/test/{functional → network}/bio/io/test_soapwsdl.rb +0 -0
- data/test/{functional → network}/bio/io/test_togows.rb +0 -0
- data/test/network/bio/test_command.rb +35 -0
- data/test/runner.rb +16 -6
- data/test/unit/bio/appl/blast/test_report.rb +119 -0
- data/test/unit/bio/appl/blast/test_rpsblast.rb +1 -0
- data/test/unit/bio/data/test_na.rb +1 -1
- data/test/unit/bio/db/embl/test_embl.rb +2 -7
- data/test/unit/bio/db/embl/test_embl_rel89.rb +2 -7
- data/test/unit/bio/db/fasta/test_defline.rb +1 -1
- data/test/unit/bio/db/genbank/test_genpept.rb +1 -1
- data/test/unit/bio/db/kegg/test_drug.rb +1 -1
- data/test/unit/bio/db/kegg/test_genome.rb +1 -1
- data/test/unit/bio/db/kegg/test_glycan.rb +1 -1
- data/test/unit/bio/db/kegg/test_kgml.rb +1022 -0
- data/test/unit/bio/db/sanger_chromatogram/test_abif.rb +2 -1
- data/test/unit/bio/db/sanger_chromatogram/test_scf.rb +4 -2
- data/test/unit/bio/db/test_newick.rb +2 -0
- data/test/unit/bio/db/test_phyloxml.rb +54 -2
- data/test/unit/bio/db/test_phyloxml_writer.rb +15 -9
- data/test/unit/bio/db/test_soft.rb +1 -1
- data/test/unit/bio/io/flatfile/test_autodetection.rb +6 -0
- data/test/unit/bio/io/flatfile/test_buffer.rb +141 -0
- data/test/unit/bio/sequence/test_common.rb +36 -4
- data/test/unit/bio/sequence/test_na.rb +1 -1
- data/test/unit/bio/test_command.rb +9 -4
- data/test/unit/bio/test_sequence.rb +2 -2
- data/test/unit/bio/test_tree.rb +11 -11
- data/test/unit/bio/util/test_restriction_enzyme.rb +1 -1
- metadata +1428 -655
- data/rdoc.zsh +0 -8
data/test/bioruby_test_helper.rb
CHANGED
@@ -14,26 +14,51 @@ unless defined? BioRubyTestDebug then
|
|
14
14
|
end
|
15
15
|
end #BioRubyTestDebug
|
16
16
|
|
17
|
-
unless defined?
|
17
|
+
unless defined? BioRubyTestGem then
|
18
|
+
gem_version = ENV['BIORUBY_TEST_GEM']
|
19
|
+
if gem_version then
|
20
|
+
$stderr.puts 'require "rubygems"' if BioRubyTestDebug
|
21
|
+
require "rubygems"
|
22
|
+
if gem_version.empty? then
|
23
|
+
$stderr.puts "gem 'bio'" if BioRubyTestDebug
|
24
|
+
gem 'bio'
|
25
|
+
else
|
26
|
+
$stderr.puts "gem 'bio', #{gem_version.inspect}" if BioRubyTestDebug
|
27
|
+
gem 'bio', gem_version
|
28
|
+
end
|
29
|
+
end
|
30
|
+
BioRubyTestGem = gem_version
|
31
|
+
end
|
32
|
+
|
33
|
+
unless defined? BioRubyTestLibPath then
|
18
34
|
libpath = ENV['BIORUBY_TEST_LIB']
|
19
|
-
|
35
|
+
unless libpath then
|
20
36
|
libpath = Pathname.new(File.join(File.dirname(__FILE__),
|
21
37
|
"..", "lib")).cleanpath.to_s
|
22
38
|
end
|
23
|
-
libpath.freeze
|
24
39
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
40
|
+
# do not add path to $: if BIORUBY_TEST_LIB is empty string
|
41
|
+
# or BioRubyTestGem is true.
|
42
|
+
if (libpath and libpath.empty?) or BioRubyTestGem then
|
43
|
+
libpath = nil
|
44
|
+
end
|
45
|
+
|
46
|
+
if libpath then
|
47
|
+
libpath.freeze
|
48
|
+
|
49
|
+
unless $:[0] == libpath then
|
50
|
+
$:.unshift(libpath)
|
51
|
+
if BioRubyTestDebug then
|
52
|
+
$stderr.puts "Added #{libpath.inspect} to $:."
|
53
|
+
end
|
54
|
+
else
|
55
|
+
if BioRubyTestDebug then
|
56
|
+
$stderr.puts "NOT added #{libpath.inspect} to $:. because it is already on the top of $:."
|
57
|
+
end
|
33
58
|
end
|
34
59
|
end
|
35
60
|
|
36
|
-
# (String) Path to be added to $:.
|
61
|
+
# (String or nil) Path to be added to $:.
|
37
62
|
# It may or may not be the path of bioruby.
|
38
63
|
BioRubyTestLibPath = libpath
|
39
64
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<!DOCTYPE pathway SYSTEM "http://www.genome.jp/kegg/xml/KGML_v0.7.1_.dtd">
|
3
|
+
<!-- mock data for testing lower-level parser functionality -->
|
4
|
+
<pathway name="path:xxx09876" org="xxx" number="09876"
|
5
|
+
title="This is test title"
|
6
|
+
image="http://example.com/pathway/ec/09876.png"
|
7
|
+
link="http://example.com/show_pathway?xxx09876">
|
8
|
+
<entry id="1234" name="cpd:C99999" type="compound"
|
9
|
+
link="http://example.com/dbget-bin/www_bget?C99999">
|
10
|
+
<graphics name="C99999" fgcolor="#E0E0E0" bgcolor="#D0E0F0"
|
11
|
+
type="circle" x="1314" y="1008" width="14" height="28"/>
|
12
|
+
</entry>
|
13
|
+
<entry id="1" name="ec:1.1.1.1" type="enzyme" reaction="rn:R99999"
|
14
|
+
link="http://example.com/dbget-bin/www_bget?1.1.1.1">
|
15
|
+
<graphics name="1.1.1.1" fgcolor="#99CCFF" bgcolor="#FFFFFF"
|
16
|
+
type="line" coords="314,159,265,358,979,323"/>
|
17
|
+
<graphics name="1.1.1.1" fgcolor="#FF99CC" bgcolor="#CC99FF"
|
18
|
+
type="line" coords="271,828,182,845"/>
|
19
|
+
</entry>
|
20
|
+
<entry id="567" name="undefined" type="group">
|
21
|
+
<graphics fgcolor="#000000" bgcolor="#FFFFFF"
|
22
|
+
type="rectangle" x="1242" y="1134" width="456" height="678"/>
|
23
|
+
<component id="34"/>
|
24
|
+
<component id="56"/>
|
25
|
+
<component id="78"/>
|
26
|
+
<component id="90"/>
|
27
|
+
</entry>
|
28
|
+
<relation entry1="109" entry2="87" type="ECrel">
|
29
|
+
<subtype name="compound" value="100"/>
|
30
|
+
</relation>
|
31
|
+
<reaction id="3" name="rn:R99999 rn:R99998" type="reversible">
|
32
|
+
<substrate id="3330" name="cpd:C99990"/>
|
33
|
+
<substrate id="3331" name="cpd:C99991"/>
|
34
|
+
<product id="3332" name="cpd:C99902"/>
|
35
|
+
<product id="3333" name="cpd:C99903"/>
|
36
|
+
</reaction>
|
37
|
+
</pathway>
|
File without changes
|
@@ -19,22 +19,26 @@ require 'tempfile'
|
|
19
19
|
require 'bio/command'
|
20
20
|
|
21
21
|
module Bio
|
22
|
-
|
22
|
+
module FuncTestCommandCallCommon
|
23
23
|
|
24
|
-
def
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
def windows_platform?
|
25
|
+
Bio::Command.module_eval { windows_platform? }
|
26
|
+
end
|
27
|
+
module_function :windows_platform?
|
28
|
+
|
29
|
+
def setup_cmd
|
30
|
+
if windows_platform? then
|
31
|
+
[ File.expand_path(File.join(BioRubyTestDataPath, 'command', 'echoarg2.bat')) ]
|
29
32
|
else
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
raise "Unsupported environment: /bin/echo not found"
|
33
|
+
[ "/bin/sh", "/bin/echo" ].each do |cmd|
|
34
|
+
unless FileTest.executable?(cmd) then
|
35
|
+
raise "Unsupported environment: #{cmd} not found"
|
36
|
+
end
|
35
37
|
end
|
38
|
+
[ "/bin/sh", File.expand_path(File.join(BioRubyTestDataPath, 'command', 'echoarg2.sh')) ]
|
36
39
|
end
|
37
40
|
end
|
41
|
+
private :setup_cmd
|
38
42
|
|
39
43
|
def test_call_command
|
40
44
|
ret = Bio::Command.call_command(@arg) do |io|
|
@@ -85,7 +89,49 @@ module Bio
|
|
85
89
|
assert_equal(@expected, ret.to_s.strip)
|
86
90
|
end
|
87
91
|
|
88
|
-
end #
|
92
|
+
end #module FuncTestCommandCallCommon
|
93
|
+
|
94
|
+
class FuncTestCommandCallSimple < Test::Unit::TestCase
|
95
|
+
|
96
|
+
include FuncTestCommandCallCommon
|
97
|
+
|
98
|
+
def setup
|
99
|
+
@arg = setup_cmd
|
100
|
+
@arg.concat [ "first", "second", "third" ]
|
101
|
+
@expected = "second"
|
102
|
+
end
|
103
|
+
end #class FuncTestCommandCallSimple
|
104
|
+
|
105
|
+
class FuncTestCommandCallWithSpace < Test::Unit::TestCase
|
106
|
+
|
107
|
+
include FuncTestCommandCallCommon
|
108
|
+
|
109
|
+
def setup
|
110
|
+
@arg = setup_cmd
|
111
|
+
@arg.concat [ "this is", "a test for", "escape of space" ]
|
112
|
+
if windows_platform? then
|
113
|
+
@expected = '"a test for"'
|
114
|
+
else
|
115
|
+
@expected = "a test for"
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end #class FuncTestCommandCallWithSpace
|
119
|
+
|
120
|
+
class FuncTestCommandCallMisc1 < Test::Unit::TestCase
|
121
|
+
|
122
|
+
include FuncTestCommandCallCommon
|
123
|
+
|
124
|
+
def setup
|
125
|
+
@arg = setup_cmd
|
126
|
+
@arg.concat [ 'test (a) *.* \'argument 1\'',
|
127
|
+
'\'test\' (b) *.* argument 2', 'arg3' ]
|
128
|
+
if windows_platform? then
|
129
|
+
@expected = '"\'test\' (b) *.* argument 2"'
|
130
|
+
else
|
131
|
+
@expected = '\'test\' (b) *.* argument 2'
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end #class FuncTestCommandCallMisc1
|
89
135
|
|
90
136
|
class FuncTestCommandQuery < Test::Unit::TestCase
|
91
137
|
|
@@ -332,20 +378,4 @@ module Bio
|
|
332
378
|
end
|
333
379
|
end #class FuncTestCommandTmpdir
|
334
380
|
|
335
|
-
class FuncTestCommandNet < Test::Unit::TestCase
|
336
|
-
def test_read_uri
|
337
|
-
assert_nothing_raised {
|
338
|
-
Bio::Command.read_uri("http://bioruby.open-bio.org/")
|
339
|
-
}
|
340
|
-
end
|
341
|
-
|
342
|
-
def test_start_http
|
343
|
-
end
|
344
|
-
|
345
|
-
def test_new_http
|
346
|
-
end
|
347
|
-
|
348
|
-
def test_post_form
|
349
|
-
end
|
350
|
-
end #class FuncTestCommandNet
|
351
381
|
end #module Bio
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#
|
2
|
+
# test/network/bio/test_command.rb - Functional test for network connection methods in Bio::Command
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2008, 2011
|
5
|
+
# Naohisa Goto <ng@bioruby.org>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
|
9
|
+
# loading helper routine for testing bioruby
|
10
|
+
require 'pathname'
|
11
|
+
load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 2,
|
12
|
+
'bioruby_test_helper.rb')).cleanpath.to_s
|
13
|
+
|
14
|
+
# libraries needed for the tests
|
15
|
+
require 'test/unit'
|
16
|
+
require 'bio/command'
|
17
|
+
|
18
|
+
module Bio
|
19
|
+
class FuncTestCommandNet < Test::Unit::TestCase
|
20
|
+
def test_read_uri
|
21
|
+
assert_nothing_raised {
|
22
|
+
Bio::Command.read_uri("http://bioruby.open-bio.org/")
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_start_http
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_new_http
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_post_form
|
33
|
+
end
|
34
|
+
end #class FuncTestCommandNet
|
35
|
+
end
|
data/test/runner.rb
CHANGED
@@ -8,25 +8,35 @@ load Pathname.new(File.join(File.dirname(__FILE__),
|
|
8
8
|
# libraries needed for the tests
|
9
9
|
require 'test/unit'
|
10
10
|
|
11
|
+
unit_test = File.join(File.dirname($0), "unit")
|
12
|
+
func_test = File.join(File.dirname($0), "functional")
|
13
|
+
|
11
14
|
if !defined?(Test::Unit::AutoRunner) then
|
12
15
|
# Ruby 1.9.1 does not have Test::Unit::AutoRunner
|
13
16
|
Test::Unit.setup_argv do |files|
|
14
|
-
[
|
17
|
+
[ unit_test, func_test ]
|
15
18
|
end
|
16
19
|
# tests called when exiting the program
|
17
20
|
|
18
21
|
elsif defined?(Test::Unit::Color) then
|
19
22
|
# workaround for test-unit-2.0.x
|
20
23
|
r = Test::Unit::AutoRunner.new(true)
|
21
|
-
r.to_run.push
|
24
|
+
r.to_run.push unit_test
|
25
|
+
r.to_run.push func_test
|
26
|
+
r.process_args(ARGV)
|
27
|
+
exit r.run
|
28
|
+
|
29
|
+
elsif RUBY_VERSION > "1.8.2" then
|
30
|
+
r = Test::Unit::AutoRunner.new(true) do |ar|
|
31
|
+
ar.to_run.push unit_test
|
32
|
+
ar.to_run.push func_test
|
33
|
+
[ unit_test, func_test ]
|
34
|
+
end
|
22
35
|
r.process_args(ARGV)
|
23
36
|
exit r.run
|
24
37
|
|
25
|
-
elsif RUBY_VERSION > "1.8.2"
|
26
|
-
# current Test::Unit -- Ruby 1.8.3 or later
|
27
|
-
exit Test::Unit::AutoRunner.run(true, File.dirname($0))
|
28
38
|
else
|
29
39
|
# old Test::Unit -- Ruby 1.8.2 or older
|
30
|
-
|
40
|
+
raise "Ruby version too old. Please use newer version of Ruby."
|
31
41
|
end
|
32
42
|
|
@@ -614,6 +614,125 @@ module Bio
|
|
614
614
|
end
|
615
615
|
end
|
616
616
|
|
617
|
+
module TestBlastReportTabularHelper
|
618
|
+
def def_test_assert_nil(test_method)
|
619
|
+
str = test_method.to_s
|
620
|
+
name = str.sub(/test(\_(Hit|Hsp))?\_/, '')
|
621
|
+
method = name.intern
|
622
|
+
instance = case self.to_s
|
623
|
+
when /Iteration/
|
624
|
+
:@itr
|
625
|
+
when /Hit/
|
626
|
+
:@hit
|
627
|
+
when /Hsp/
|
628
|
+
:@hsp
|
629
|
+
else
|
630
|
+
:@report
|
631
|
+
end
|
632
|
+
|
633
|
+
define_method(test_method) do
|
634
|
+
assert_nil(instance_variable_get(instance).__send__(method))
|
635
|
+
end
|
636
|
+
end
|
637
|
+
end #module
|
638
|
+
|
639
|
+
class TestBlastReportTabular < TestBlastReport
|
640
|
+
extend TestBlastReportTabularHelper
|
641
|
+
|
642
|
+
def_test_assert_nil :test_db
|
643
|
+
def_test_assert_nil :test_db_len
|
644
|
+
def_test_assert_nil :test_db_num
|
645
|
+
def_test_assert_nil :test_eff_space
|
646
|
+
def_test_assert_nil :test_entropy
|
647
|
+
def_test_assert_nil :test_expect
|
648
|
+
def_test_assert_nil :test_filter
|
649
|
+
def_test_assert_nil :test_gap_extend
|
650
|
+
def_test_assert_nil :test_gap_open
|
651
|
+
def_test_assert_nil :test_hsp_len
|
652
|
+
def_test_assert_nil :test_kappa
|
653
|
+
def_test_assert_nil :test_lambda
|
654
|
+
def_test_assert_nil :test_matrix
|
655
|
+
def_test_assert_nil :test_program
|
656
|
+
def_test_assert_nil :test_query_len
|
657
|
+
def_test_assert_nil :test_reference
|
658
|
+
def_test_assert_nil :test_version
|
659
|
+
|
660
|
+
# No parameters information available in the "-m 8" format
|
661
|
+
def test_parameters
|
662
|
+
assert_equal({}, @report.parameters)
|
663
|
+
end
|
664
|
+
|
665
|
+
def test_query_def
|
666
|
+
# differs from XML because of truncation in the "-m 8" format
|
667
|
+
assert_equal("eco:b0002", @report.query_def)
|
668
|
+
end
|
669
|
+
|
670
|
+
def test_query_id
|
671
|
+
# differs from XML because of the limited data
|
672
|
+
assert_equal("eco:b0002", @report.query_id)
|
673
|
+
end
|
674
|
+
|
675
|
+
# No statistics information available in the "-m 8" format
|
676
|
+
def test_statistics
|
677
|
+
assert_equal({}, @report.statistics)
|
678
|
+
end
|
679
|
+
end #class TestBlastReportTabular
|
680
|
+
|
681
|
+
class TestBlastReportIterationTabular < TestBlastReportIteration
|
682
|
+
|
683
|
+
# No statistics information available in the "-m 8" format
|
684
|
+
def test_statistics
|
685
|
+
assert_equal({}, @itr.statistics)
|
686
|
+
end
|
687
|
+
end #class TestBlastReportIterationTabular
|
688
|
+
|
689
|
+
class TestBlastReportHitTabular < TestBlastReportHit
|
690
|
+
extend TestBlastReportTabularHelper
|
691
|
+
|
692
|
+
def_test_assert_nil :test_Hit_hit_id
|
693
|
+
def_test_assert_nil :test_Hit_identity
|
694
|
+
def_test_assert_nil :test_Hit_len
|
695
|
+
def_test_assert_nil :test_Hit_midline
|
696
|
+
def_test_assert_nil :test_Hit_query_len
|
697
|
+
def_test_assert_nil :test_Hit_query_seq
|
698
|
+
def_test_assert_nil :test_Hit_target_len
|
699
|
+
def_test_assert_nil :test_Hit_target_seq
|
700
|
+
|
701
|
+
def test_Hit_bit_score
|
702
|
+
# differs from XML because of truncation in the "-m 8" format
|
703
|
+
assert_equal(1567.0, @hit.bit_score)
|
704
|
+
end
|
705
|
+
|
706
|
+
def test_Hit_query_def
|
707
|
+
# differs from XML because of truncation in the "-m 8" format
|
708
|
+
assert_equal("eco:b0002", @hit.query_def)
|
709
|
+
end
|
710
|
+
|
711
|
+
def test_Hit_query_id
|
712
|
+
# differs from XML because of the limited data
|
713
|
+
assert_equal("eco:b0002", @hit.query_id)
|
714
|
+
end
|
715
|
+
end #class TestBlastReportHitTabular
|
716
|
+
|
717
|
+
class TestBlastReportHspTabular < TestBlastReportHsp
|
718
|
+
extend TestBlastReportTabularHelper
|
719
|
+
|
720
|
+
def_test_assert_nil :test_Hsp_density
|
721
|
+
def_test_assert_nil :test_Hsp_hit_frame
|
722
|
+
def_test_assert_nil :test_Hsp_hseq
|
723
|
+
def_test_assert_nil :test_Hsp_identity
|
724
|
+
def_test_assert_nil :test_Hsp_midline
|
725
|
+
def_test_assert_nil :test_Hsp_positive
|
726
|
+
def_test_assert_nil :test_Hsp_qseq
|
727
|
+
def_test_assert_nil :test_Hsp_query_frame
|
728
|
+
def_test_assert_nil :test_Hsp_score
|
729
|
+
|
730
|
+
def test_Hsp_bit_score
|
731
|
+
# differs from XML because of truncation in the "-m 8" format
|
732
|
+
assert_equal(1567.0, @hsp.bit_score)
|
733
|
+
end
|
734
|
+
end #class TestBlastReportHspTabular
|
735
|
+
|
617
736
|
########################################################################
|
618
737
|
# Tests for new BLAST XML format (blastall 2.2.14 or later)
|
619
738
|
# with the result of multiple query sequences
|
@@ -26,6 +26,7 @@ module TestRPSBlast
|
|
26
26
|
class TestRPSBlastSplitter < Test::Unit::TestCase
|
27
27
|
def setup
|
28
28
|
@io = File.open(TestFileName)
|
29
|
+
@io.binmode
|
29
30
|
@bstream = Bio::FlatFile::BufferedInputStream.new(@io, TestFileName)
|
30
31
|
@klass = Bio::Blast::RPSBlast::Report
|
31
32
|
@splitter = Bio::Blast::RPSBlast::RPSBlastSplitter.new(@klass, @bstream)
|