bio 0.7.1 → 1.0.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.
- data/bin/bioruby +71 -27
- data/bin/br_biofetch.rb +5 -17
- data/bin/br_bioflat.rb +14 -26
- data/bin/br_biogetseq.rb +6 -18
- data/bin/br_pmfetch.rb +6 -16
- data/doc/Changes-0.7.rd +35 -0
- data/doc/KEGG_API.rd +287 -172
- data/doc/KEGG_API.rd.ja +273 -160
- data/doc/Tutorial.rd +18 -9
- data/doc/Tutorial.rd.ja +656 -138
- data/lib/bio.rb +6 -24
- data/lib/bio/alignment.rb +5 -5
- data/lib/bio/appl/blast.rb +132 -98
- data/lib/bio/appl/blast/format0.rb +9 -19
- data/lib/bio/appl/blast/wublast.rb +5 -18
- data/lib/bio/appl/emboss.rb +40 -47
- data/lib/bio/appl/hmmer.rb +116 -82
- data/lib/bio/appl/hmmer/report.rb +509 -364
- data/lib/bio/appl/spidey/report.rb +7 -18
- data/lib/bio/data/na.rb +3 -21
- data/lib/bio/db.rb +3 -21
- data/lib/bio/db/aaindex.rb +147 -52
- data/lib/bio/db/embl/common.rb +27 -6
- data/lib/bio/db/embl/embl.rb +18 -10
- data/lib/bio/db/embl/sptr.rb +87 -67
- data/lib/bio/db/embl/swissprot.rb +32 -3
- data/lib/bio/db/embl/trembl.rb +32 -3
- data/lib/bio/db/embl/uniprot.rb +32 -3
- data/lib/bio/db/fasta.rb +327 -289
- data/lib/bio/db/medline.rb +25 -4
- data/lib/bio/db/nbrf.rb +12 -20
- data/lib/bio/db/pdb.rb +4 -1
- data/lib/bio/db/pdb/chemicalcomponent.rb +240 -0
- data/lib/bio/db/pdb/pdb.rb +13 -8
- data/lib/bio/db/rebase.rb +93 -97
- data/lib/bio/feature.rb +2 -31
- data/lib/bio/io/ddbjxml.rb +167 -139
- data/lib/bio/io/fastacmd.rb +89 -56
- data/lib/bio/io/flatfile.rb +994 -278
- data/lib/bio/io/flatfile/index.rb +257 -194
- data/lib/bio/io/flatfile/indexer.rb +37 -29
- data/lib/bio/reference.rb +147 -64
- data/lib/bio/sequence.rb +57 -417
- data/lib/bio/sequence/aa.rb +64 -0
- data/lib/bio/sequence/common.rb +175 -0
- data/lib/bio/sequence/compat.rb +68 -0
- data/lib/bio/sequence/format.rb +134 -0
- data/lib/bio/sequence/generic.rb +24 -0
- data/lib/bio/sequence/na.rb +189 -0
- data/lib/bio/shell.rb +9 -23
- data/lib/bio/shell/core.rb +130 -125
- data/lib/bio/shell/demo.rb +143 -0
- data/lib/bio/shell/{session.rb → interface.rb} +42 -40
- data/lib/bio/shell/object.rb +52 -0
- data/lib/bio/shell/plugin/codon.rb +4 -22
- data/lib/bio/shell/plugin/emboss.rb +23 -0
- data/lib/bio/shell/plugin/entry.rb +34 -25
- data/lib/bio/shell/plugin/flatfile.rb +5 -23
- data/lib/bio/shell/plugin/keggapi.rb +11 -24
- data/lib/bio/shell/plugin/midi.rb +5 -23
- data/lib/bio/shell/plugin/obda.rb +4 -22
- data/lib/bio/shell/plugin/seq.rb +6 -24
- data/lib/bio/shell/rails/Rakefile +10 -0
- data/lib/bio/shell/rails/app/controllers/application.rb +4 -0
- data/lib/bio/shell/rails/app/controllers/shell_controller.rb +94 -0
- data/lib/bio/shell/rails/app/helpers/application_helper.rb +3 -0
- data/lib/bio/shell/rails/app/models/shell_connection.rb +30 -0
- data/lib/bio/shell/rails/app/views/layouts/shell.rhtml +37 -0
- data/lib/bio/shell/rails/app/views/shell/history.rhtml +5 -0
- data/lib/bio/shell/rails/app/views/shell/index.rhtml +2 -0
- data/lib/bio/shell/rails/app/views/shell/show.rhtml +13 -0
- data/lib/bio/shell/rails/config/boot.rb +19 -0
- data/lib/bio/shell/rails/config/database.yml +85 -0
- data/lib/bio/shell/rails/config/environment.rb +53 -0
- data/lib/bio/shell/rails/config/environments/development.rb +19 -0
- data/lib/bio/shell/rails/config/environments/production.rb +19 -0
- data/lib/bio/shell/rails/config/environments/test.rb +19 -0
- data/lib/bio/shell/rails/config/routes.rb +19 -0
- data/lib/bio/shell/rails/doc/README_FOR_APP +2 -0
- data/lib/bio/shell/rails/public/404.html +8 -0
- data/lib/bio/shell/rails/public/500.html +8 -0
- data/lib/bio/shell/rails/public/dispatch.cgi +10 -0
- data/lib/bio/shell/rails/public/dispatch.fcgi +24 -0
- data/lib/bio/shell/rails/public/dispatch.rb +10 -0
- data/lib/bio/shell/rails/public/favicon.ico +0 -0
- data/lib/bio/shell/rails/public/images/icon.png +0 -0
- data/lib/bio/shell/rails/public/images/rails.png +0 -0
- data/lib/bio/shell/rails/public/index.html +277 -0
- data/lib/bio/shell/rails/public/javascripts/controls.js +750 -0
- data/lib/bio/shell/rails/public/javascripts/dragdrop.js +584 -0
- data/lib/bio/shell/rails/public/javascripts/effects.js +854 -0
- data/lib/bio/shell/rails/public/javascripts/prototype.js +1785 -0
- data/lib/bio/shell/rails/public/robots.txt +1 -0
- data/lib/bio/shell/rails/public/stylesheets/main.css +187 -0
- data/lib/bio/shell/rails/script/about +3 -0
- data/lib/bio/shell/rails/script/breakpointer +3 -0
- data/lib/bio/shell/rails/script/console +3 -0
- data/lib/bio/shell/rails/script/destroy +3 -0
- data/lib/bio/shell/rails/script/generate +3 -0
- data/lib/bio/shell/rails/script/performance/benchmarker +3 -0
- data/lib/bio/shell/rails/script/performance/profiler +3 -0
- data/lib/bio/shell/rails/script/plugin +3 -0
- data/lib/bio/shell/rails/script/process/reaper +3 -0
- data/lib/bio/shell/rails/script/process/spawner +3 -0
- data/lib/bio/shell/rails/script/process/spinner +3 -0
- data/lib/bio/shell/rails/script/runner +3 -0
- data/lib/bio/shell/rails/script/server +42 -0
- data/lib/bio/shell/rails/test/test_helper.rb +28 -0
- data/lib/bio/shell/web.rb +90 -0
- data/lib/bio/util/contingency_table.rb +231 -225
- data/sample/any2fasta.rb +59 -0
- data/test/data/HMMER/hmmpfam.out +64 -0
- data/test/data/HMMER/hmmsearch.out +88 -0
- data/test/data/aaindex/DAYM780301 +30 -0
- data/test/data/aaindex/PRAM900102 +20 -0
- data/test/data/bl2seq/cd8a_cd8b_blastp.bl2seq +53 -0
- data/test/data/bl2seq/cd8a_p53_e-5blastp.bl2seq +37 -0
- data/test/data/blast/{eco:b0002.faa → b0002.faa} +0 -0
- data/test/data/blast/{eco:b0002.faa.m0 → b0002.faa.m0} +2 -2
- data/test/data/blast/{eco:b0002.faa.m7 → b0002.faa.m7} +1 -1
- data/test/data/blast/{eco:b0002.faa.m8 → b0002.faa.m8} +0 -0
- data/test/unit/bio/appl/bl2seq/test_report.rb +134 -0
- data/test/unit/bio/appl/blast/test_report.rb +15 -12
- data/test/unit/bio/appl/blast/test_xmlparser.rb +4 -4
- data/test/unit/bio/appl/hmmer/test_report.rb +355 -0
- data/test/unit/bio/appl/test_blast.rb +5 -5
- data/test/unit/bio/data/test_na.rb +9 -18
- data/test/unit/bio/db/pdb/test_pdb.rb +169 -0
- data/test/unit/bio/db/test_aaindex.rb +197 -0
- data/test/unit/bio/io/test_fastacmd.rb +55 -0
- data/test/unit/bio/sequence/test_aa.rb +102 -0
- data/test/unit/bio/sequence/test_common.rb +178 -0
- data/test/unit/bio/sequence/test_compat.rb +82 -0
- data/test/unit/bio/sequence/test_na.rb +242 -0
- data/test/unit/bio/shell/plugin/test_seq.rb +29 -19
- data/test/unit/bio/test_alignment.rb +15 -7
- data/test/unit/bio/test_reference.rb +198 -0
- data/test/unit/bio/test_sequence.rb +4 -49
- data/test/unit/bio/test_shell.rb +2 -2
- metadata +118 -15
- data/lib/bio/io/brdb.rb +0 -103
- data/lib/bioruby.rb +0 -34
|
@@ -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_report.rb,v 1.
|
|
20
|
+
# $Id: test_report.rb,v 1.3 2006/02/03 17:21:51 nakao Exp $
|
|
21
21
|
#
|
|
22
22
|
|
|
23
23
|
require 'pathname'
|
|
@@ -34,17 +34,17 @@ module Bio
|
|
|
34
34
|
TestDataBlast = Pathname.new(File.join(bioruby_root, 'test', 'data', 'blast')).cleanpath.to_s
|
|
35
35
|
|
|
36
36
|
def self.input
|
|
37
|
-
File.open(File.join(TestDataBlast, '
|
|
37
|
+
File.open(File.join(TestDataBlast, 'b0002.faa')).read
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def self.output(format = 7)
|
|
41
41
|
case format
|
|
42
42
|
when 0
|
|
43
|
-
File.open(File.join(TestDataBlast, '
|
|
43
|
+
File.open(File.join(TestDataBlast, 'b0002.faa.m0')).read
|
|
44
44
|
when 7
|
|
45
|
-
File.open(File.join(TestDataBlast, '
|
|
45
|
+
File.open(File.join(TestDataBlast, 'b0002.faa.m7')).read
|
|
46
46
|
when 8
|
|
47
|
-
File.open(File.join(TestDataBlast, '
|
|
47
|
+
File.open(File.join(TestDataBlast, 'b0002.faa.m8')).read
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
end
|
|
@@ -80,12 +80,12 @@ module Bio
|
|
|
80
80
|
def test_reference
|
|
81
81
|
xml_quoted_str = "~Reference: Altschul, Stephen F., Thomas L. Madden, Alejandro A. Schaffer, ~Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997), ~"Gapped BLAST and PSI-BLAST: a new generation of protein database search~programs", Nucleic Acids Res. 25:3389-3402."
|
|
82
82
|
text_str = '~Reference: Altschul, Stephen F., Thomas L. Madden, Alejandro A. Schaffer, ~Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997), ~"Gapped BLAST and PSI-BLAST: a new generation of protein database search~programs", Nucleic Acids Res. 25:3389-3402.'
|
|
83
|
-
assert_equal(xml_quoted_str, @report.reference)
|
|
83
|
+
# assert_equal(xml_quoted_str, @report.reference)
|
|
84
84
|
assert_equal(text_str, @report.reference)
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
def test_db
|
|
88
|
-
assert_equal('
|
|
88
|
+
assert_equal('b0002.faa', @report.db)
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
def test_query_id
|
|
@@ -133,11 +133,11 @@ module Bio
|
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
def test_pattern
|
|
136
|
-
|
|
136
|
+
assert_equal(nil, @report.pattern)
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
def test_extrez_query
|
|
140
|
-
|
|
140
|
+
assert_equal(nil, @report.entrez_query)
|
|
141
141
|
end
|
|
142
142
|
|
|
143
143
|
def test_each_iteration
|
|
@@ -185,7 +185,7 @@ module Bio
|
|
|
185
185
|
end
|
|
186
186
|
|
|
187
187
|
def test_message
|
|
188
|
-
|
|
188
|
+
assert_equal(nil, @report.message)
|
|
189
189
|
end
|
|
190
190
|
end
|
|
191
191
|
|
|
@@ -201,7 +201,10 @@ module Bio
|
|
|
201
201
|
end
|
|
202
202
|
|
|
203
203
|
def test_statistics
|
|
204
|
-
|
|
204
|
+
stat = {"kappa" => 0.041, "eff-space" => 605284, "db-num" => 1,
|
|
205
|
+
"hsp-len" => 42, "db-len" => 820, "lambda" => 0.267,
|
|
206
|
+
"entropy" => 0.14}
|
|
207
|
+
assert_equal(stat, @itr.statistics)
|
|
205
208
|
end
|
|
206
209
|
|
|
207
210
|
def test_num
|
|
@@ -209,7 +212,7 @@ module Bio
|
|
|
209
212
|
end
|
|
210
213
|
|
|
211
214
|
def test_message
|
|
212
|
-
|
|
215
|
+
assert_equal(nil, @itr.message)
|
|
213
216
|
end
|
|
214
217
|
end
|
|
215
218
|
|
|
@@ -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_xmlparser.rb,v 1.
|
|
20
|
+
# $Id: test_xmlparser.rb,v 1.4 2006/02/03 17:21:51 nakao Exp $
|
|
21
21
|
#
|
|
22
22
|
|
|
23
23
|
require 'pathname'
|
|
@@ -34,11 +34,11 @@ module Bio
|
|
|
34
34
|
TestDataBlast = Pathname.new(File.join(bioruby_root, 'test', 'data', 'blast')).cleanpath.to_s
|
|
35
35
|
|
|
36
36
|
def self.input
|
|
37
|
-
File.open(File.join(TestDataBlast, '
|
|
37
|
+
File.open(File.join(TestDataBlast, 'b0002.faa')).read
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def self.output
|
|
41
|
-
File.open(File.join(TestDataBlast, '
|
|
41
|
+
File.open(File.join(TestDataBlast, 'b0002.faa.m7')).read
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
@@ -71,7 +71,7 @@ module Bio
|
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
def test_db
|
|
74
|
-
assert_equal("
|
|
74
|
+
assert_equal("b0002.faa", @report.db)
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def test_query_id
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
#
|
|
2
|
+
# test/unit/bio/appl/hmmer/test_report.rb - Unit test for Bio::HMMER::Report
|
|
3
|
+
#
|
|
4
|
+
# Copyright (C) 2006 Mitsuteru Nakao <n@bioruby.org>
|
|
5
|
+
#
|
|
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_report.rb,v 1.1 2006/02/02 17:10:08 nakao Exp $
|
|
21
|
+
#
|
|
22
|
+
|
|
23
|
+
require 'pathname'
|
|
24
|
+
libpath = Pathname.new(File.join(File.join(File.dirname(__FILE__), ['..'] * 5, 'lib'))).cleanpath.to_s
|
|
25
|
+
$:.unshift(libpath) unless $:.include?(libpath)
|
|
26
|
+
|
|
27
|
+
require 'test/unit'
|
|
28
|
+
require 'bio/appl/hmmer/report'
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
module Bio
|
|
32
|
+
|
|
33
|
+
class TestHMMERReportData
|
|
34
|
+
bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5)).cleanpath.to_s
|
|
35
|
+
TestDataHMMER = Pathname.new(File.join(bioruby_root, 'test', 'data', 'HMMER')).cleanpath.to_s
|
|
36
|
+
|
|
37
|
+
def self.hmmpfam
|
|
38
|
+
File.open(File.join(TestDataHMMER, 'hmmpfam.out')).read
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.output
|
|
42
|
+
self.hmmpfam
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def self.hmmsearch
|
|
46
|
+
File.open(File.join(TestDataHMMER, 'hmmsearch.out')).read
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class TestHMMERReportClassMethods < Test::Unit::TestCase
|
|
52
|
+
def test_reports_ary
|
|
53
|
+
ary = Bio::HMMER.reports(Bio::TestHMMERReportData.output)
|
|
54
|
+
assert_equal(Array, ary.class)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def test_reports_ary
|
|
58
|
+
Bio::HMMER.reports(Bio::TestHMMERReportData.output).each do |report|
|
|
59
|
+
assert_equal(Bio::HMMER::Report, report.class)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class TestHMMERReportConstants < Test::Unit::TestCase
|
|
66
|
+
def test_rs
|
|
67
|
+
assert_equal("\n//\n", Bio::HMMER::Report::RS)
|
|
68
|
+
assert_equal("\n//\n", Bio::HMMER::Report::DELIMITER)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class TestHMMERReportHmmpfam < Test::Unit::TestCase
|
|
74
|
+
def setup
|
|
75
|
+
@obj = Bio::HMMER::Report.new(Bio::TestHMMERReportData.hmmpfam)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def test_program
|
|
79
|
+
assert_equal(Hash, @obj.program.class)
|
|
80
|
+
assert_equal("hmmpfam - search one or more sequences against HMM database", @obj.program['name'])
|
|
81
|
+
assert_equal("HMMER 2.3.2 (Oct 2003)", @obj.program['version'])
|
|
82
|
+
assert_equal("Copyright (C) 1992-2003 HHMI/Washington University School of Medicine", @obj.program['copyright'])
|
|
83
|
+
assert_equal("Freely distributed under the GNU General Public License (GPL)", @obj.program['license'])
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def test_parameter
|
|
87
|
+
assert_equal(Hash, @obj.parameter.class)
|
|
88
|
+
assert_equal("/Users/nakao/Sites/iprscan/tmp/20050517/iprscan-20050517-16244071/chunk_1/iprscan-20050517-16244071.nocrc", @obj.parameter["Sequence file"])
|
|
89
|
+
assert_equal("/Users/nakao/Sites/iprscan/data/Pfam", @obj.parameter['HMM file'])
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def test_query_info
|
|
93
|
+
assert_equal(Hash, @obj.query_info.class)
|
|
94
|
+
assert_equal("104K_THEPA", @obj.query_info["Query sequence"])
|
|
95
|
+
assert_equal("[none]", @obj.query_info["Accession"])
|
|
96
|
+
assert_equal("[none]", @obj.query_info["Description"])
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def test_hits
|
|
100
|
+
assert_equal(Bio::HMMER::Report::Hit, @obj.hits.first.class)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def test_hsps
|
|
104
|
+
assert_equal(Bio::HMMER::Report::Hsp, @obj.hsps.first.class)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def test_histogram
|
|
108
|
+
assert_equal(nil, @obj.histogram)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def test_statistical_detail
|
|
112
|
+
assert_equal(nil, @obj.statistical_detail)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def test_total_seq_searched
|
|
116
|
+
assert_equal(nil, @obj.total_seq_searched)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def test_whole_seq_top_hits
|
|
120
|
+
assert_equal(nil, @obj.whole_seq_top_hits)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def test_domain_top_hits
|
|
124
|
+
assert_equal(nil, @obj.domain_top_hits)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def test_each
|
|
128
|
+
@obj.each do |hit|
|
|
129
|
+
assert_equal(Bio::HMMER::Report::Hit, hit.class)
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def test_each_hit
|
|
134
|
+
@obj.each_hit do |hit|
|
|
135
|
+
assert_equal(Bio::HMMER::Report::Hit, hit.class)
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class TestHMMERReportHit < Test::Unit::TestCase
|
|
142
|
+
def setup
|
|
143
|
+
@obj = Bio::HMMER::Report.new(Bio::TestHMMERReportData.output).hits.first
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def test_hit
|
|
147
|
+
assert_equal(Bio::HMMER::Report::Hit, @obj.class)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def test_hsps
|
|
151
|
+
assert_equal(Bio::HMMER::Report::Hsp, @obj.hsps.first.class)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def test_accession
|
|
155
|
+
assert_equal("PF04385.4", @obj.accession)
|
|
156
|
+
end
|
|
157
|
+
def test_target_id
|
|
158
|
+
assert_equal("PF04385.4", @obj.target_id)
|
|
159
|
+
end
|
|
160
|
+
def test_hit_id
|
|
161
|
+
assert_equal("PF04385.4", @obj.hit_id)
|
|
162
|
+
end
|
|
163
|
+
def test_entry_id
|
|
164
|
+
assert_equal("PF04385.4", @obj.entry_id)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def test_description
|
|
168
|
+
assert_equal("Domain of unknown function, DUF529", @obj.description)
|
|
169
|
+
end
|
|
170
|
+
def test_definition
|
|
171
|
+
assert_equal("Domain of unknown function, DUF529", @obj.definition)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def test_score
|
|
175
|
+
assert_equal(259.3, @obj.score)
|
|
176
|
+
end
|
|
177
|
+
def test_bit_score
|
|
178
|
+
assert_equal(259.3, @obj.bit_score)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
def test_evalue
|
|
182
|
+
assert_equal(6.6e-75, @obj.evalue)
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def test_num
|
|
186
|
+
assert_equal(4, @obj.num)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
def test_each
|
|
190
|
+
@obj.each do |hsp|
|
|
191
|
+
assert_equal(Bio::HMMER::Report::Hsp, hsp.class)
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
def test_each_hsp
|
|
196
|
+
@obj.each_hsp do |hsp|
|
|
197
|
+
assert_equal(Bio::HMMER::Report::Hsp, hsp.class)
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def test_target_def
|
|
202
|
+
assert_equal("<4> Domain of unknown function, DUF529", @obj.target_def)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def test_append_hsp
|
|
206
|
+
hsp = @obj.hsps.first
|
|
207
|
+
assert_equal(5, @obj.append_hsp(hsp).size)
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
class TestHMMERReportHsp < Test::Unit::TestCase
|
|
212
|
+
|
|
213
|
+
def setup
|
|
214
|
+
@obj = Bio::HMMER::Report.new(Bio::TestHMMERReportData.output).hits.first.hsps.first
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
def test_hsp
|
|
218
|
+
assert_equal(Bio::HMMER::Report::Hsp, @obj.class)
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
def test_accession
|
|
222
|
+
assert_equal("PF04385.4", @obj.accession)
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
def test_domain
|
|
226
|
+
assert_equal("1/4", @obj.domain)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
def test_seq_f
|
|
230
|
+
assert_equal(36, @obj.seq_f)
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
def test_seq_t
|
|
234
|
+
assert_equal(111, @obj.seq_t)
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
def test_seq_ft
|
|
238
|
+
assert_equal("..", @obj.seq_ft)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
def test_hmm_f
|
|
242
|
+
assert_equal(1, @obj.hmm_f)
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
def test_hmm_t
|
|
246
|
+
assert_equal(80, @obj.hmm_t)
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
def test_score
|
|
250
|
+
assert_equal(65.0, @obj.score)
|
|
251
|
+
end
|
|
252
|
+
def test_bit_score
|
|
253
|
+
assert_equal(65.0, @obj.bit_score)
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
def test_evalue
|
|
257
|
+
assert_equal(2.0e-16, @obj.evalue)
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
def test_midline
|
|
261
|
+
assert_equal("t+D+n++++ f +v+++g+++ + ++ ++v+++++++Gn+v+We++ + +l++ ++++++++++++++++ +++", @obj.midline)
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
def test_hmmseq
|
|
265
|
+
assert_equal("tLDlndtgstlkqfdykvalngdivvtytpkpGvkftkitdGnevvWeseddpefglivtlsfyldsnkfLvlllintak", @obj.hmmseq)
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
def test_flatseq
|
|
269
|
+
assert_equal("TFDINSNQTG-PAFLTAVEMAGVKYLQVQHGSNVNIHRLVEGNVVIWENA---STPLYTGAIVTNNDGPYMAYVEVLGDP", @obj.flatseq)
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
def test_query_frame
|
|
273
|
+
assert_equal(1, @obj.query_frame)
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
def test_target_frame
|
|
277
|
+
assert_equal(1, @obj.target_frame)
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
def test_csline
|
|
281
|
+
assert_equal(nil, @obj.csline)
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
def test_rfline
|
|
285
|
+
assert_equal(nil, @obj.rfline)
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
def test_set_alignment
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
def test_query_seq
|
|
292
|
+
assert_equal("TFDINSNQTG-PAFLTAVEMAGVKYLQVQHGSNVNIHRLVEGNVVIWENA---STPLYTGAIVTNNDGPYMAYVEVLGDP", @obj.query_seq)
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
def test_target_seq
|
|
296
|
+
assert_equal("tLDlndtgstlkqfdykvalngdivvtytpkpGvkftkitdGnevvWeseddpefglivtlsfyldsnkfLvlllintak", @obj.target_seq)
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
def test_target_from
|
|
300
|
+
assert_equal(1, @obj.target_from)
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
def test_targat_to
|
|
304
|
+
assert_equal(80, @obj.target_to)
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
def test_query_from
|
|
308
|
+
assert_equal(36, @obj.query_from)
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
def test_query_to
|
|
312
|
+
assert_equal(111, @obj.query_to)
|
|
313
|
+
end
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
class TestHMMERReportHmmsearch < Test::Unit::TestCase
|
|
317
|
+
def setup
|
|
318
|
+
@obj = Bio::HMMER::Report.new(Bio::TestHMMERReportData.hmmsearch)
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
def test_histogram
|
|
322
|
+
hist = "score obs exp (one = represents 1 sequences)\n----- --- ---\n 377 1 0|="
|
|
323
|
+
assert_equal(hist, @obj.histogram)
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
def test_statistical_detail
|
|
327
|
+
hash = {"P(chi-square)" => 0.0, "chi-sq statistic" => 0.0, "lambda" => 0.7676, "mu" => -10.6639}
|
|
328
|
+
assert_equal(hash, @obj.statistical_detail)
|
|
329
|
+
hash.keys.each do |key|
|
|
330
|
+
assert_equal(hash[key], @obj.statistical_detail[key])
|
|
331
|
+
end
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
def test_total_seq_searched
|
|
335
|
+
assert_equal(1, @obj.total_seq_searched)
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
def test_whole_seq_top_hit
|
|
339
|
+
hash = {"Total memory" => "16K", "Satisfying E cutoff" => 1, "Total hits" => 1}
|
|
340
|
+
assert_equal(hash, @obj.whole_seq_top_hits)
|
|
341
|
+
hash.keys.each do |key|
|
|
342
|
+
assert_equal(hash[key], @obj.whole_seq_top_hits[key])
|
|
343
|
+
end
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
def test_domain_top_hits
|
|
347
|
+
hash = {"Total memory" => "17K", "Satisfying E cutoff" => 1, "Total hits" => 1}
|
|
348
|
+
assert_equal(hash, @obj.domain_top_hits)
|
|
349
|
+
hash.keys.each do |key|
|
|
350
|
+
assert_equal(hash[key], @obj.domain_top_hits[key])
|
|
351
|
+
end
|
|
352
|
+
end
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
end # module Bio
|