bio 1.4.3.0001 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +39 -33
- data/BSDL +22 -0
- data/COPYING +2 -2
- data/COPYING.ja +36 -36
- data/ChangeLog +2404 -1025
- data/KNOWN_ISSUES.rdoc +15 -55
- data/README.rdoc +17 -23
- data/RELEASE_NOTES.rdoc +246 -183
- data/Rakefile +3 -2
- data/bin/br_biofetch.rb +29 -5
- data/bioruby.gemspec +15 -32
- data/bioruby.gemspec.erb +10 -20
- data/doc/ChangeLog-1.4.3 +1478 -0
- data/doc/RELEASE_NOTES-1.4.3.rdoc +204 -0
- data/doc/Tutorial.rd +0 -6
- data/doc/Tutorial.rd.html +7 -12
- data/doc/Tutorial.rd.ja +960 -1064
- data/doc/Tutorial.rd.ja.html +977 -1067
- data/gemfiles/Gemfile.travis-jruby1.8 +2 -1
- data/gemfiles/Gemfile.travis-jruby1.9 +2 -4
- data/gemfiles/Gemfile.travis-rbx +13 -0
- data/gemfiles/Gemfile.travis-ruby1.8 +2 -1
- data/gemfiles/Gemfile.travis-ruby1.9 +2 -4
- data/gemfiles/Gemfile.travis-ruby2.2 +9 -0
- data/lib/bio.rb +10 -43
- data/lib/bio/alignment.rb +8 -14
- data/lib/bio/appl/blast.rb +1 -2
- data/lib/bio/appl/blast/format0.rb +18 -7
- data/lib/bio/appl/blast/remote.rb +0 -9
- data/lib/bio/appl/blast/report.rb +1 -1
- data/lib/bio/appl/clustalw/report.rb +3 -1
- data/lib/bio/appl/genscan/report.rb +1 -2
- data/lib/bio/appl/iprscan/report.rb +1 -2
- data/lib/bio/appl/meme/mast.rb +4 -4
- data/lib/bio/appl/meme/mast/report.rb +1 -1
- data/lib/bio/appl/paml/codeml.rb +2 -2
- data/lib/bio/appl/paml/codeml/report.rb +1 -0
- data/lib/bio/appl/paml/common.rb +1 -1
- data/lib/bio/appl/sosui/report.rb +1 -2
- data/lib/bio/command.rb +62 -2
- data/lib/bio/data/aa.rb +13 -31
- data/lib/bio/data/codontable.rb +1 -2
- data/lib/bio/db/biosql/biosql_to_biosequence.rb +1 -0
- data/lib/bio/db/biosql/sequence.rb +1 -1
- data/lib/bio/db/embl/common.rb +1 -1
- data/lib/bio/db/embl/embl.rb +5 -4
- data/lib/bio/db/embl/format_embl.rb +3 -3
- data/lib/bio/db/embl/sptr.rb +9 -1444
- data/lib/bio/db/embl/swissprot.rb +12 -29
- data/lib/bio/db/embl/trembl.rb +13 -30
- data/lib/bio/db/embl/uniprot.rb +12 -29
- data/lib/bio/db/embl/uniprotkb.rb +1455 -0
- data/lib/bio/db/fasta.rb +17 -0
- data/lib/bio/db/fasta/defline.rb +1 -3
- data/lib/bio/db/fastq.rb +1 -1
- data/lib/bio/db/genbank/ddbj.rb +9 -5
- data/lib/bio/db/genbank/refseq.rb +11 -3
- data/lib/bio/db/gff.rb +3 -4
- data/lib/bio/db/go.rb +5 -6
- data/lib/bio/db/kegg/module.rb +4 -5
- data/lib/bio/db/kegg/pathway.rb +4 -5
- data/lib/bio/db/kegg/reaction.rb +1 -1
- data/lib/bio/db/nexus.rb +3 -2
- data/lib/bio/db/pdb/pdb.rb +2 -2
- data/lib/bio/db/phyloxml/phyloxml_elements.rb +82 -59
- data/lib/bio/db/phyloxml/phyloxml_parser.rb +2 -2
- data/lib/bio/db/phyloxml/phyloxml_writer.rb +1 -2
- data/lib/bio/db/sanger_chromatogram/chromatogram.rb +1 -2
- data/lib/bio/db/transfac.rb +1 -1
- data/lib/bio/io/das.rb +40 -41
- data/lib/bio/io/fastacmd.rb +0 -16
- data/lib/bio/io/fetch.rb +111 -55
- data/lib/bio/io/flatfile/buffer.rb +4 -5
- data/lib/bio/io/hinv.rb +2 -3
- data/lib/bio/io/ncbirest.rb +43 -6
- data/lib/bio/io/pubmed.rb +76 -81
- data/lib/bio/io/togows.rb +33 -10
- data/lib/bio/map.rb +1 -1
- data/lib/bio/pathway.rb +1 -1
- data/lib/bio/sequence/compat.rb +1 -1
- data/lib/bio/sequence/na.rb +63 -12
- data/lib/bio/shell.rb +0 -2
- data/lib/bio/shell/core.rb +5 -6
- data/lib/bio/shell/interface.rb +3 -4
- data/lib/bio/shell/irb.rb +1 -2
- data/lib/bio/shell/plugin/entry.rb +2 -3
- data/lib/bio/shell/plugin/seq.rb +7 -6
- data/lib/bio/shell/setup.rb +1 -2
- data/lib/bio/tree.rb +2 -2
- data/lib/bio/util/contingency_table.rb +0 -2
- data/lib/bio/util/restriction_enzyme/range/sequence_range.rb +2 -2
- data/lib/bio/util/sirna.rb +76 -16
- data/lib/bio/version.rb +8 -9
- data/sample/benchmark_clustalw_report.rb +47 -0
- data/sample/biofetch.rb +248 -151
- data/setup.rb +6 -7
- data/test/data/clustalw/example1-seqnos.aln +58 -0
- data/test/network/bio/appl/blast/test_remote.rb +1 -15
- data/test/network/bio/appl/test_blast.rb +0 -12
- data/test/network/bio/io/test_pubmed.rb +49 -0
- data/test/network/bio/io/test_togows.rb +0 -1
- data/test/network/bio/test_command.rb +65 -2
- data/test/unit/bio/appl/bl2seq/test_report.rb +0 -1
- data/test/unit/bio/appl/blast/test_report.rb +110 -48
- data/test/unit/bio/appl/clustalw/test_report.rb +67 -51
- data/test/unit/bio/appl/sim4/test_report.rb +46 -17
- data/test/unit/bio/appl/test_blast.rb +2 -2
- data/test/unit/bio/db/embl/test_embl.rb +0 -1
- data/test/unit/bio/db/embl/test_embl_rel89.rb +0 -1
- data/test/unit/bio/db/embl/{test_sptr.rb → test_uniprotkb.rb} +111 -115
- data/test/unit/bio/db/embl/{test_uniprot_new_part.rb → test_uniprotkb_new_part.rb} +11 -11
- data/test/unit/bio/db/genbank/test_genbank.rb +10 -4
- data/test/unit/bio/db/pdb/test_pdb.rb +14 -8
- data/test/unit/bio/db/test_fasta.rb +41 -1
- data/test/unit/bio/db/test_fastq.rb +14 -4
- data/test/unit/bio/db/test_gff.rb +2 -2
- data/test/unit/bio/db/test_phyloxml.rb +30 -30
- data/test/unit/bio/db/test_phyloxml_writer.rb +2 -2
- data/test/unit/bio/io/flatfile/test_autodetection.rb +1 -2
- data/test/unit/bio/io/flatfile/test_buffer.rb +7 -1
- data/test/unit/bio/io/flatfile/test_splitter.rb +1 -1
- data/test/unit/bio/io/test_togows.rb +3 -2
- data/test/unit/bio/sequence/test_dblink.rb +1 -1
- data/test/unit/bio/sequence/test_na.rb +3 -1
- data/test/unit/bio/test_alignment.rb +1 -2
- data/test/unit/bio/test_command.rb +5 -4
- data/test/unit/bio/test_db.rb +4 -2
- data/test/unit/bio/test_pathway.rb +25 -10
- data/test/unit/bio/util/test_sirna.rb +22 -22
- metadata +656 -1430
- data/doc/KEGG_API.rd +0 -1843
- data/doc/KEGG_API.rd.ja +0 -1834
- data/extconf.rb +0 -2
- data/lib/bio/appl/blast/ddbj.rb +0 -131
- data/lib/bio/db/kegg/taxonomy.rb +0 -280
- data/lib/bio/io/dbget.rb +0 -194
- data/lib/bio/io/ddbjrest.rb +0 -344
- data/lib/bio/io/ddbjxml.rb +0 -458
- data/lib/bio/io/ebisoap.rb +0 -158
- data/lib/bio/io/ensembl.rb +0 -229
- data/lib/bio/io/higet.rb +0 -73
- data/lib/bio/io/keggapi.rb +0 -363
- data/lib/bio/io/ncbisoap.rb +0 -156
- data/lib/bio/io/soapwsdl.rb +0 -119
- data/lib/bio/shell/plugin/keggapi.rb +0 -181
- data/lib/bio/shell/plugin/soap.rb +0 -87
- data/sample/dbget +0 -37
- data/sample/demo_ddbjxml.rb +0 -212
- data/sample/demo_kegg_taxonomy.rb +0 -92
- data/sample/demo_keggapi.rb +0 -502
- data/sample/psortplot_html.rb +0 -214
- data/test/network/bio/io/test_ddbjrest.rb +0 -47
- data/test/network/bio/io/test_ensembl.rb +0 -230
- data/test/network/bio/io/test_soapwsdl.rb +0 -53
- data/test/unit/bio/io/test_ddbjxml.rb +0 -81
- data/test/unit/bio/io/test_ensembl.rb +0 -111
- data/test/unit/bio/io/test_soapwsdl.rb +0 -33
data/setup.rb
CHANGED
@@ -104,7 +104,7 @@ class ConfigTable
|
|
104
104
|
def remove(name)
|
105
105
|
item = lookup(name)
|
106
106
|
@items.delete_if {|i| i.name == name }
|
107
|
-
@table.delete_if {|
|
107
|
+
@table.delete_if {|na, i| i.name == na }
|
108
108
|
item
|
109
109
|
end
|
110
110
|
|
@@ -189,7 +189,7 @@ class ConfigTable
|
|
189
189
|
path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix')
|
190
190
|
}
|
191
191
|
|
192
|
-
if arg = c['configure_args'].split.detect {|
|
192
|
+
if arg = c['configure_args'].split.detect {|a| /--with-make-prog=/ =~ a }
|
193
193
|
makeprog = arg.sub(/'/, '').split(/=/, 2)[1]
|
194
194
|
else
|
195
195
|
makeprog = 'make'
|
@@ -281,7 +281,6 @@ class ConfigTable
|
|
281
281
|
'site-ruby-common' => 'siteruby', # For backward compatibility
|
282
282
|
'site-ruby' => 'siterubyver', # For backward compatibility
|
283
283
|
'bin-dir' => 'bindir',
|
284
|
-
'bin-dir' => 'bindir',
|
285
284
|
'rb-dir' => 'rbdir',
|
286
285
|
'so-dir' => 'sodir',
|
287
286
|
'data-dir' => 'datadir',
|
@@ -779,14 +778,14 @@ class ToplevelInstaller
|
|
779
778
|
end
|
780
779
|
|
781
780
|
def ToplevelInstaller.load_rbconfig
|
782
|
-
if arg = ARGV.detect {|
|
781
|
+
if arg = ARGV.detect {|a| /\A--rbconfig=/ =~ a }
|
783
782
|
ARGV.delete(arg)
|
784
783
|
load File.expand_path(arg.split(/=/, 2)[1])
|
785
784
|
$".push 'rbconfig.rb'
|
786
785
|
else
|
787
786
|
require 'rbconfig'
|
788
787
|
end
|
789
|
-
::
|
788
|
+
::RbConfig::CONFIG
|
790
789
|
end
|
791
790
|
|
792
791
|
def initialize(ardir_root, config)
|
@@ -920,8 +919,8 @@ class ToplevelInstaller
|
|
920
919
|
end
|
921
920
|
set.push name
|
922
921
|
end
|
923
|
-
evalopt.each do |
|
924
|
-
@config.lookup(
|
922
|
+
evalopt.each do |na, va|
|
923
|
+
@config.lookup(na).evaluate va, @config
|
925
924
|
end
|
926
925
|
# Check if configuration is valid
|
927
926
|
set.each do |n|
|
@@ -0,0 +1,58 @@
|
|
1
|
+
CLUSTAL 2.0.9 multiple sequence alignment
|
2
|
+
|
3
|
+
|
4
|
+
query -MKNTLLKLGVCVSLLGITPFVSTISSVQAERTVEHKVIKNETGTISISQ 49
|
5
|
+
gi|115023|sp|P10425| MKKNTLLKVGLCVSLLGTTQFVSTISSVQASQKVEQIVIKNETGTISISQ 50
|
6
|
+
gi|115030|sp|P25910| -MKTVFILISMLFPVAVMAQKSVKIS-----------------DDISITQ 32
|
7
|
+
gi|2984094 MGGFLFFFLLVLFSFSSEYPKHVKET------------------LRKITD 32
|
8
|
+
gi|282554|pir||S25844 -------------------------------------------MTVEVRE 7
|
9
|
+
.: :
|
10
|
+
|
11
|
+
query LNKNVWVHTELGYFSG-EAVPSNGLVLNTSKGLVLVDSSWDDKLTKELIE 98
|
12
|
+
gi|115023|sp|P10425| LNKNVWVHTELGYFNG-EAVPSNGLVLNTSKGLVLVDSSWDNKLTKELIE 99
|
13
|
+
gi|115030|sp|P25910| LSDKVYTYVSLAEIEGWGMVPSNGMIVINNHQAALLDTPINDAQTEMLVN 82
|
14
|
+
gi|2984094 RIYGVFGVYEQVSYEN-RGFISNAYFYVADDGVLVVDALSTYKLGKELIE 81
|
15
|
+
gi|282554|pir||S25844 VAEGVYAYEQAP---G-GWCVSNAGIVVGGDGALVVDTLSTIPRARRLAE 53
|
16
|
+
*: . . **. . .. ::*: . * :
|
17
|
+
|
18
|
+
query MVEKKFKKRVTDVIITHAHADRIGGMKTLKERGIKAHSTALTAELAKKNG 148
|
19
|
+
gi|115023|sp|P10425| MVEKKFQKRVTDVIITHAHADRIGGITALKERGIKAHSTALTAELAKKSG 149
|
20
|
+
gi|115030|sp|P25910| WVTDSLHAKVTTFIPNHWHGDCIGGLGYLQRKGVQSYANQMTIDLAKEKG 132
|
21
|
+
gi|2984094 SIRSVTNKPIRFLVVTHYHTDHFYGAKAFREVGAEVIAHEWAFDYISQPS 131
|
22
|
+
gi|282554|pir||S25844 WVDKLAAGPGRTVVNTHFHGDHAFGNQVFAP-GTRIIAHEDMRSAMVTTG 102
|
23
|
+
: . .: .* * * * : * . : . .
|
24
|
+
|
25
|
+
query --------------------YEEPLGDLQSVTNLKFGN----MKVETFYP 174
|
26
|
+
gi|115023|sp|P10425| --------------------YEEPLGDLQTVTNLKFGN----TKVETFYP 175
|
27
|
+
gi|115030|sp|P25910| --------------------LPVPEHGFTDSLTVSLDG----MPLQCYYL 158
|
28
|
+
gi|2984094 SYNFFLARKKILKEHLEGTELTPPTITLTKNLNVYLQVGKEYKRFEVLHL 181
|
29
|
+
gi|282554|pir||S25844 ----LALTGLWPRVDWGEIELRPPNVTFRDRLTLHVGE----RQVELICV 144
|
30
|
+
* : .: . .:
|
31
|
+
|
32
|
+
query GKGHTEDNIVVWLPQYQILAGGCLVKSASSKDLGNVADAYVNEWSTSIEN 224
|
33
|
+
gi|115023|sp|P10425| GKGHTEDNIVVWLPQYQILAGGCLVKSAEAKNLGNVADAYVNEWSTSIEN 225
|
34
|
+
gi|115030|sp|P25910| GGGHATDNIVVWLPTENILFGGCMLKDNQATSIGNISDADVTAWPKTLDK 208
|
35
|
+
gi|2984094 CRAHTNGDIVVWIPDEKVLFSGDIVFDGRLPFLG---SGNSRTWLVCLDE 228
|
36
|
+
gi|282554|pir||S25844 GPAHTDHDVVVWLPEERVLFAGDVVMSGVTPFAL---FGSVAGTLAALDR 191
|
37
|
+
.*: ::***:* .:* .* :: . . ::.
|
38
|
+
|
39
|
+
query VLKRYGNINLVVPGHGEVGDR-----GLLLHTLDLLK------------- 256
|
40
|
+
gi|115023|sp|P10425| MLKRYRNINLVVPGHGKVGDK-----GLLLHTLDLLK------------- 257
|
41
|
+
gi|115030|sp|P25910| VKAKFPSARYVVPGHGDYGGT-----ELIEHTKQIVNQYIESTSKP---- 249
|
42
|
+
gi|2984094 ILKMKPRILLPGHGEALIGEKKIK--EAVSWTRKYIKDLRETIRKLYEEG 276
|
43
|
+
gi|282554|pir||S25844 LAELEPEVVVGGHGPVAGPEVIDANRDYLRWVQRLAADAVDRRLTPLQAA 241
|
44
|
+
: * : .
|
45
|
+
|
46
|
+
query --------------------------------------------------
|
47
|
+
gi|115023|sp|P10425| --------------------------------------------------
|
48
|
+
gi|115030|sp|P25910| --------------------------------------------------
|
49
|
+
gi|2984094 --CDVECVRERINEELIKIDPSYAQVPVFF-NVNPVNAYYVYFEIENEIL 323
|
50
|
+
gi|282554|pir||S25844 RRADLGAFAGLLDAERLVANLHRAHEELLGGHVRDAMEIFAELVAYNGGQ 291
|
51
|
+
|
52
|
+
|
53
|
+
query ------
|
54
|
+
gi|115023|sp|P10425| ------
|
55
|
+
gi|115030|sp|P25910| ------
|
56
|
+
gi|2984094 MGE--- 326
|
57
|
+
gi|282554|pir||S25844 LPTCLA 297
|
58
|
+
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# = test/functional/bio/appl/blast/test_remote.rb - Unit test for Bio::Blast::Remote::Genomenet
|
2
|
+
# = test/functional/bio/appl/blast/test_remote.rb - Unit test for Bio::Blast::Remote::Genomenet with network connection
|
3
3
|
#
|
4
4
|
# Copyright:: Copyright (C) 2011
|
5
5
|
# Naohisa Goto <ng@bioruby.org>
|
@@ -74,20 +74,6 @@ module FuncTestBlastRemote
|
|
74
74
|
end
|
75
75
|
end #class NetTestBlastRemoteGenomeNet
|
76
76
|
|
77
|
-
# This test class only contains tests for meta information.
|
78
|
-
# BLAST execution tests are written in ../test_blast.rb
|
79
|
-
class NetTestBlastRemoteDDBJ < Test::Unit::TestCase
|
80
|
-
|
81
|
-
include NetTestBlastRemoteCommon
|
82
|
-
|
83
|
-
BLASTN_DBNAME_KEYWORDS = [ /ddbj/i, /nt/i ]
|
84
|
-
BLASTP_DBNAME_KEYWORDS = [ /uniprot/i, /pdb/i ]
|
85
|
-
|
86
|
-
def setup
|
87
|
-
@klass = Bio::Blast::Remote::DDBJ
|
88
|
-
end
|
89
|
-
end #class NetTestBlastRemoteDDBJ
|
90
|
-
|
91
77
|
end #module FuncTestBlastRemote
|
92
78
|
end #module Bio
|
93
79
|
|
@@ -44,18 +44,6 @@ module FunctTestBlast
|
|
44
44
|
end
|
45
45
|
end #class NetTestBlast_GenomeNet
|
46
46
|
|
47
|
-
class NetTestBlast_DDBJ < Test::Unit::TestCase
|
48
|
-
include NetTestBlastCommonProteinQuery
|
49
|
-
|
50
|
-
def setup
|
51
|
-
@blast = Bio::Blast.new('blastp', 'SWISS',
|
52
|
-
['-e', '1e-10',
|
53
|
-
'-v', '10',
|
54
|
-
'-b', '10' ],
|
55
|
-
'ddbj')
|
56
|
-
end
|
57
|
-
end #class NetTestBlast_DDBJ
|
58
|
-
|
59
47
|
end #module FuncTestBlast
|
60
48
|
end #module Bio
|
61
49
|
|
@@ -108,6 +108,55 @@ module Bio
|
|
108
108
|
assert(str.index(/\<PubmedArticleSet\>/))
|
109
109
|
end
|
110
110
|
|
111
|
+
def test_search
|
112
|
+
a = @pm.search('(bioruby OR ruby) AND bioinformatics')
|
113
|
+
assert_kind_of(Array, a)
|
114
|
+
# Maximum number of results of Bio::PubMed#search is limited to 20.
|
115
|
+
assert_equal(20, a.size,
|
116
|
+
'The failure may be caused by changes of NCBI PubMed.')
|
117
|
+
a.each do |x|
|
118
|
+
assert_kind_of(String, x)
|
119
|
+
assert_equal(x.strip, x.to_i.to_s,
|
120
|
+
'PMID is not an integer value. This suggests that NCBI have changed the PMID policy.')
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_query
|
125
|
+
pmid = 20739307
|
126
|
+
str = @pm.query(pmid)
|
127
|
+
assert_kind_of(String, str)
|
128
|
+
check_pubmed_entry(pmid, str)
|
129
|
+
end
|
130
|
+
|
131
|
+
def test_query_single_str
|
132
|
+
pmid = "20739307"
|
133
|
+
str = @pm.query(pmid)
|
134
|
+
assert_kind_of(String, str)
|
135
|
+
check_pubmed_entry(pmid, str)
|
136
|
+
end
|
137
|
+
|
138
|
+
def test_query_multiple
|
139
|
+
arg = [ "16734914", 16381885, "10592173" ]
|
140
|
+
str = @pm.query(*arg)
|
141
|
+
assert_kind_of(String, str)
|
142
|
+
str.split(/\n\n/).each do |s|
|
143
|
+
check_pubmed_entry(arg.shift, s)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
def test_pmfetch
|
148
|
+
pmid = 20739307
|
149
|
+
str = @pm.pmfetch(pmid)
|
150
|
+
assert_kind_of(String, str)
|
151
|
+
check_pubmed_entry(pmid, str)
|
152
|
+
end
|
153
|
+
|
154
|
+
def test_pmfetch_str
|
155
|
+
pmid = "20739307"
|
156
|
+
str = @pm.pmfetch(pmid)
|
157
|
+
assert_kind_of(String, str)
|
158
|
+
check_pubmed_entry(pmid, str)
|
159
|
+
end
|
111
160
|
end #module FuncTestPubmedCommon
|
112
161
|
|
113
162
|
class FuncTestPubmed < Test::Unit::TestCase
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# test/network/bio/test_command.rb - Functional test for network connection methods in Bio::Command
|
3
3
|
#
|
4
|
-
# Copyright:: Copyright (C) 2008, 2011
|
4
|
+
# Copyright:: Copyright (C) 2008, 2011, 2015
|
5
5
|
# Naohisa Goto <ng@bioruby.org>
|
6
6
|
# License:: The Ruby License
|
7
7
|
#
|
@@ -17,19 +17,82 @@ require 'bio/command'
|
|
17
17
|
|
18
18
|
module Bio
|
19
19
|
class FuncTestCommandNet < Test::Unit::TestCase
|
20
|
+
def setup
|
21
|
+
@host = "bioruby.open-bio.org"
|
22
|
+
@port = 80
|
23
|
+
@path = "/"
|
24
|
+
@url = "http://bioruby.open-bio.org:80/"
|
25
|
+
end
|
26
|
+
|
20
27
|
def test_read_uri
|
28
|
+
str = nil
|
21
29
|
assert_nothing_raised {
|
22
|
-
Bio::Command.read_uri(
|
30
|
+
str = Bio::Command.read_uri(@url)
|
23
31
|
}
|
32
|
+
assert(!str.to_s.empty?)
|
24
33
|
end
|
25
34
|
|
26
35
|
def test_start_http
|
36
|
+
ht = Bio::Command.start_http(@host, @port)
|
37
|
+
assert_kind_of(Net::HTTP, ht)
|
38
|
+
res = ht.get(@path)
|
39
|
+
assert_kind_of(Net::HTTPResponse, res)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_start_http_with_block
|
43
|
+
res = Bio::Command.start_http(@host, @port) do |ht|
|
44
|
+
assert_kind_of(Net::HTTP, ht)
|
45
|
+
ht.get(@path)
|
46
|
+
end
|
47
|
+
assert_kind_of(Net::HTTPResponse, res)
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_start_http_default_port
|
51
|
+
ht = Bio::Command.start_http(@host)
|
52
|
+
assert_kind_of(Net::HTTP, ht)
|
53
|
+
res = ht.get(@path)
|
54
|
+
assert_kind_of(Net::HTTPResponse, res)
|
27
55
|
end
|
28
56
|
|
29
57
|
def test_new_http
|
58
|
+
ht = Bio::Command.new_http(@host, @port)
|
59
|
+
assert_kind_of(Net::HTTP, ht)
|
60
|
+
res = ht.get(@path)
|
61
|
+
assert_kind_of(Net::HTTPResponse, res)
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_new_http_default_port
|
65
|
+
ht = Bio::Command.new_http(@host)
|
66
|
+
assert_kind_of(Net::HTTP, ht)
|
67
|
+
res = ht.get(@path)
|
68
|
+
assert_kind_of(Net::HTTPResponse, res)
|
30
69
|
end
|
31
70
|
|
32
71
|
def test_post_form
|
72
|
+
res = Bio::Command.post_form(@url, { 'test' => 'bioruby' })
|
73
|
+
assert_kind_of(Net::HTTPResponse, res)
|
33
74
|
end
|
75
|
+
|
76
|
+
def test_http_post_form
|
77
|
+
ht = Bio::Command.new_http(@host)
|
78
|
+
res = Bio::Command.http_post_form(ht, @path,
|
79
|
+
{ 'test' => 'bioruby' },
|
80
|
+
{ 'Content-Language' => 'en' })
|
81
|
+
assert_kind_of(Net::HTTPResponse, res)
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_post
|
85
|
+
res = Bio::Command.post(@url, "this is test\n" * 10)
|
86
|
+
assert_kind_of(Net::HTTPResponse, res)
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_http_post
|
90
|
+
ht = Bio::Command.new_http(@host)
|
91
|
+
res = Bio::Command.http_post(ht, @path,
|
92
|
+
"this is test\n" * 10,
|
93
|
+
{ 'Content-Language' => 'en' })
|
94
|
+
assert_kind_of(Net::HTTPResponse, res)
|
95
|
+
end
|
96
|
+
|
34
97
|
end #class FuncTestCommandNet
|
35
98
|
end
|
@@ -62,7 +62,7 @@ module Bio
|
|
62
62
|
end
|
63
63
|
end #module TestBlastReportHelper
|
64
64
|
|
65
|
-
|
65
|
+
module TemplateTestBlastReport
|
66
66
|
include TestBlastReportHelper
|
67
67
|
|
68
68
|
def setup
|
@@ -90,9 +90,7 @@ module Bio
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def test_reference
|
93
|
-
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."
|
94
93
|
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.'
|
95
|
-
# assert_equal(xml_quoted_str, @report.reference)
|
96
94
|
assert_equal(text_str, @report.reference)
|
97
95
|
end
|
98
96
|
|
@@ -203,9 +201,10 @@ module Bio
|
|
203
201
|
def test_message
|
204
202
|
assert_equal(nil, @report.message)
|
205
203
|
end
|
206
|
-
end
|
207
|
-
|
208
|
-
|
204
|
+
end #module TemplateTestBlastReport
|
205
|
+
|
206
|
+
|
207
|
+
module TemplateTestBlastReportIteration
|
209
208
|
include TestBlastReportHelper
|
210
209
|
|
211
210
|
def setup
|
@@ -231,9 +230,10 @@ module Bio
|
|
231
230
|
def test_message
|
232
231
|
assert_equal(nil, @itr.message)
|
233
232
|
end
|
234
|
-
end
|
233
|
+
end #module TemplateTestBlastReportIteration
|
235
234
|
|
236
|
-
|
235
|
+
|
236
|
+
module TemplateTestBlastReportHit
|
237
237
|
include TestBlastReportHelper
|
238
238
|
|
239
239
|
def setup
|
@@ -343,9 +343,10 @@ module Bio
|
|
343
343
|
def test_Hit_lap_at
|
344
344
|
assert_equal([1, 820, 1, 820], @hit.lap_at)
|
345
345
|
end
|
346
|
-
end
|
346
|
+
end #module TemplateTestBlastReportHit
|
347
347
|
|
348
|
-
|
348
|
+
|
349
|
+
module TemplateTestBlastReportHsp
|
349
350
|
include TestBlastReportHelper
|
350
351
|
|
351
352
|
def setup
|
@@ -444,37 +445,63 @@ module Bio
|
|
444
445
|
assert_nothing_raised { @hsp.mismatch_count }
|
445
446
|
end
|
446
447
|
|
447
|
-
end
|
448
|
+
end #module TestBlastReportHsp
|
449
|
+
|
450
|
+
class TestBlastReport < Test::Unit::TestCase
|
451
|
+
include TemplateTestBlastReport
|
452
|
+
end
|
453
|
+
|
454
|
+
class TestBlastReportIteration < Test::Unit::TestCase
|
455
|
+
include TemplateTestBlastReportIteration
|
456
|
+
end
|
448
457
|
|
449
|
-
class
|
458
|
+
class TestBlastReportHit < Test::Unit::TestCase
|
459
|
+
include TemplateTestBlastReportHit
|
450
460
|
end
|
451
461
|
|
452
|
-
class
|
462
|
+
class TestBlastReportHsp < Test::Unit::TestCase
|
463
|
+
include TemplateTestBlastReportHsp
|
453
464
|
end
|
454
465
|
|
455
|
-
class
|
466
|
+
class TestBlastReportREXML < Test::Unit::TestCase
|
467
|
+
include TemplateTestBlastReport
|
456
468
|
end
|
457
469
|
|
458
|
-
class
|
470
|
+
class TestBlastReportIterationREXML < Test::Unit::TestCase
|
471
|
+
include TemplateTestBlastReportIteration
|
472
|
+
end
|
473
|
+
|
474
|
+
class TestBlastReportHitREXML < Test::Unit::TestCase
|
475
|
+
include TemplateTestBlastReportHit
|
476
|
+
end
|
477
|
+
|
478
|
+
class TestBlastReportHspREXML < Test::Unit::TestCase
|
479
|
+
include TemplateTestBlastReportHsp
|
459
480
|
end
|
460
481
|
|
461
482
|
if defined? XMLParser then
|
462
483
|
|
463
|
-
class TestBlastReportXMLParser <
|
484
|
+
class TestBlastReportXMLParser < Test::Unit::TestCase
|
485
|
+
include TemplateTestBlastReport
|
464
486
|
end
|
465
487
|
|
466
|
-
class TestBlastReportIterationXMLParser <
|
488
|
+
class TestBlastReportIterationXMLParser < Test::Unit::TestCase
|
489
|
+
include TemplateTestBlastReportIteration
|
467
490
|
end
|
468
491
|
|
469
|
-
class TestBlastReportHitXMLParser <
|
492
|
+
class TestBlastReportHitXMLParser < Test::Unit::TestCase
|
493
|
+
include TemplateTestBlastReportHit
|
470
494
|
end
|
471
495
|
|
472
|
-
class TestBlastReportHspXMLParser <
|
496
|
+
class TestBlastReportHspXMLParser < Test::Unit::TestCase
|
497
|
+
include TemplateTestBlastReportHsp
|
473
498
|
end
|
474
499
|
|
475
500
|
end #if defined? XMLParser
|
476
501
|
|
477
|
-
class TestBlastReportDefault <
|
502
|
+
class TestBlastReportDefault < Test::Unit::TestCase
|
503
|
+
include TemplateTestBlastReport
|
504
|
+
|
478
505
|
undef test_entrez_query
|
479
506
|
undef test_filter
|
480
507
|
undef test_hsp_len
|
@@ -519,13 +546,16 @@ module Bio
|
|
519
546
|
def test_gapped_entropy
|
520
547
|
assert_equal(0.140, @report.gapped_entropy)
|
521
548
|
end
|
522
|
-
end
|
549
|
+
end #class TestBlastReportDefault
|
523
550
|
|
524
|
-
class TestBlastReportIterationDefault <
|
551
|
+
class TestBlastReportIterationDefault < Test::Unit::TestCase
|
552
|
+
include TemplateTestBlastReportIteration
|
525
553
|
undef test_statistics
|
526
554
|
end
|
527
555
|
|
528
|
-
class TestBlastReportHitDefault <
|
556
|
+
class TestBlastReportHitDefault < Test::Unit::TestCase
|
557
|
+
include TemplateTestBlastReportHit
|
558
|
+
|
529
559
|
undef test_Hit_accession
|
530
560
|
undef test_Hit_hit_id
|
531
561
|
undef test_Hit_num
|
@@ -560,9 +590,11 @@ module Bio
|
|
560
590
|
seq = @filtered_query_sequence.gsub(/x/, 'X')
|
561
591
|
assert_equal(seq, @hit.query_seq)
|
562
592
|
end
|
563
|
-
end
|
593
|
+
end #class TestBlastReportHitDefault
|
594
|
+
|
595
|
+
class TestBlastReportHspDefault < Test::Unit::TestCase
|
596
|
+
include TemplateTestBlastReportHsp
|
564
597
|
|
565
|
-
class TestBlastReportHspDefault < TestBlastReportHsp
|
566
598
|
undef test_Hsp_density
|
567
599
|
undef test_Hsp_mismatch_count
|
568
600
|
undef test_Hsp_num
|
@@ -612,7 +644,8 @@ module Bio
|
|
612
644
|
# differs from XML because not available in the default BLASTP format
|
613
645
|
assert_equal(nil, @hsp.query_frame)
|
614
646
|
end
|
615
|
-
end
|
647
|
+
end #class TestBlastReportHspDefault
|
648
|
+
|
616
649
|
|
617
650
|
module TestBlastReportTabularHelper
|
618
651
|
def def_test_assert_nil(test_method)
|
@@ -634,10 +667,11 @@ module Bio
|
|
634
667
|
assert_nil(instance_variable_get(instance).__send__(method))
|
635
668
|
end
|
636
669
|
end
|
637
|
-
end #module
|
670
|
+
end #module TestBlastReportTabularHelper
|
638
671
|
|
639
|
-
class TestBlastReportTabular <
|
672
|
+
class TestBlastReportTabular < Test::Unit::TestCase
|
640
673
|
extend TestBlastReportTabularHelper
|
674
|
+
include TemplateTestBlastReport
|
641
675
|
|
642
676
|
def_test_assert_nil :test_db
|
643
677
|
def_test_assert_nil :test_db_len
|
@@ -678,7 +712,8 @@ module Bio
|
|
678
712
|
end
|
679
713
|
end #class TestBlastReportTabular
|
680
714
|
|
681
|
-
class TestBlastReportIterationTabular <
|
715
|
+
class TestBlastReportIterationTabular < Test::Unit::TestCase
|
716
|
+
include TemplateTestBlastReportIteration
|
682
717
|
|
683
718
|
# No statistics information available in the "-m 8" format
|
684
719
|
def test_statistics
|
@@ -686,8 +721,9 @@ module Bio
|
|
686
721
|
end
|
687
722
|
end #class TestBlastReportIterationTabular
|
688
723
|
|
689
|
-
class TestBlastReportHitTabular <
|
724
|
+
class TestBlastReportHitTabular < Test::Unit::TestCase
|
690
725
|
extend TestBlastReportTabularHelper
|
726
|
+
include TemplateTestBlastReportHit
|
691
727
|
|
692
728
|
def_test_assert_nil :test_Hit_hit_id
|
693
729
|
def_test_assert_nil :test_Hit_identity
|
@@ -714,8 +750,9 @@ module Bio
|
|
714
750
|
end
|
715
751
|
end #class TestBlastReportHitTabular
|
716
752
|
|
717
|
-
class TestBlastReportHspTabular <
|
753
|
+
class TestBlastReportHspTabular < Test::Unit::TestCase
|
718
754
|
extend TestBlastReportTabularHelper
|
755
|
+
include TemplateTestBlastReportHsp
|
719
756
|
|
720
757
|
def_test_assert_nil :test_Hsp_density
|
721
758
|
def_test_assert_nil :test_Hsp_hit_frame
|
@@ -738,7 +775,7 @@ module Bio
|
|
738
775
|
# with the result of multiple query sequences
|
739
776
|
########################################################################
|
740
777
|
|
741
|
-
|
778
|
+
module TemplateTestBlastReportMulti
|
742
779
|
include TestBlastReportHelper
|
743
780
|
|
744
781
|
def setup
|
@@ -955,9 +992,9 @@ module Bio
|
|
955
992
|
assert_equal(nil, r.message)
|
956
993
|
end
|
957
994
|
end
|
958
|
-
end
|
959
|
-
|
960
|
-
|
995
|
+
end #module TemplateTestBlastReportMulti
|
996
|
+
|
997
|
+
module TemplateTestBlastReportIterationMulti
|
961
998
|
include TestBlastReportHelper
|
962
999
|
|
963
1000
|
def setup
|
@@ -1005,9 +1042,9 @@ module Bio
|
|
1005
1042
|
def test_message
|
1006
1043
|
assert_equal(nil, @itr.message)
|
1007
1044
|
end
|
1008
|
-
end
|
1045
|
+
end #module TemplateTestBlastReportIterationMulti
|
1009
1046
|
|
1010
|
-
|
1047
|
+
module TemplateTestBlastReportHitMulti
|
1011
1048
|
include TestBlastReportHelper
|
1012
1049
|
|
1013
1050
|
def setup
|
@@ -1119,9 +1156,9 @@ module Bio
|
|
1119
1156
|
def test_Hit_lap_at
|
1120
1157
|
assert_equal([190, 311, 569, 668], @hit.lap_at)
|
1121
1158
|
end
|
1122
|
-
end
|
1159
|
+
end #module TemplateTestBlastReportHitMulti
|
1123
1160
|
|
1124
|
-
|
1161
|
+
module TemplateTestBlastReportHspMulti
|
1125
1162
|
include TestBlastReportHelper
|
1126
1163
|
|
1127
1164
|
def setup
|
@@ -1220,34 +1257,59 @@ module Bio
|
|
1220
1257
|
assert_nothing_raised { @hsp.mismatch_count }
|
1221
1258
|
end
|
1222
1259
|
|
1223
|
-
end
|
1260
|
+
end #module TemplateTestBlastReportHspMulti
|
1261
|
+
|
1262
|
+
|
1263
|
+
class TestBlastReportMulti < Test::Unit::TestCase
|
1264
|
+
include TemplateTestBlastReportMulti
|
1265
|
+
end
|
1266
|
+
|
1267
|
+
class TestBlastReportIterationMulti < Test::Unit::TestCase
|
1268
|
+
include TemplateTestBlastReportIterationMulti
|
1269
|
+
end
|
1270
|
+
|
1271
|
+
class TestBlastReportHitMulti < Test::Unit::TestCase
|
1272
|
+
include TemplateTestBlastReportHitMulti
|
1273
|
+
end
|
1274
|
+
|
1275
|
+
class TestBlastReportHspMulti < Test::Unit::TestCase
|
1276
|
+
include TemplateTestBlastReportHspMulti
|
1277
|
+
end
|
1224
1278
|
|
1225
1279
|
# Tests for REXML version
|
1226
|
-
class TestBlastReportMultiREXML <
|
1280
|
+
class TestBlastReportMultiREXML < Test::Unit::TestCase
|
1281
|
+
include TemplateTestBlastReportMulti
|
1227
1282
|
end
|
1228
1283
|
|
1229
|
-
class TestBlastReportIterationMultiREXML <
|
1284
|
+
class TestBlastReportIterationMultiREXML < Test::Unit::TestCase
|
1285
|
+
include TemplateTestBlastReportIterationMulti
|
1230
1286
|
end
|
1231
1287
|
|
1232
|
-
class TestBlastReportHitMultiREXML <
|
1288
|
+
class TestBlastReportHitMultiREXML < Test::Unit::TestCase
|
1289
|
+
include TemplateTestBlastReportHitMulti
|
1233
1290
|
end
|
1234
1291
|
|
1235
|
-
class TestBlastReportHspMultiREXML <
|
1292
|
+
class TestBlastReportHspMultiREXML < Test::Unit::TestCase
|
1293
|
+
include TemplateTestBlastReportHspMulti
|
1236
1294
|
end
|
1237
1295
|
|
1238
1296
|
# Tests for XMLParser version
|
1239
1297
|
if defined? XMLParser then
|
1240
1298
|
|
1241
|
-
class TestBlastReportMultiXMLParser <
|
1299
|
+
class TestBlastReportMultiXMLParser < Test::Unit::TestCase
|
1300
|
+
include TemplateTestBlastReportMulti
|
1242
1301
|
end
|
1243
1302
|
|
1244
|
-
class TestBlastReportIterationMultiXMLParser <
|
1303
|
+
class TestBlastReportIterationMultiXMLParser < Test::Unit::TestCase
|
1304
|
+
include TemplateTestBlastReportIterationMulti
|
1245
1305
|
end
|
1246
1306
|
|
1247
|
-
class TestBlastReportHitMultiXMLParser <
|
1307
|
+
class TestBlastReportHitMultiXMLParser < Test::Unit::TestCase
|
1308
|
+
include TemplateTestBlastReportHitMulti
|
1248
1309
|
end
|
1249
1310
|
|
1250
|
-
class TestBlastReportHspMultiXMLParser <
|
1311
|
+
class TestBlastReportHspMultiXMLParser < Test::Unit::TestCase
|
1312
|
+
include TemplateTestBlastReportHspMulti
|
1251
1313
|
end
|
1252
1314
|
|
1253
1315
|
end #if defined? XMLParser
|