bio 1.4.3.0001 → 1.5.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.
- 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/lib/bio.rb
CHANGED
@@ -73,24 +73,26 @@ module Bio
|
|
73
73
|
autoload :KEGGDB, 'bio/db'
|
74
74
|
autoload :EMBLDB, 'bio/db'
|
75
75
|
|
76
|
-
## GenBank
|
76
|
+
## GenBank, GenPept
|
77
77
|
|
78
78
|
autoload :GenBank, 'bio/db/genbank/genbank'
|
79
79
|
autoload :GenPept, 'bio/db/genbank/genpept'
|
80
|
+
|
81
|
+
## (deprecated) Bio::RefSeq, Bio::DDBJ
|
80
82
|
autoload :RefSeq, 'bio/db/genbank/refseq'
|
81
83
|
autoload :DDBJ, 'bio/db/genbank/ddbj'
|
82
|
-
## below are described in bio/db/genbank/ddbj.rb
|
83
|
-
#class DDBJ
|
84
|
-
# autoload :XML, 'bio/io/ddbjxml'
|
85
|
-
# autoload :REST, 'bio/io/ddbjrest'
|
86
|
-
#end
|
87
84
|
|
88
|
-
## EMBL
|
85
|
+
## EMBL, UniProtKB
|
89
86
|
|
90
87
|
autoload :EMBL, 'bio/db/embl/embl'
|
88
|
+
autoload :UniProtKB, 'bio/db/embl/uniprotkb'
|
89
|
+
|
90
|
+
## aliases of Bio::UniProtKB
|
91
91
|
autoload :SPTR, 'bio/db/embl/sptr'
|
92
|
-
autoload :TrEMBL, 'bio/db/embl/trembl'
|
93
92
|
autoload :UniProt, 'bio/db/embl/uniprot'
|
93
|
+
|
94
|
+
## (deprecated) Bio::TrEMBL, Bio::SwissProt
|
95
|
+
autoload :TrEMBL, 'bio/db/embl/trembl'
|
94
96
|
autoload :SwissProt, 'bio/db/embl/swissprot'
|
95
97
|
|
96
98
|
## KEGG
|
@@ -110,7 +112,6 @@ module Bio
|
|
110
112
|
autoload :KGML, 'bio/db/kegg/kgml'
|
111
113
|
autoload :PATHWAY, 'bio/db/kegg/pathway'
|
112
114
|
autoload :MODULE, 'bio/db/kegg/module'
|
113
|
-
autoload :Taxonomy, 'bio/db/kegg/taxonomy'
|
114
115
|
end
|
115
116
|
|
116
117
|
## other formats
|
@@ -155,7 +156,6 @@ module Bio
|
|
155
156
|
autoload :Registry, 'bio/io/registry'
|
156
157
|
autoload :Fetch, 'bio/io/fetch'
|
157
158
|
autoload :SQL, 'bio/io/sql'
|
158
|
-
autoload :SOAPWSDL, 'bio/io/soapwsdl'
|
159
159
|
autoload :FlatFile, 'bio/io/flatfile'
|
160
160
|
autoload :FlatFileIndex, 'bio/io/flatfile/index' # chage to FlatFile::Index ?
|
161
161
|
## below are described in bio/io/flatfile/index.rb
|
@@ -168,9 +168,7 @@ module Bio
|
|
168
168
|
|
169
169
|
autoload :PubMed, 'bio/io/pubmed'
|
170
170
|
autoload :DAS, 'bio/io/das'
|
171
|
-
autoload :DBGET, 'bio/io/dbget'
|
172
171
|
|
173
|
-
autoload :Ensembl, 'bio/io/ensembl'
|
174
172
|
autoload :Hinv, 'bio/io/hinv'
|
175
173
|
|
176
174
|
## below are described in bio/appl/blast.rb
|
@@ -178,27 +176,9 @@ module Bio
|
|
178
176
|
# autoload :Fastacmd, 'bio/io/fastacmd'
|
179
177
|
#end
|
180
178
|
|
181
|
-
class KEGG
|
182
|
-
autoload :API, 'bio/io/keggapi'
|
183
|
-
end
|
184
|
-
|
185
|
-
## below are described in bio/db/genbank/ddbj.rb
|
186
|
-
#class DDBJ
|
187
|
-
# autoload :XML, 'bio/io/ddbjxml'
|
188
|
-
#end
|
189
|
-
|
190
|
-
class HGC
|
191
|
-
autoload :HiGet, 'bio/io/higet'
|
192
|
-
end
|
193
|
-
|
194
|
-
class EBI
|
195
|
-
autoload :SOAP, 'bio/io/ebisoap'
|
196
|
-
end
|
197
|
-
|
198
179
|
autoload :NCBI, 'bio/io/ncbirest'
|
199
180
|
## below are described in bio/io/ncbirest.rb
|
200
181
|
#class NCBI
|
201
|
-
# autoload :SOAP, 'bio/io/ncbisoap'
|
202
182
|
# autoload :REST, 'bio/io/ncbirest'
|
203
183
|
#end
|
204
184
|
|
@@ -304,18 +284,5 @@ module Bio
|
|
304
284
|
### Service libraries
|
305
285
|
autoload :Command, 'bio/command'
|
306
286
|
|
307
|
-
### Provide BioRuby shell 'command' also as 'Bio.command' (like ChemRuby)
|
308
|
-
|
309
|
-
def self.method_missing(*args)
|
310
|
-
require 'bio/shell'
|
311
|
-
extend Bio::Shell
|
312
|
-
public_class_method(*Bio::Shell.private_instance_methods)
|
313
|
-
if Bio.respond_to?(args.first)
|
314
|
-
Bio.send(*args)
|
315
|
-
else
|
316
|
-
raise NameError
|
317
|
-
end
|
318
|
-
end
|
319
|
-
|
320
287
|
end
|
321
288
|
|
data/lib/bio/alignment.rb
CHANGED
@@ -1091,7 +1091,7 @@ module Bio
|
|
1091
1091
|
|
1092
1092
|
# generates Phylip3.2 (old) non-interleaved format as a string
|
1093
1093
|
def output_phylipnon(options = {})
|
1094
|
-
aln, aseqs,
|
1094
|
+
aln, aseqs, _ = __output_phylip_common(options)
|
1095
1095
|
aln.first + aseqs.join('')
|
1096
1096
|
end
|
1097
1097
|
|
@@ -1476,21 +1476,16 @@ module Bio
|
|
1476
1476
|
|
1477
1477
|
# Gets the sequence from given object.
|
1478
1478
|
def extract_seq(obj)
|
1479
|
-
seq = nil
|
1480
1479
|
if obj.is_a?(Bio::Sequence::NA) or obj.is_a?(Bio::Sequence::AA) then
|
1481
|
-
|
1480
|
+
obj
|
1482
1481
|
else
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
break if seq
|
1490
|
-
end
|
1491
|
-
seq = obj unless seq
|
1482
|
+
meth = [ :seq, :naseq, :aaseq ].find {|m|
|
1483
|
+
obj.respond_to? m
|
1484
|
+
}
|
1485
|
+
meth ?
|
1486
|
+
obj.__send__(meth) :
|
1487
|
+
obj
|
1492
1488
|
end
|
1493
|
-
seq
|
1494
1489
|
end
|
1495
1490
|
module_function :extract_seq
|
1496
1491
|
|
@@ -1650,7 +1645,6 @@ module Bio
|
|
1650
1645
|
# (Like Hash#rehash)
|
1651
1646
|
def rehash
|
1652
1647
|
@seqs.rehash
|
1653
|
-
oldkeys = @keys
|
1654
1648
|
tmpkeys = @seqs.keys
|
1655
1649
|
@keys.collect! do |k|
|
1656
1650
|
tmpkeys.delete(k)
|
data/lib/bio/appl/blast.rb
CHANGED
@@ -7,7 +7,6 @@
|
|
7
7
|
# Copyright:: Copyright (C) 2008 Naohisa Goto <ng@bioruby.org>
|
8
8
|
# License:: The Ruby License
|
9
9
|
#
|
10
|
-
# $Id:$
|
11
10
|
#
|
12
11
|
|
13
12
|
require 'bio/command'
|
@@ -399,7 +398,7 @@ module Bio
|
|
399
398
|
if fmt = ncbiopt.get('-m') then
|
400
399
|
@format = fmt.to_i
|
401
400
|
else
|
402
|
-
|
401
|
+
_ = Bio::Blast::Report #dummy to load XMLParser or REXML
|
403
402
|
if defined?(XMLParser) or defined?(REXML)
|
404
403
|
@format ||= 7
|
405
404
|
else
|
@@ -256,7 +256,7 @@ module Bio
|
|
256
256
|
# Parses the first line of the BLAST result.
|
257
257
|
def format0_parse_header
|
258
258
|
unless defined?(@program)
|
259
|
-
if /([\-\w]+) +([\w
|
259
|
+
if /([\-\w]+) +([\w\-\.]+) *\[ *([\-\.\w]+) *\] *(\[.+\])?/ =~ @f0header.to_s
|
260
260
|
@program = $1
|
261
261
|
@version = "#{$1} #{$2} [#{$3}]"
|
262
262
|
@version_number = $2
|
@@ -384,10 +384,17 @@ module Bio
|
|
384
384
|
|
385
385
|
# Returns name of the matrix.
|
386
386
|
def matrix; parse_params; @matrix; end
|
387
|
+
|
387
388
|
# Returns the match score of the matrix.
|
388
|
-
def sc_match
|
389
|
+
def sc_match
|
390
|
+
parse_params
|
391
|
+
(defined? @sc_match) ? @sc_match : nil
|
392
|
+
end
|
389
393
|
# Returns the mismatch score of the matrix.
|
390
|
-
def sc_mismatch
|
394
|
+
def sc_mismatch
|
395
|
+
parse_params
|
396
|
+
(defined? @sc_mismatch) ? @sc_mismatch : nil
|
397
|
+
end
|
391
398
|
|
392
399
|
# Returns gap open penalty value.
|
393
400
|
def gap_open; parse_params; @gap_open; end
|
@@ -571,7 +578,9 @@ module Bio
|
|
571
578
|
# Returns nil if it is not a PHI-BLAST result.
|
572
579
|
def pattern
|
573
580
|
#PHI-BLAST
|
574
|
-
if
|
581
|
+
if defined? @pattern
|
582
|
+
@pattern
|
583
|
+
elsif defined? @pattern_in_database then
|
575
584
|
@pattern = nil
|
576
585
|
@pattern_positions = []
|
577
586
|
@f0message.each do |r|
|
@@ -582,8 +591,10 @@ module Bio
|
|
582
591
|
@pattern_positions << sc[1].to_i
|
583
592
|
end
|
584
593
|
end
|
594
|
+
@pattern
|
595
|
+
else
|
596
|
+
nil
|
585
597
|
end
|
586
|
-
@pattern
|
587
598
|
end
|
588
599
|
|
589
600
|
# (PHI-BLAST) Returns pattern positions.
|
@@ -662,7 +673,7 @@ module Bio
|
|
662
673
|
y = b[j]; y.strip!
|
663
674
|
y.reverse!
|
664
675
|
z = y.split(/\s+/, 3)
|
665
|
-
z.each { |
|
676
|
+
z.each { |yy| yy.reverse! }
|
666
677
|
h = Hit.new([ z.pop.to_s.sub(/\.+\z/, '') ])
|
667
678
|
bs = z.pop.to_s
|
668
679
|
bs = '1' + bs if bs[0] == ?e
|
@@ -1043,7 +1054,7 @@ module Bio
|
|
1043
1054
|
# Defines attributes which call parse_score before accessing.
|
1044
1055
|
def self.method_after_parse_score(*names)
|
1045
1056
|
names.each do |x|
|
1046
|
-
module_eval("def #{x}; parse_score; @#{x}; end")
|
1057
|
+
module_eval("def #{x}; parse_score; (defined? @#{x}) ? @#{x} : nil; end")
|
1047
1058
|
end
|
1048
1059
|
end
|
1049
1060
|
private_class_method :method_after_parse_score
|
@@ -17,21 +17,12 @@ class Blast
|
|
17
17
|
autoload :GenomeNet, 'bio/appl/blast/genomenet'
|
18
18
|
autoload :Genomenet, 'bio/appl/blast/genomenet'
|
19
19
|
|
20
|
-
autoload :DDBJ, 'bio/appl/blast/ddbj'
|
21
|
-
autoload :Ddbj, 'bio/appl/blast/ddbj'
|
22
|
-
|
23
20
|
# creates a remote BLAST factory using GenomeNet
|
24
21
|
def self.genomenet(program, db, options = [])
|
25
22
|
GenomeNet.new(program, db, options)
|
26
23
|
#Bio::Blast.new(program, db, options, 'genomenet')
|
27
24
|
end
|
28
25
|
|
29
|
-
# creates a remote BLAST factory using DDBJ Web service
|
30
|
-
def self.ddbj(program, db, options = [])
|
31
|
-
DDBJ.new(program, db, options)
|
32
|
-
#Bio::Blast.new(program, db, options, 'ddbj')
|
33
|
-
end
|
34
|
-
|
35
26
|
# Common methods for meta-information processing
|
36
27
|
# (e.g. list of databases).
|
37
28
|
module Information
|
@@ -143,7 +143,9 @@ module Bio
|
|
143
143
|
a[0].gsub!(/\A(\r?\n)+/, '')
|
144
144
|
a.collect! { |x| x.split(/\r?\n/) }
|
145
145
|
a.each { |x|
|
146
|
-
x.each { |y| y.sub!(/ +\d+\s
|
146
|
+
x.each { |y| y.sub!(/ +\d+\s*\z/, '') if /\d\s*\z/ =~ y }
|
147
|
+
# The above "if /\d\s*\z/ =~ y" is for optimization only.
|
148
|
+
} #for -SEQNOS=on option
|
147
149
|
@tagsize = ( a[0][0].rindex(/\s/) or -1 ) + 1
|
148
150
|
a.each do |x|
|
149
151
|
@match_line << x.pop.to_s[@tagsize..-1]
|
@@ -5,7 +5,6 @@
|
|
5
5
|
# Mitsuteru C. Nakao <n@bioruby.org>
|
6
6
|
# License:: The Ruby License
|
7
7
|
#
|
8
|
-
# $Id:$
|
9
8
|
#
|
10
9
|
# == Description
|
11
10
|
#
|
@@ -96,7 +95,7 @@ class Genscan
|
|
96
95
|
genes_region = report[i...j]
|
97
96
|
genes_region.each_line("\n") do |line|
|
98
97
|
if /Init|Intr|Term|PlyA|Prom|Sngl/ =~ line
|
99
|
-
gn, en = line.strip.split(" +")[0].split(/\./).map {|
|
98
|
+
gn, en = line.strip.split(" +")[0].split(/\./).map {|ii| ii.to_i }
|
100
99
|
add_exon(gn, en, line)
|
101
100
|
end
|
102
101
|
end
|
@@ -5,7 +5,6 @@
|
|
5
5
|
# Mitsuteru C. Nakao <mn@kazusa.or.jp>
|
6
6
|
# License:: The Ruby License
|
7
7
|
#
|
8
|
-
# $Id: report.rb,v 1.9 2007/07/18 11:11:57 nakao Exp $
|
9
8
|
#
|
10
9
|
# == Report classes for the iprscan program.
|
11
10
|
#
|
@@ -296,7 +295,7 @@ module Bio
|
|
296
295
|
# end
|
297
296
|
#
|
298
297
|
def to_hash
|
299
|
-
unless @ipr_ids
|
298
|
+
unless (defined? @ipr_ids) && @ipr_ids
|
300
299
|
@ipr_ids = {}
|
301
300
|
@matches.each_with_index do |match, i|
|
302
301
|
@ipr_ids[match.ipr_id] ||= []
|
data/lib/bio/appl/meme/mast.rb
CHANGED
@@ -94,7 +94,7 @@ module Meme
|
|
94
94
|
# *Returns*:: a Bio::Meme::Mast object
|
95
95
|
|
96
96
|
def initialize(mast_location, options = {})
|
97
|
-
unless File.
|
97
|
+
unless File.exist?(mast_location)
|
98
98
|
raise ArgumentError.new("mast: command not found : #{mast_location}")
|
99
99
|
end
|
100
100
|
@binary = mast_location
|
@@ -137,8 +137,8 @@ module Meme
|
|
137
137
|
@options.each_key do |k|
|
138
138
|
raise ArgumentError.new("Invalid option: #{k}") unless DEFAULT_OPTIONS.has_key?(k)
|
139
139
|
end
|
140
|
-
raise ArgumentError.new("Motif file not found: #{@options[:mfile]}") if @options[:mfile].nil? or !File.
|
141
|
-
raise ArgumentError.new("Database not found: #{@options[:d]}") if @options[:d].nil? or !File.
|
140
|
+
raise ArgumentError.new("Motif file not found: #{@options[:mfile]}") if @options[:mfile].nil? or !File.exist?(@options[:mfile])
|
141
|
+
raise ArgumentError.new("Database not found: #{@options[:d]}") if @options[:d].nil? or !File.exist?(@options[:d])
|
142
142
|
end
|
143
143
|
|
144
144
|
# Run the mast program
|
@@ -153,4 +153,4 @@ module Meme
|
|
153
153
|
|
154
154
|
end # End class Mast
|
155
155
|
end # End module Meme
|
156
|
-
end # End module Bio
|
156
|
+
end # End module Bio
|
@@ -74,7 +74,7 @@ module Bio
|
|
74
74
|
fields = line.split(/\s/)
|
75
75
|
|
76
76
|
if fields.size == 5
|
77
|
-
motifs << Motif.new(fields[0],
|
77
|
+
motifs << Motif.new(fields[0], nil, fields[1], fields[2], fields[3], fields[4])
|
78
78
|
elsif fields.size == 6
|
79
79
|
motifs << Motif.new(fields[0], fields[1], fields[2], fields[3], fields[4], fields[5])
|
80
80
|
else
|
data/lib/bio/appl/paml/codeml.rb
CHANGED
@@ -37,9 +37,9 @@ module PAML
|
|
37
37
|
# require 'bio'
|
38
38
|
# # Reads multi-fasta formatted file and gets a Bio::Alignment object.
|
39
39
|
# alignment = Bio::FlatFile.open(Bio::Alignment::MultiFastaFormat,
|
40
|
-
# 'example.fst').alignment
|
40
|
+
# 'example.fst').next_entry.alignment
|
41
41
|
# # Reads newick tree from a file
|
42
|
-
# tree = Bio::FlatFile.open(Bio::Newick, 'example.tree').tree
|
42
|
+
# tree = Bio::FlatFile.open(Bio::Newick, 'example.tree').next_entry.tree
|
43
43
|
# # Creates a Codeml object
|
44
44
|
# codeml = Bio::PAML::Codeml.new
|
45
45
|
# # Sets parameters
|
data/lib/bio/appl/paml/common.rb
CHANGED