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.
Files changed (158) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +39 -33
  3. data/BSDL +22 -0
  4. data/COPYING +2 -2
  5. data/COPYING.ja +36 -36
  6. data/ChangeLog +2404 -1025
  7. data/KNOWN_ISSUES.rdoc +15 -55
  8. data/README.rdoc +17 -23
  9. data/RELEASE_NOTES.rdoc +246 -183
  10. data/Rakefile +3 -2
  11. data/bin/br_biofetch.rb +29 -5
  12. data/bioruby.gemspec +15 -32
  13. data/bioruby.gemspec.erb +10 -20
  14. data/doc/ChangeLog-1.4.3 +1478 -0
  15. data/doc/RELEASE_NOTES-1.4.3.rdoc +204 -0
  16. data/doc/Tutorial.rd +0 -6
  17. data/doc/Tutorial.rd.html +7 -12
  18. data/doc/Tutorial.rd.ja +960 -1064
  19. data/doc/Tutorial.rd.ja.html +977 -1067
  20. data/gemfiles/Gemfile.travis-jruby1.8 +2 -1
  21. data/gemfiles/Gemfile.travis-jruby1.9 +2 -4
  22. data/gemfiles/Gemfile.travis-rbx +13 -0
  23. data/gemfiles/Gemfile.travis-ruby1.8 +2 -1
  24. data/gemfiles/Gemfile.travis-ruby1.9 +2 -4
  25. data/gemfiles/Gemfile.travis-ruby2.2 +9 -0
  26. data/lib/bio.rb +10 -43
  27. data/lib/bio/alignment.rb +8 -14
  28. data/lib/bio/appl/blast.rb +1 -2
  29. data/lib/bio/appl/blast/format0.rb +18 -7
  30. data/lib/bio/appl/blast/remote.rb +0 -9
  31. data/lib/bio/appl/blast/report.rb +1 -1
  32. data/lib/bio/appl/clustalw/report.rb +3 -1
  33. data/lib/bio/appl/genscan/report.rb +1 -2
  34. data/lib/bio/appl/iprscan/report.rb +1 -2
  35. data/lib/bio/appl/meme/mast.rb +4 -4
  36. data/lib/bio/appl/meme/mast/report.rb +1 -1
  37. data/lib/bio/appl/paml/codeml.rb +2 -2
  38. data/lib/bio/appl/paml/codeml/report.rb +1 -0
  39. data/lib/bio/appl/paml/common.rb +1 -1
  40. data/lib/bio/appl/sosui/report.rb +1 -2
  41. data/lib/bio/command.rb +62 -2
  42. data/lib/bio/data/aa.rb +13 -31
  43. data/lib/bio/data/codontable.rb +1 -2
  44. data/lib/bio/db/biosql/biosql_to_biosequence.rb +1 -0
  45. data/lib/bio/db/biosql/sequence.rb +1 -1
  46. data/lib/bio/db/embl/common.rb +1 -1
  47. data/lib/bio/db/embl/embl.rb +5 -4
  48. data/lib/bio/db/embl/format_embl.rb +3 -3
  49. data/lib/bio/db/embl/sptr.rb +9 -1444
  50. data/lib/bio/db/embl/swissprot.rb +12 -29
  51. data/lib/bio/db/embl/trembl.rb +13 -30
  52. data/lib/bio/db/embl/uniprot.rb +12 -29
  53. data/lib/bio/db/embl/uniprotkb.rb +1455 -0
  54. data/lib/bio/db/fasta.rb +17 -0
  55. data/lib/bio/db/fasta/defline.rb +1 -3
  56. data/lib/bio/db/fastq.rb +1 -1
  57. data/lib/bio/db/genbank/ddbj.rb +9 -5
  58. data/lib/bio/db/genbank/refseq.rb +11 -3
  59. data/lib/bio/db/gff.rb +3 -4
  60. data/lib/bio/db/go.rb +5 -6
  61. data/lib/bio/db/kegg/module.rb +4 -5
  62. data/lib/bio/db/kegg/pathway.rb +4 -5
  63. data/lib/bio/db/kegg/reaction.rb +1 -1
  64. data/lib/bio/db/nexus.rb +3 -2
  65. data/lib/bio/db/pdb/pdb.rb +2 -2
  66. data/lib/bio/db/phyloxml/phyloxml_elements.rb +82 -59
  67. data/lib/bio/db/phyloxml/phyloxml_parser.rb +2 -2
  68. data/lib/bio/db/phyloxml/phyloxml_writer.rb +1 -2
  69. data/lib/bio/db/sanger_chromatogram/chromatogram.rb +1 -2
  70. data/lib/bio/db/transfac.rb +1 -1
  71. data/lib/bio/io/das.rb +40 -41
  72. data/lib/bio/io/fastacmd.rb +0 -16
  73. data/lib/bio/io/fetch.rb +111 -55
  74. data/lib/bio/io/flatfile/buffer.rb +4 -5
  75. data/lib/bio/io/hinv.rb +2 -3
  76. data/lib/bio/io/ncbirest.rb +43 -6
  77. data/lib/bio/io/pubmed.rb +76 -81
  78. data/lib/bio/io/togows.rb +33 -10
  79. data/lib/bio/map.rb +1 -1
  80. data/lib/bio/pathway.rb +1 -1
  81. data/lib/bio/sequence/compat.rb +1 -1
  82. data/lib/bio/sequence/na.rb +63 -12
  83. data/lib/bio/shell.rb +0 -2
  84. data/lib/bio/shell/core.rb +5 -6
  85. data/lib/bio/shell/interface.rb +3 -4
  86. data/lib/bio/shell/irb.rb +1 -2
  87. data/lib/bio/shell/plugin/entry.rb +2 -3
  88. data/lib/bio/shell/plugin/seq.rb +7 -6
  89. data/lib/bio/shell/setup.rb +1 -2
  90. data/lib/bio/tree.rb +2 -2
  91. data/lib/bio/util/contingency_table.rb +0 -2
  92. data/lib/bio/util/restriction_enzyme/range/sequence_range.rb +2 -2
  93. data/lib/bio/util/sirna.rb +76 -16
  94. data/lib/bio/version.rb +8 -9
  95. data/sample/benchmark_clustalw_report.rb +47 -0
  96. data/sample/biofetch.rb +248 -151
  97. data/setup.rb +6 -7
  98. data/test/data/clustalw/example1-seqnos.aln +58 -0
  99. data/test/network/bio/appl/blast/test_remote.rb +1 -15
  100. data/test/network/bio/appl/test_blast.rb +0 -12
  101. data/test/network/bio/io/test_pubmed.rb +49 -0
  102. data/test/network/bio/io/test_togows.rb +0 -1
  103. data/test/network/bio/test_command.rb +65 -2
  104. data/test/unit/bio/appl/bl2seq/test_report.rb +0 -1
  105. data/test/unit/bio/appl/blast/test_report.rb +110 -48
  106. data/test/unit/bio/appl/clustalw/test_report.rb +67 -51
  107. data/test/unit/bio/appl/sim4/test_report.rb +46 -17
  108. data/test/unit/bio/appl/test_blast.rb +2 -2
  109. data/test/unit/bio/db/embl/test_embl.rb +0 -1
  110. data/test/unit/bio/db/embl/test_embl_rel89.rb +0 -1
  111. data/test/unit/bio/db/embl/{test_sptr.rb → test_uniprotkb.rb} +111 -115
  112. data/test/unit/bio/db/embl/{test_uniprot_new_part.rb → test_uniprotkb_new_part.rb} +11 -11
  113. data/test/unit/bio/db/genbank/test_genbank.rb +10 -4
  114. data/test/unit/bio/db/pdb/test_pdb.rb +14 -8
  115. data/test/unit/bio/db/test_fasta.rb +41 -1
  116. data/test/unit/bio/db/test_fastq.rb +14 -4
  117. data/test/unit/bio/db/test_gff.rb +2 -2
  118. data/test/unit/bio/db/test_phyloxml.rb +30 -30
  119. data/test/unit/bio/db/test_phyloxml_writer.rb +2 -2
  120. data/test/unit/bio/io/flatfile/test_autodetection.rb +1 -2
  121. data/test/unit/bio/io/flatfile/test_buffer.rb +7 -1
  122. data/test/unit/bio/io/flatfile/test_splitter.rb +1 -1
  123. data/test/unit/bio/io/test_togows.rb +3 -2
  124. data/test/unit/bio/sequence/test_dblink.rb +1 -1
  125. data/test/unit/bio/sequence/test_na.rb +3 -1
  126. data/test/unit/bio/test_alignment.rb +1 -2
  127. data/test/unit/bio/test_command.rb +5 -4
  128. data/test/unit/bio/test_db.rb +4 -2
  129. data/test/unit/bio/test_pathway.rb +25 -10
  130. data/test/unit/bio/util/test_sirna.rb +22 -22
  131. metadata +656 -1430
  132. data/doc/KEGG_API.rd +0 -1843
  133. data/doc/KEGG_API.rd.ja +0 -1834
  134. data/extconf.rb +0 -2
  135. data/lib/bio/appl/blast/ddbj.rb +0 -131
  136. data/lib/bio/db/kegg/taxonomy.rb +0 -280
  137. data/lib/bio/io/dbget.rb +0 -194
  138. data/lib/bio/io/ddbjrest.rb +0 -344
  139. data/lib/bio/io/ddbjxml.rb +0 -458
  140. data/lib/bio/io/ebisoap.rb +0 -158
  141. data/lib/bio/io/ensembl.rb +0 -229
  142. data/lib/bio/io/higet.rb +0 -73
  143. data/lib/bio/io/keggapi.rb +0 -363
  144. data/lib/bio/io/ncbisoap.rb +0 -156
  145. data/lib/bio/io/soapwsdl.rb +0 -119
  146. data/lib/bio/shell/plugin/keggapi.rb +0 -181
  147. data/lib/bio/shell/plugin/soap.rb +0 -87
  148. data/sample/dbget +0 -37
  149. data/sample/demo_ddbjxml.rb +0 -212
  150. data/sample/demo_kegg_taxonomy.rb +0 -92
  151. data/sample/demo_keggapi.rb +0 -502
  152. data/sample/psortplot_html.rb +0 -214
  153. data/test/network/bio/io/test_ddbjrest.rb +0 -47
  154. data/test/network/bio/io/test_ensembl.rb +0 -230
  155. data/test/network/bio/io/test_soapwsdl.rb +0 -53
  156. data/test/unit/bio/io/test_ddbjxml.rb +0 -81
  157. data/test/unit/bio/io/test_ensembl.rb +0 -111
  158. data/test/unit/bio/io/test_soapwsdl.rb +0 -33
