bio 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3421 -0
- data/KNOWN_ISSUES.rdoc +88 -0
- data/README.rdoc +252 -0
- data/README_DEV.rdoc +285 -0
- data/Rakefile +143 -0
- data/bin/bioruby +0 -0
- data/bin/br_biofetch.rb +0 -0
- data/bin/br_bioflat.rb +12 -1
- data/bin/br_biogetseq.rb +0 -0
- data/bin/br_pmfetch.rb +4 -3
- data/bioruby.gemspec +477 -0
- data/bioruby.gemspec.erb +117 -0
- data/doc/Changes-0.7.rd +7 -0
- data/doc/Changes-1.3.rdoc +239 -0
- data/doc/Tutorial.rd +296 -184
- data/doc/Tutorial.rd.html +1031 -0
- data/doc/Tutorial.rd.ja +111 -45
- data/doc/Tutorial.rd.ja.html +2225 -0
- data/doc/bioruby.css +281 -0
- data/extconf.rb +2 -0
- data/lib/bio.rb +29 -4
- data/lib/bio/appl/blast.rb +306 -121
- data/lib/bio/appl/blast/ddbj.rb +142 -0
- data/lib/bio/appl/blast/format0.rb +35 -25
- data/lib/bio/appl/blast/format8.rb +2 -2
- data/lib/bio/appl/blast/genomenet.rb +263 -0
- data/lib/bio/appl/blast/ncbioptions.rb +220 -0
- data/lib/bio/appl/blast/remote.rb +106 -0
- data/lib/bio/appl/blast/report.rb +260 -9
- data/lib/bio/appl/blast/rexml.rb +12 -5
- data/lib/bio/appl/blast/rpsblast.rb +277 -0
- data/lib/bio/appl/blast/wublast.rb +133 -12
- data/lib/bio/appl/blast/xmlparser.rb +35 -18
- data/lib/bio/appl/blat/report.rb +46 -5
- data/lib/bio/appl/emboss.rb +62 -13
- data/lib/bio/appl/fasta.rb +9 -11
- data/lib/bio/appl/genscan/report.rb +3 -3
- data/lib/bio/appl/hmmer.rb +1 -1
- data/lib/bio/appl/hmmer/report.rb +10 -10
- data/lib/bio/appl/paml/baseml.rb +95 -0
- data/lib/bio/appl/paml/baseml/report.rb +32 -0
- data/lib/bio/appl/paml/codeml.rb +242 -0
- data/lib/bio/appl/paml/codeml/rates.rb +67 -0
- data/lib/bio/appl/paml/codeml/report.rb +67 -0
- data/lib/bio/appl/paml/common.rb +348 -0
- data/lib/bio/appl/paml/common_report.rb +38 -0
- data/lib/bio/appl/paml/yn00.rb +103 -0
- data/lib/bio/appl/paml/yn00/report.rb +32 -0
- data/lib/bio/appl/psort.rb +2 -2
- data/lib/bio/appl/pts1.rb +5 -5
- data/lib/bio/appl/tmhmm/report.rb +10 -1
- data/lib/bio/command.rb +297 -41
- data/lib/bio/compat/features.rb +157 -0
- data/lib/bio/compat/references.rb +128 -0
- data/lib/bio/db/biosql/biosql_to_biosequence.rb +67 -0
- data/lib/bio/db/biosql/sequence.rb +508 -0
- data/lib/bio/db/embl/common.rb +28 -12
- data/lib/bio/db/embl/embl.rb +107 -9
- data/lib/bio/db/embl/embl_to_biosequence.rb +85 -0
- data/lib/bio/db/embl/format_embl.rb +190 -0
- data/lib/bio/db/embl/sptr.rb +15 -16
- data/lib/bio/db/fantom.rb +6 -8
- data/lib/bio/db/fasta.rb +10 -507
- data/lib/bio/db/fasta/defline.rb +532 -0
- data/lib/bio/db/fasta/fasta_to_biosequence.rb +63 -0
- data/lib/bio/db/fasta/format_fasta.rb +97 -0
- data/lib/bio/db/genbank/common.rb +25 -8
- data/lib/bio/db/genbank/format_genbank.rb +187 -0
- data/lib/bio/db/genbank/genbank.rb +36 -1
- data/lib/bio/db/genbank/genbank_to_biosequence.rb +86 -0
- data/lib/bio/db/gff.rb +1791 -119
- data/lib/bio/db/kegg/glycan.rb +2 -6
- data/lib/bio/db/lasergene.rb +3 -3
- data/lib/bio/db/medline.rb +4 -1
- data/lib/bio/db/newick.rb +10 -10
- data/lib/bio/db/pdb/chain.rb +6 -2
- data/lib/bio/db/pdb/pdb.rb +12 -3
- data/lib/bio/db/rebase.rb +7 -8
- data/lib/bio/db/soft.rb +3 -3
- data/lib/bio/feature.rb +1 -88
- data/lib/bio/io/biosql/biodatabase.rb +64 -0
- data/lib/bio/io/biosql/bioentry.rb +29 -0
- data/lib/bio/io/biosql/bioentry_dbxref.rb +11 -0
- data/lib/bio/io/biosql/bioentry_path.rb +12 -0
- data/lib/bio/io/biosql/bioentry_qualifier_value.rb +10 -0
- data/lib/bio/io/biosql/bioentry_reference.rb +10 -0
- data/lib/bio/io/biosql/bioentry_relationship.rb +10 -0
- data/lib/bio/io/biosql/biosequence.rb +11 -0
- data/lib/bio/io/biosql/comment.rb +7 -0
- data/lib/bio/io/biosql/config/database.yml +20 -0
- data/lib/bio/io/biosql/dbxref.rb +13 -0
- data/lib/bio/io/biosql/dbxref_qualifier_value.rb +12 -0
- data/lib/bio/io/biosql/location.rb +32 -0
- data/lib/bio/io/biosql/location_qualifier_value.rb +11 -0
- data/lib/bio/io/biosql/ontology.rb +10 -0
- data/lib/bio/io/biosql/reference.rb +9 -0
- data/lib/bio/io/biosql/seqfeature.rb +32 -0
- data/lib/bio/io/biosql/seqfeature_dbxref.rb +11 -0
- data/lib/bio/io/biosql/seqfeature_path.rb +11 -0
- data/lib/bio/io/biosql/seqfeature_qualifier_value.rb +20 -0
- data/lib/bio/io/biosql/seqfeature_relationship.rb +11 -0
- data/lib/bio/io/biosql/taxon.rb +12 -0
- data/lib/bio/io/biosql/taxon_name.rb +9 -0
- data/lib/bio/io/biosql/term.rb +27 -0
- data/lib/bio/io/biosql/term_dbxref.rb +11 -0
- data/lib/bio/io/biosql/term_path.rb +12 -0
- data/lib/bio/io/biosql/term_relationship.rb +13 -0
- data/lib/bio/io/biosql/term_relationship_term.rb +11 -0
- data/lib/bio/io/biosql/term_synonym.rb +10 -0
- data/lib/bio/io/das.rb +7 -7
- data/lib/bio/io/ddbjxml.rb +57 -0
- data/lib/bio/io/ensembl.rb +2 -2
- data/lib/bio/io/fetch.rb +28 -14
- data/lib/bio/io/flatfile.rb +17 -853
- data/lib/bio/io/flatfile/autodetection.rb +545 -0
- data/lib/bio/io/flatfile/buffer.rb +237 -0
- data/lib/bio/io/flatfile/index.rb +17 -7
- data/lib/bio/io/flatfile/indexer.rb +30 -12
- data/lib/bio/io/flatfile/splitter.rb +297 -0
- data/lib/bio/io/hinv.rb +442 -0
- data/lib/bio/io/keggapi.rb +2 -2
- data/lib/bio/io/ncbirest.rb +733 -0
- data/lib/bio/io/pubmed.rb +34 -80
- data/lib/bio/io/registry.rb +2 -2
- data/lib/bio/io/sql.rb +178 -357
- data/lib/bio/io/togows.rb +458 -0
- data/lib/bio/location.rb +106 -11
- data/lib/bio/pathway.rb +120 -14
- data/lib/bio/reference.rb +115 -101
- data/lib/bio/sequence.rb +164 -183
- data/lib/bio/sequence/adapter.rb +108 -0
- data/lib/bio/sequence/common.rb +22 -45
- data/lib/bio/sequence/compat.rb +2 -2
- data/lib/bio/sequence/dblink.rb +54 -0
- data/lib/bio/sequence/format.rb +254 -77
- data/lib/bio/sequence/format_raw.rb +23 -0
- data/lib/bio/shell.rb +3 -1
- data/lib/bio/shell/core.rb +2 -2
- data/lib/bio/shell/plugin/entry.rb +33 -4
- data/lib/bio/shell/plugin/ncbirest.rb +64 -0
- data/lib/bio/shell/plugin/togows.rb +40 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/bioruby_generator.rb +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_classes.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_log.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_methods.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_modules.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_variables.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby-bg.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby-gem.png +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby-link.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby.css +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby_controller.rb +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby_helper.rb +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/commands.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/history.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/index.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/spinner.gif +0 -0
- data/lib/bio/tree.rb +4 -2
- data/lib/bio/util/color_scheme.rb +2 -2
- data/lib/bio/util/contingency_table.rb +2 -2
- data/lib/bio/util/restriction_enzyme.rb +2 -2
- data/lib/bio/util/restriction_enzyme/single_strand.rb +6 -5
- data/lib/bio/version.rb +25 -0
- data/rdoc.zsh +8 -0
- data/sample/any2fasta.rb +0 -0
- data/sample/biofetch.rb +0 -0
- data/sample/dbget +0 -0
- data/sample/demo_sequence.rb +158 -0
- data/sample/enzymes.rb +0 -0
- data/sample/fasta2tab.rb +0 -0
- data/sample/fastagrep.rb +72 -0
- data/sample/fastasort.rb +54 -0
- data/sample/fsplit.rb +0 -0
- data/sample/gb2fasta.rb +2 -3
- data/sample/gb2tab.rb +0 -0
- data/sample/gbtab2mysql.rb +0 -0
- data/sample/genes2nuc.rb +0 -0
- data/sample/genes2pep.rb +0 -0
- data/sample/genes2tab.rb +0 -0
- data/sample/genome2rb.rb +0 -0
- data/sample/genome2tab.rb +0 -0
- data/sample/goslim.rb +0 -0
- data/sample/gt2fasta.rb +0 -0
- data/sample/na2aa.rb +34 -0
- data/sample/pmfetch.rb +0 -0
- data/sample/pmsearch.rb +0 -0
- data/sample/ssearch2tab.rb +0 -0
- data/sample/tfastx2tab.rb +0 -0
- data/sample/vs-genes.rb +0 -0
- data/setup.rb +1596 -0
- data/test/data/blast/blastp-multi.m7 +188 -0
- data/test/data/command/echoarg2.bat +1 -0
- data/test/data/paml/codeml/control_file.txt +30 -0
- data/test/data/paml/codeml/output.txt +78 -0
- data/test/data/paml/codeml/rates +217 -0
- data/test/data/rpsblast/misc.rpsblast +193 -0
- data/test/data/soft/GDS100_partial.soft +0 -0
- data/test/data/soft/GSE3457_family_partial.soft +0 -0
- data/test/functional/bio/appl/test_pts1.rb +115 -0
- data/test/functional/bio/io/test_ensembl.rb +123 -80
- data/test/functional/bio/io/test_togows.rb +267 -0
- data/test/functional/bio/sequence/test_output_embl.rb +51 -0
- data/test/functional/bio/test_command.rb +301 -0
- data/test/runner.rb +17 -1
- data/test/unit/bio/appl/blast/test_ncbioptions.rb +112 -0
- data/test/unit/bio/appl/blast/test_report.rb +753 -35
- data/test/unit/bio/appl/blast/test_rpsblast.rb +398 -0
- data/test/unit/bio/appl/paml/codeml/test_rates.rb +45 -0
- data/test/unit/bio/appl/paml/codeml/test_report.rb +45 -0
- data/test/unit/bio/appl/paml/test_codeml.rb +174 -0
- data/test/unit/bio/appl/test_blast.rb +135 -4
- data/test/unit/bio/appl/test_fasta.rb +2 -2
- data/test/unit/bio/appl/test_pts1.rb +1 -64
- data/test/unit/bio/db/embl/test_common.rb +15 -15
- data/test/unit/bio/db/embl/test_embl.rb +4 -4
- data/test/unit/bio/db/embl/test_embl_rel89.rb +5 -5
- data/test/unit/bio/db/embl/test_embl_to_bioseq.rb +203 -0
- data/test/unit/bio/db/embl/test_sptr.rb +38 -1
- data/test/unit/bio/db/pdb/test_pdb.rb +2 -2
- data/test/unit/bio/db/test_gff.rb +1151 -25
- data/test/unit/bio/db/test_medline.rb +127 -0
- data/test/unit/bio/db/test_nexus.rb +5 -1
- data/test/unit/bio/db/test_prosite.rb +4 -4
- data/test/unit/bio/io/flatfile/test_autodetection.rb +375 -0
- data/test/unit/bio/io/flatfile/test_buffer.rb +251 -0
- data/test/unit/bio/io/flatfile/test_splitter.rb +369 -0
- data/test/unit/bio/io/test_ddbjxml.rb +8 -3
- data/test/unit/bio/io/test_fastacmd.rb +5 -5
- data/test/unit/bio/io/test_flatfile.rb +357 -106
- data/test/unit/bio/io/test_soapwsdl.rb +2 -2
- data/test/unit/bio/io/test_togows.rb +161 -0
- data/test/unit/bio/sequence/test_common.rb +210 -11
- data/test/unit/bio/sequence/test_compat.rb +3 -3
- data/test/unit/bio/sequence/test_dblink.rb +58 -0
- data/test/unit/bio/sequence/test_na.rb +2 -2
- data/test/unit/bio/test_command.rb +111 -50
- data/test/unit/bio/test_feature.rb +29 -1
- data/test/unit/bio/test_location.rb +566 -6
- data/test/unit/bio/test_pathway.rb +91 -65
- data/test/unit/bio/test_reference.rb +67 -13
- data/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb +4 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_analysis.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb +4 -4
- data/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_single_strand.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb +3 -3
- data/test/unit/bio/util/test_restriction_enzyme.rb +3 -3
- metadata +202 -167
- data/test/unit/bio/appl/blast/test_xmlparser.rb +0 -388
@@ -0,0 +1,174 @@
|
|
1
|
+
#
|
2
|
+
# test/unit/bio/appl/paml/test_codeml.rb - Unit test for Bio::PAML::Codeml
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2008 Michael D. Barton <mail@michaelbarton.me.uk>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
|
8
|
+
require 'pathname'
|
9
|
+
libpath = Pathname.new(File.join(File.join(File.dirname(__FILE__), ['..'] * 5, 'lib'))).cleanpath.to_s
|
10
|
+
$:.unshift(libpath) unless $:.include?(libpath)
|
11
|
+
|
12
|
+
require 'test/unit'
|
13
|
+
require 'bio/appl/paml/codeml'
|
14
|
+
|
15
|
+
module Bio; module TestPAMLCodeml
|
16
|
+
module TestCodemlData
|
17
|
+
|
18
|
+
bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5)).cleanpath.to_s
|
19
|
+
TEST_DATA = Pathname.new(File.join(bioruby_root, 'test', 'data', 'paml', 'codeml')).cleanpath.to_s
|
20
|
+
|
21
|
+
def self.example_control
|
22
|
+
File.join TEST_DATA, 'control_file.txt'
|
23
|
+
end
|
24
|
+
|
25
|
+
end #module TestCodemlData
|
26
|
+
|
27
|
+
class TestCodemlInitialize < Test::Unit::TestCase
|
28
|
+
|
29
|
+
def test_new_with_one_argument
|
30
|
+
factory = Bio::PAML::Codeml.new('echo')
|
31
|
+
assert_instance_of(Bio::PAML::Codeml, factory)
|
32
|
+
assert_equal('echo', factory.instance_eval { @program })
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_new_with_two_argument
|
36
|
+
factory = Bio::PAML::Codeml.new('echo', { :test => 'value' })
|
37
|
+
assert_instance_of(Bio::PAML::Codeml, factory)
|
38
|
+
assert_equal('echo', factory.instance_eval { @program })
|
39
|
+
assert_equal('value', factory.parameters[:test])
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_new_with_parameters
|
43
|
+
factory = Bio::PAML::Codeml.new(nil, { :test => 'value' })
|
44
|
+
assert_instance_of(Bio::PAML::Codeml, factory)
|
45
|
+
assert_equal('codeml', factory.instance_eval { @program })
|
46
|
+
assert_equal('value', factory.parameters[:test])
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_new_without_argument
|
50
|
+
factory = Bio::PAML::Codeml.new
|
51
|
+
assert_instance_of(Bio::PAML::Codeml, factory)
|
52
|
+
assert_equal('codeml', factory.instance_eval { @program })
|
53
|
+
end
|
54
|
+
|
55
|
+
end #class TestCodemlInitialize
|
56
|
+
|
57
|
+
class TestCodeml < Test::Unit::TestCase
|
58
|
+
def setup
|
59
|
+
@codeml = Bio::PAML::Codeml.new
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_parameters
|
63
|
+
params = { :verbose => 1 }
|
64
|
+
@codeml.parameters = params
|
65
|
+
assert_equal(params, @codeml.parameters)
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_load_parameters
|
69
|
+
str = " seqfile = test.aa \n verbose = 1 \n"
|
70
|
+
params = { :seqfile => 'test.aa', :verbose => '1' }
|
71
|
+
assert_equal(params, @codeml.load_parameters(str))
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_set_default_parameters
|
75
|
+
assert_equal(Bio::PAML::Codeml::DEFAULT_PARAMETERS,
|
76
|
+
@codeml.set_default_parameters)
|
77
|
+
# modifying parameters should not affect DEFAULT_PARAMETERS
|
78
|
+
@codeml.parameters[:only_for_test] = 'this is test'
|
79
|
+
assert_not_equal(Bio::PAML::Codeml::DEFAULT_PARAMETERS,
|
80
|
+
@codeml.parameters)
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_dump_parameters
|
84
|
+
params = { :seqfile => 'test.aa', :verbose => '1' }
|
85
|
+
@codeml.parameters = params
|
86
|
+
assert_equal("seqfile = test.aa\nverbose = 1\n",
|
87
|
+
@codeml.dump_parameters)
|
88
|
+
end
|
89
|
+
|
90
|
+
end #class TestCodeml
|
91
|
+
|
92
|
+
class TestCodemlControlGeneration < Test::Unit::TestCase
|
93
|
+
|
94
|
+
TEST_DATA = TestCodemlData::TEST_DATA
|
95
|
+
|
96
|
+
def generate_control_file
|
97
|
+
@tempfile_control = Tempfile.new('codeml_control')
|
98
|
+
@tempfile_control.close(false)
|
99
|
+
@tempfile_outfile = Tempfile.new('codeml_test')
|
100
|
+
@tempfile_outfile.close(false)
|
101
|
+
|
102
|
+
test_control = @tempfile_control.path
|
103
|
+
Bio::PAML::Codeml.create_control_file({
|
104
|
+
:model => 1,
|
105
|
+
:fix_kappa => 1,
|
106
|
+
:aaRatefile => File.join(TEST_DATA, 'wag.dat'),
|
107
|
+
:seqfile => File.join(TEST_DATA, 'abglobin.aa'),
|
108
|
+
:treefile => File.join(TEST_DATA, 'abglobin.trees'),
|
109
|
+
:outfile => @tempfile_outfile.path,
|
110
|
+
}, test_control)
|
111
|
+
test_control
|
112
|
+
end
|
113
|
+
private :generate_control_file
|
114
|
+
|
115
|
+
def setup
|
116
|
+
@example_control = generate_control_file
|
117
|
+
end
|
118
|
+
|
119
|
+
def teardown
|
120
|
+
@tempfile_control.close(true)
|
121
|
+
@tempfile_outfile.close(true)
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_control_file_generated
|
125
|
+
assert_not_nil(File.size?(@example_control))
|
126
|
+
end
|
127
|
+
|
128
|
+
def test_expected_parameters_set_in_control_file
|
129
|
+
produced_control = File.open(@example_control) do |f|
|
130
|
+
f.inject(Hash.new) do |hash,line|
|
131
|
+
hash.store(*line.strip.split(' = '))
|
132
|
+
hash
|
133
|
+
end
|
134
|
+
end
|
135
|
+
assert_equal(File.join(TEST_DATA, 'abglobin.aa'),
|
136
|
+
produced_control['seqfile'])
|
137
|
+
assert_equal('1', produced_control['fix_kappa'])
|
138
|
+
assert_equal('1', produced_control['model'])
|
139
|
+
end
|
140
|
+
end #class TestCodemlControlGeneration
|
141
|
+
|
142
|
+
class TestControlFileUsage < Test::Unit::TestCase
|
143
|
+
|
144
|
+
def setup
|
145
|
+
@codeml = Bio::PAML::Codeml.new
|
146
|
+
@codeml.load_parameters(File.read(TestCodemlData.example_control))
|
147
|
+
end
|
148
|
+
|
149
|
+
def test_parameters_should_be_loaded_from_control
|
150
|
+
assert_not_nil(@codeml.parameters)
|
151
|
+
end
|
152
|
+
|
153
|
+
def test_correct_parameters_should_be_loaded
|
154
|
+
assert_equal('abglobin.aa', @codeml.parameters[:seqfile])
|
155
|
+
assert_equal('1', @codeml.parameters[:fix_kappa])
|
156
|
+
assert_equal('1', @codeml.parameters[:model])
|
157
|
+
end
|
158
|
+
|
159
|
+
end #class TestControlFileUsage
|
160
|
+
|
161
|
+
class TestExpectedErrorsThrown < Test::Unit::TestCase
|
162
|
+
|
163
|
+
def test_error_thrown_if_seqfile_does_not_specified
|
164
|
+
codeml = Bio::PAML::Codeml.new('echo')
|
165
|
+
codeml.load_parameters(File.read(TestCodemlData.example_control))
|
166
|
+
codeml.parameters[:seqfile] = nil
|
167
|
+
assert_raises RuntimeError do
|
168
|
+
codeml.query_by_string()
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
end #class TestExpectedErrorsThrown
|
173
|
+
|
174
|
+
end; end #module TestPAMLCodeml; module Bio
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# Copyright:: Copyright (C) 2005 Mitsuteru Nakao <n@bioruby.org>
|
5
5
|
# License:: The Ruby License
|
6
6
|
#
|
7
|
-
# $Id
|
7
|
+
# $Id:$
|
8
8
|
#
|
9
9
|
|
10
10
|
require 'pathname'
|
@@ -81,6 +81,12 @@ module Bio
|
|
81
81
|
assert_equal('-m 7 -p T', @blast.option)
|
82
82
|
end
|
83
83
|
|
84
|
+
def test_option_set_m0
|
85
|
+
@blast.option = '-m 0'
|
86
|
+
assert_equal('-m 0', @blast.option)
|
87
|
+
end
|
88
|
+
|
89
|
+
|
84
90
|
def test_server
|
85
91
|
assert_equal(@server, @blast.server)
|
86
92
|
end
|
@@ -121,10 +127,135 @@ module Bio
|
|
121
127
|
# to be tested in test/functional/bio/test_blast.rb
|
122
128
|
end
|
123
129
|
|
124
|
-
def
|
125
|
-
Bio::Blast.
|
126
|
-
|
130
|
+
def test_blast_reports_xml
|
131
|
+
ret = Bio::Blast.reports_xml(TestBlastData.output)
|
132
|
+
assert_instance_of(Array, ret)
|
133
|
+
count = 0
|
134
|
+
ret.each do |report|
|
135
|
+
count += 1
|
136
|
+
assert_instance_of(Bio::Blast::Report, report)
|
137
|
+
end
|
138
|
+
assert_equal(1, count)
|
139
|
+
end
|
140
|
+
|
141
|
+
def test_blast_reports_xml_with_block
|
142
|
+
count = 0
|
143
|
+
Bio::Blast.reports_xml(TestBlastData.output) do |report|
|
144
|
+
count += 1
|
145
|
+
assert_instance_of(Bio::Blast::Report, report)
|
146
|
+
end
|
147
|
+
assert_equal(1, count)
|
148
|
+
end
|
149
|
+
|
150
|
+
def test_blast_reports_format0
|
151
|
+
ret = Bio::Blast.reports(TestBlastData.output('0'))
|
152
|
+
assert_instance_of(Array, ret)
|
153
|
+
count = 0
|
154
|
+
ret.each do |report|
|
155
|
+
count += 1
|
156
|
+
assert_instance_of(Bio::Blast::Default::Report, report)
|
157
|
+
end
|
158
|
+
assert_equal(1, count)
|
159
|
+
end
|
160
|
+
|
161
|
+
def test_blast_reports_format7
|
162
|
+
ret = Bio::Blast.reports(TestBlastData.output('7'))
|
163
|
+
assert_instance_of(Array, ret)
|
164
|
+
count = 0
|
165
|
+
ret.each do |report|
|
166
|
+
count += 1
|
167
|
+
assert_instance_of(Bio::Blast::Report, report)
|
168
|
+
end
|
169
|
+
assert_equal(1, count)
|
170
|
+
end
|
171
|
+
|
172
|
+
def test_blast_reports_format8
|
173
|
+
ret = Bio::Blast.reports(TestBlastData.output('8'))
|
174
|
+
assert_instance_of(Array, ret)
|
175
|
+
count = 0
|
176
|
+
ret.each do |report|
|
177
|
+
count += 1
|
178
|
+
assert_kind_of(Bio::Blast::Report, report)
|
127
179
|
end
|
180
|
+
assert_equal(1, count)
|
181
|
+
end
|
182
|
+
|
183
|
+
def test_blast_reports_format0_with_block
|
184
|
+
count = 0
|
185
|
+
Bio::Blast.reports(TestBlastData.output('0')) do |report|
|
186
|
+
count += 1
|
187
|
+
assert_instance_of(Bio::Blast::Default::Report, report)
|
188
|
+
end
|
189
|
+
assert_equal(1, count)
|
190
|
+
end
|
191
|
+
|
192
|
+
def test_blast_reports_format7_with_block
|
193
|
+
count = 0
|
194
|
+
Bio::Blast.reports(TestBlastData.output('7')) do |report|
|
195
|
+
count += 1
|
196
|
+
assert_instance_of(Bio::Blast::Report, report)
|
197
|
+
end
|
198
|
+
assert_equal(1, count)
|
199
|
+
end
|
200
|
+
|
201
|
+
def test_blast_reports_format8_with_block
|
202
|
+
count = 0
|
203
|
+
Bio::Blast.reports(TestBlastData.output('8')) do |report|
|
204
|
+
count += 1
|
205
|
+
assert_kind_of(Bio::Blast::Report, report)
|
206
|
+
end
|
207
|
+
assert_equal(1, count)
|
208
|
+
end
|
209
|
+
|
210
|
+
def test_blast_reports_format7_with_parser
|
211
|
+
ret = Bio::Blast.reports(TestBlastData.output('7'), :rexml)
|
212
|
+
assert_instance_of(Array, ret)
|
213
|
+
count = 0
|
214
|
+
ret.each do |report|
|
215
|
+
count += 1
|
216
|
+
assert_instance_of(Bio::Blast::Report, report)
|
217
|
+
end
|
218
|
+
assert_equal(1, count)
|
219
|
+
end
|
220
|
+
|
221
|
+
def test_blast_reports_format8_with_parser
|
222
|
+
ret = Bio::Blast.reports(TestBlastData.output('8'), :tab)
|
223
|
+
assert_instance_of(Array, ret)
|
224
|
+
count = 0
|
225
|
+
ret.each do |report|
|
226
|
+
count += 1
|
227
|
+
assert_kind_of(Bio::Blast::Report, report)
|
228
|
+
end
|
229
|
+
assert_equal(1, count)
|
230
|
+
end
|
231
|
+
|
232
|
+
def test_blast_reports_format7_with_parser_with_block
|
233
|
+
count = 0
|
234
|
+
Bio::Blast.reports(TestBlastData.output('7'), :rexml) do |report|
|
235
|
+
count += 1
|
236
|
+
assert_instance_of(Bio::Blast::Report, report)
|
237
|
+
end
|
238
|
+
assert_equal(1, count)
|
239
|
+
end
|
240
|
+
|
241
|
+
def test_blast_reports_format8_with_parser_with_block
|
242
|
+
count = 0
|
243
|
+
Bio::Blast.reports(TestBlastData.output('8'), :tab) do |report|
|
244
|
+
count += 1
|
245
|
+
assert_kind_of(Bio::Blast::Report, report)
|
246
|
+
end
|
247
|
+
assert_equal(1, count)
|
248
|
+
end
|
249
|
+
|
250
|
+
def test_make_command_line
|
251
|
+
@blast = Bio::Blast.new(@program, @db, '-m 7 -F F')
|
252
|
+
assert_equal(["blastall", "-p", "blastp", "-d", "test", "-m", "7", "-F", "F"],
|
253
|
+
@blast.instance_eval { make_command_line })
|
254
|
+
end
|
255
|
+
def test_make_command_line_2
|
256
|
+
@blast = Bio::Blast.new(@program, @db, '-m 0 -F F')
|
257
|
+
assert_equal(["blastall", "-p", "blastp", "-d", "test", "-m", "0", "-F", "F"],
|
258
|
+
@blast.instance_eval { make_command_line })
|
128
259
|
end
|
129
260
|
|
130
261
|
def test_parse_result
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Mitsuteru C. Nakao <n@bioruby.org>
|
6
6
|
# License:: The Ruby License
|
7
7
|
#
|
8
|
-
# $Id
|
8
|
+
# $Id:$
|
9
9
|
#
|
10
10
|
|
11
11
|
require 'pathname'
|
@@ -94,7 +94,7 @@ module Bio
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def test_option
|
97
|
-
option = ['-M'].
|
97
|
+
option = ['-M'].join(' ')
|
98
98
|
assert(@obj.option = option)
|
99
99
|
assert_equal(option, @obj.option)
|
100
100
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Mitsuteru Nakao <n@bioruby.org>
|
6
6
|
# License:: The Ruby License
|
7
7
|
#
|
8
|
-
# $Id
|
8
|
+
# $Id:$
|
9
9
|
#
|
10
10
|
|
11
11
|
require 'pathname'
|
@@ -46,12 +46,6 @@ module Bio
|
|
46
46
|
class TestPTS1 < Test::Unit::TestCase
|
47
47
|
|
48
48
|
def setup
|
49
|
-
@seq =<<END
|
50
|
-
>AB000464
|
51
|
-
MRTGGDNAGPSHSHIKRLPTSGLSTWLQGTQTCVLHLPTGTRPPAHHPLLGYSSRRSYRL
|
52
|
-
LENPAAGCWARFSFCQGAAWDWDLEGVQWLRALAGGVSTAPSAPPGNLVFLSVSIFLCGS
|
53
|
-
LLLETCPAYFSSLDPD*
|
54
|
-
END
|
55
49
|
@serv = Bio::PTS1.new
|
56
50
|
end
|
57
51
|
|
@@ -79,62 +73,5 @@ END
|
|
79
73
|
@serv.function(3)
|
80
74
|
assert_equal("GENERAL", @serv.function)
|
81
75
|
end
|
82
|
-
|
83
|
-
|
84
|
-
def test_exec
|
85
|
-
report = @serv.exec(@seq)
|
86
|
-
assert_equal(Bio::PTS1::Report, report.class)
|
87
|
-
end
|
88
|
-
|
89
|
-
def test_exec_with_faa
|
90
|
-
report = @serv.exec(Bio::FastaFormat.new(@seq))
|
91
|
-
assert_equal(Bio::PTS1::Report, report.class)
|
92
|
-
end
|
93
|
-
|
94
|
-
end
|
95
|
-
|
96
|
-
class TestPTS1Report < Test::Unit::TestCase
|
97
|
-
def setup
|
98
|
-
serv = Bio::PTS1.new
|
99
|
-
seq = ">hoge\nAVSFLSMRRARL\n"
|
100
|
-
@report = serv.exec(seq)
|
101
|
-
end
|
102
|
-
|
103
|
-
|
104
|
-
def test_output_size
|
105
|
-
assert_equal(1634, @report.output.size)
|
106
|
-
end
|
107
|
-
|
108
|
-
def test_entry_id
|
109
|
-
assert_equal("hoge", @report.entry_id)
|
110
|
-
end
|
111
|
-
|
112
|
-
def test_prediction
|
113
|
-
assert_equal("Targeted", @report.prediction)
|
114
|
-
end
|
115
|
-
|
116
|
-
def test_cterm
|
117
|
-
assert_equal("AVSFLSMRRARL", @report.cterm)
|
118
|
-
end
|
119
|
-
|
120
|
-
def test_score
|
121
|
-
assert_equal("7.559", @report.score)
|
122
|
-
end
|
123
|
-
|
124
|
-
def test_fp
|
125
|
-
assert_equal("2.5e-04", @report.fp)
|
126
|
-
end
|
127
|
-
|
128
|
-
def test_sppta
|
129
|
-
assert_equal("-5.833", @report.sppta)
|
130
|
-
end
|
131
|
-
|
132
|
-
def test_spptna
|
133
|
-
assert_equal("-1.698", @report.spptna)
|
134
|
-
end
|
135
|
-
|
136
|
-
def test_profile
|
137
|
-
assert_equal("15.091", @report.profile)
|
138
|
-
end
|
139
76
|
end
|
140
77
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# Copyright:: Copyright (C) 2005 Mitsuteru Nakao <n@bioruby.org>
|
5
5
|
# License:: The Ruby License
|
6
6
|
#
|
7
|
-
# $Id
|
7
|
+
# $Id:$
|
8
8
|
#
|
9
9
|
|
10
10
|
require 'pathname'
|
@@ -30,59 +30,59 @@ module Bio
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_ac
|
33
|
-
assert(@obj.instance_methods.find {|x| x == 'ac' })
|
33
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'ac' })
|
34
34
|
end
|
35
35
|
|
36
36
|
def test_accessions
|
37
|
-
assert(@obj.instance_methods.find {|x| x == 'accessions' })
|
37
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'accessions' })
|
38
38
|
end
|
39
39
|
|
40
40
|
def test_accession
|
41
|
-
assert(@obj.instance_methods.find {|x| x == 'accession' })
|
41
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'accession' })
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_de
|
45
|
-
assert(@obj.instance_methods.find {|x| x == 'de' })
|
45
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'de' })
|
46
46
|
end
|
47
47
|
|
48
48
|
def test_description
|
49
|
-
assert(@obj.instance_methods.find {|x| x == 'description' })
|
49
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'description' })
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_definition
|
53
|
-
assert(@obj.instance_methods.find {|x| x == 'definition' })
|
53
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'definition' })
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_os
|
57
|
-
assert(@obj.instance_methods.find {|x| x == 'os' })
|
57
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'os' })
|
58
58
|
end
|
59
59
|
|
60
60
|
def test_og
|
61
|
-
assert(@obj.instance_methods.find {|x| x == 'og' })
|
61
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'og' })
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_oc
|
65
|
-
assert(@obj.instance_methods.find {|x| x == 'oc' })
|
65
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'oc' })
|
66
66
|
end
|
67
67
|
|
68
68
|
def test_kw
|
69
|
-
assert(@obj.instance_methods.find {|x| x == 'kw' })
|
69
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'kw' })
|
70
70
|
end
|
71
71
|
|
72
72
|
def test_keywords
|
73
|
-
assert(@obj.instance_methods.find {|x| x == 'keywords' })
|
73
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'keywords' })
|
74
74
|
end
|
75
75
|
|
76
76
|
def test_ref
|
77
|
-
assert(@obj.instance_methods.find {|x| x == 'ref' })
|
77
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'ref' })
|
78
78
|
end
|
79
79
|
|
80
80
|
def test_references
|
81
|
-
assert(@obj.instance_methods.find {|x| x == 'references' })
|
81
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'references' })
|
82
82
|
end
|
83
83
|
|
84
84
|
def test_dr
|
85
|
-
assert(@obj.instance_methods.find {|x| x == 'dr' })
|
85
|
+
assert(@obj.instance_methods.find {|x| x.to_s == 'dr' })
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|