@@ -1,6 +1,7 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
3
  gem "rake"
4
+ gem "rdoc"
4
5
 
5
6
  ## disabled because of build error on Travis
6
7
  #gem "libxml-ruby"
@@ -1,10 +1,8 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
3
  gem "rake"
4
+ gem "rdoc"
4
5
 
5
6
  ## disabled because of build error on Travis
6
7
  #gem "libxml-ruby"
7
8
 
8
- ## disabled because of "uninitialized constant XML::SaxParser" error
9
- #gem "soap4r-ruby1.9"
10
-
@@ -0,0 +1,13 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rake"
4
+ gem "rdoc"
5
+
6
+ gem "xmlparser"
7
+ gem "libxml-ruby"
8
+
9
+ platforms :rbx do
10
+ gem 'racc'
11
+ gem 'rubysl', '~> 2.0'
12
+ gem 'psych'
13
+ end
@@ -1,6 +1,7 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
3
  gem "rake"
4
+ gem "rdoc"
4
5
 
5
6
  gem "xmlparser"
6
7
  gem "libxml-ruby"
@@ -1,10 +1,8 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
3
  gem "rake"
4
+ gem "rdoc"
4
5
 
5
6
  gem "xmlparser"
6
7
  gem "libxml-ruby"
7
8
 
8
- ## disabled because of "uninitialized constant XML::SaxParser" error
9
- #gem "soap4r-ruby1.9"
10
-
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rake"
4
+ gem "rdoc"
5
+ gem "test-unit"
6
+
7
+ gem "xmlparser"
8
+ gem "libxml-ruby"
9
+
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/RefSeq/DDBJ
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/TrEMBL/Swiss-Prot/SPTR
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
 
@@ -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, lines = __output_phylip_common(options)
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
- seq = obj
1480
+ obj
1482
1481
  else
1483
- for m in [ :seq, :naseq, :aaseq ]
1484
- begin
1485
- seq = obj.send(m)
1486
- rescue NameError, ArgumentError
1487
- seq = nil
1488
- end
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)
@@ -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
- dummy = Bio::Blast::Report #dummy to load XMLParser or REXML
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\-\.\d]+) *\[ *([\-\.\w]+) *\] *(\[.+\])?/ =~ @f0header.to_s
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; parse_params; @sc_match; end
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; parse_params; @sc_mismatch; end
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 !defined?(@pattern) and defined?(@pattern_in_database) then
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 { |y| y.reverse! }
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
@@ -518,7 +518,7 @@ class Report
518
518
  # get an entry as a Bio::Blast::Report object
519
519
  def get_parsed_entry
520
520
  if @parsed_entries.empty? then
521
- ent = get_entry
521
+ get_entry
522
522
  else
523
523
  self.parsed_entry = @parsed_entries.shift
524
524
  self.entry = nil
@@ -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*$/, '') }} #for -SEQNOS=on option
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 {|i| i.to_i }
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] ||= []
@@ -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.exists?(mast_location)
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.exists?(@options[:mfile])
141
- raise ArgumentError.new("Database not found: #{@options[:d]}") if @options[:d].nil? or !File.exists?(@options[:d])
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], strand = nil, fields[1], fields[2], fields[3], fields[4])
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
@@ -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
@@ -589,6 +589,7 @@ module Bio::PAML
589
589
  def graph_seq
590
590
  graph_to_s(lambda { |site |
591
591
  symbol = site.aaref
592
+ symbol
592
593
  })
593
594
  end
594
595
 
@@ -195,7 +195,7 @@ module PAML
195
195
  raise RuntimeError, msg.join("; ")
196
196
  end
197
197
  # exec command
198
- stdout = exec_local([ ctlfn ], { :chdir => path })
198
+ exec_local([ ctlfn ], { :chdir => path })
199
199
  # get main output
200
200
  outfile.open
201
201
  @output = outfile.read