bio 2.0.4 → 2.0.6

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +29 -0
  3. data/.gitignore +32 -0
  4. data/ChangeLog +433 -0
  5. data/Gemfile +3 -0
  6. data/LEGAL +2 -0
  7. data/README.rdoc +1 -1
  8. data/RELEASE_NOTES.rdoc +64 -0
  9. data/appveyor.yml +14 -13
  10. data/bioruby.gemspec +9 -10
  11. data/doc/Tutorial.md +1274 -0
  12. data/doc/Tutorial_ja.md +2595 -0
  13. data/lib/bio/appl/blast/genomenet.rb +2 -1
  14. data/lib/bio/appl/clustalw/report.rb +3 -2
  15. data/lib/bio/appl/iprscan/report.rb +2 -1
  16. data/lib/bio/appl/meme/mast.rb +2 -1
  17. data/lib/bio/appl/paml/common.rb +2 -1
  18. data/lib/bio/appl/pts1.rb +1 -1
  19. data/lib/bio/db/embl/common.rb +5 -2
  20. data/lib/bio/db/embl/uniprotkb.rb +52 -19
  21. data/lib/bio/db/fastq.rb +3 -2
  22. data/lib/bio/db/gff.rb +14 -8
  23. data/lib/bio/db/newick.rb +6 -5
  24. data/lib/bio/db/pdb/chain.rb +2 -1
  25. data/lib/bio/db/pdb/pdb.rb +2 -1
  26. data/lib/bio/db/prosite.rb +2 -0
  27. data/lib/bio/db.rb +5 -4
  28. data/lib/bio/io/flatfile/buffer.rb +2 -1
  29. data/lib/bio/io/flatfile/splitter.rb +2 -1
  30. data/lib/bio/pathway.rb +2 -1
  31. data/lib/bio/sequence/common.rb +2 -1
  32. data/lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb +3 -2
  33. data/lib/bio/util/sirna.rb +3 -2
  34. data/lib/bio/version.rb +1 -1
  35. data/test/data/uniprot/P03589.uniprot +127 -0
  36. data/test/data/uniprot/P49144.uniprot +232 -0
  37. data/test/functional/bio/test_command.rb +2 -0
  38. data/test/network/bio/db/kegg/test_genes_hsa7422.rb +29 -17
  39. data/test/unit/bio/appl/iprscan/test_report.rb +3 -2
  40. data/test/unit/bio/db/embl/test_uniprotkb_P03589.rb +378 -0
  41. data/test/unit/bio/db/embl/test_uniprotkb_P49144.rb +359 -0
  42. data/test/unit/bio/io/flatfile/test_splitter.rb +7 -4
  43. data/test/unit/bio/sequence/test_common.rb +3 -2
  44. data/test/unit/bio/test_alignment.rb +17 -16
  45. data/test/unit/bio/test_sequence.rb +3 -2
  46. metadata +11 -15
  47. data/.travis.yml +0 -71
  48. data/gemfiles/Gemfile.travis-jruby1.8 +0 -6
  49. data/gemfiles/Gemfile.travis-jruby1.9 +0 -5
  50. data/gemfiles/Gemfile.travis-rbx +0 -10
  51. data/gemfiles/Gemfile.travis-ruby1.8 +0 -6
  52. data/gemfiles/Gemfile.travis-ruby1.9 +0 -5
  53. data/gemfiles/Gemfile.windows +0 -6
  54. data/gemfiles/modify-Gemfile.rb +0 -28
  55. data/gemfiles/prepare-gemspec.rb +0 -29
@@ -162,7 +162,8 @@ module Bio::Blast::Remote
162
162
  #host = "blast.genome.jp"
163
163
  #path = "/sit-bin/nph-blast"
164
164
  #path = "/sit-bin/blast" #2005.08.12
165
- path = "/tools-bin/blast" #2012.01.12
165
+ #path = "/tools-bin/blast" #2012.01.12
166
+ path = "/tools-bin/blastplus" #2018.02.09???
166
167
 
167
168
  options = make_command_line_options
168
169
  opt = Bio::Blast::NCBIOptions.new(options)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/appl/clustalw/report.rb - CLUSTAL W format data (*.aln) class
3
4
  #
@@ -138,7 +139,7 @@ module Bio
138
139
  a = @raw.split(/\r?\n\r?\n/)
139
140
  @header = a.shift.to_s
140
141
  xalign = Bio::Alignment.new
141
- @match_line = ''
142
+ @match_line = String.new
142
143
  if a.size > 0 then
143
144
  a[0].gsub!(/\A(\r?\n)+/, '')
144
145
  a.collect! { |x| x.split(/\r?\n/) }
@@ -151,7 +152,7 @@ module Bio
151
152
  @match_line << x.pop.to_s[@tagsize..-1]
152
153
  end
153
154
  a[0].each do |y|
154
- xalign.store(y[0, @tagsize].sub(/\s+\z/, ''), '')
155
+ xalign.store(y[0, @tagsize].sub(/\s+\z/, ''), String.new)
155
156
  end
156
157
  a.each do |x|
157
158
  x.each do |y|
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/appl/iprscan/report.rb - a class for iprscan output.
3
4
  #
@@ -69,7 +70,7 @@ module Bio
69
70
  # end
70
71
  #
71
72
  def self.parse_raw(io)
72
- entry = ''
73
+ entry = String.new
73
74
  while line = io.gets
74
75
  if entry != '' and entry.split("\t").first == line.split("\t").first
75
76
  entry << line
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/appl/meme/mast.rb - Wrapper for running MAST program
3
4
  #
@@ -113,7 +114,7 @@ module Meme
113
114
 
114
115
  def config(options)
115
116
  @options = DEFAULT_OPTIONS.merge(options)
116
- mfile, opts, flags = "", "", ""
117
+ mfile, opts, flags = String.new, String.new, String.new
117
118
  @options.each_pair do |opt, val|
118
119
  if val.nil? or val == false
119
120
  next
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/appl/paml/common.rb - Basic wrapper class common to PAML programs
3
4
  #
@@ -270,7 +271,7 @@ module PAML
270
271
  def dump_parameters
271
272
  keyorder = DEFAULT_PARAMETERS_ORDER
272
273
  keys = parameters.keys
273
- str = ''
274
+ str = String.new
274
275
  keys.sort do |x, y|
275
276
  (keyorder.index(x) || (keyorder.size + keys.index(x))) <=>
276
277
  (keyorder.index(y) || (keyorder.size + keys.index(y)))
data/lib/bio/appl/pts1.rb CHANGED
@@ -90,7 +90,7 @@ class PTS1
90
90
  # serv_fungi_specific = Bio::PTS1.new(2) # See Bio::PTS1::FUNCTION.
91
91
  #
92
92
  def initialize(func = 'METAZOA-specific')
93
- @uri = "http://mendel.imp.ac.at/jspcgi/cgi-bin/pts1/pts1.cgi"
93
+ @uri = "https://mendel.imp.ac.at/jspcgi/cgi-bin/pts1/pts1.cgi"
94
94
  @output = nil
95
95
  @function = function(func)
96
96
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/db/embl.rb - Common methods for EMBL style database classes
3
4
  #
@@ -243,8 +244,10 @@ module Common
243
244
  unless @data['R']
244
245
  ary = Array.new
245
246
  get('R').split(/\nRN /).each do |str|
246
- raw = {'RN' => '', 'RC' => '', 'RP' => '', 'RX' => '',
247
- 'RA' => '', 'RT' => '', 'RL' => '', 'RG' => ''}
247
+ raw = {'RN' => String.new, 'RC' => String.new,
248
+ 'RP' => String.new, 'RX' => String.new,
249
+ 'RA' => String.new, 'RT' => String.new,
250
+ 'RL' => String.new, 'RG' => String.new}
248
251
  str = 'RN ' + str unless /^RN / =~ str
249
252
  str.split("\n").each do |line|
250
253
  if /^(R[NPXARLCTG]) (.+)/ =~ line
@@ -530,22 +530,43 @@ class UniProtKB < EMBLDB
530
530
  # http://br.expasy.org/sprot/userman.html#OH_line
531
531
  def oh
532
532
  unless @data['OH']
533
- @data['OH'] = fetch('OH').split("\. ").map {|x|
534
- if x =~ /NCBI_TaxID=(\d+);/
535
- taxid = $1
536
- else
537
- raise ArgumentError, ["Error: Invalid OH line format (#{self.entry_id}):",
538
- $!, "\n", get('OH'), "\n"].join
539
-
540
- end
541
- if x =~ /NCBI_TaxID=\d+; (.+)/
542
- host_name = $1
543
- host_name.sub!(/\.$/, '')
544
- else
545
- host_name = nil
533
+ oh = []
534
+ a = fetch('OH').split(/(NCBI\_TaxID\=)(\d+)(\;)/)
535
+ t = catch :error do
536
+ taxid = nil
537
+ host_name = nil
538
+ while x = a.shift
539
+ x = x.to_s.strip
540
+ case x
541
+ when ''
542
+ next
543
+ when 'NCBI_TaxID='
544
+ if taxid then
545
+ oh.push({'NCBI_TaxID' => taxid, 'HostName' => host_name})
546
+ taxid = nil
547
+ host_name = nil
548
+ end
549
+ taxid = a.shift
550
+ throw :error, :missing_semicolon if a.shift != ';'
551
+ else
552
+ throw :error, :missing_taxid if host_name
553
+ host_name = x
554
+ host_name.sub!(/\.\z/, '')
555
+ end
556
+ end #while x...
557
+ if taxid then
558
+ oh.push({'NCBI_TaxID' => taxid, 'HostName' => host_name})
559
+ elsif host_name then
560
+ throw :error, :missing_taxid_last
546
561
  end
547
- {'NCBI_TaxID' => taxid, 'HostName' => host_name}
548
- }
562
+ nil
563
+ end #t = catch...
564
+ if t then
565
+ raise ArgumentError,
566
+ ["Error: Invalid OH line format (#{self.entry_id}):",
567
+ $!, "\n", get('OH'), "\n"].join
568
+ end
569
+ @data['OH'] = oh
549
570
  end
550
571
  @data['OH']
551
572
  end
@@ -922,6 +943,7 @@ class UniProtKB < EMBLDB
922
943
 
923
944
 
924
945
  def cc_alternative_products(data)
946
+ return nil unless data
925
947
  ap = data.join('')
926
948
  return ap unless ap
927
949
 
@@ -960,6 +982,7 @@ class UniProtKB < EMBLDB
960
982
 
961
983
 
962
984
  def cc_biophysiochemical_properties(data)
985
+ return nil unless data
963
986
  data = data[0]
964
987
 
965
988
  hash = {'Absorption' => {},
@@ -995,6 +1018,7 @@ class UniProtKB < EMBLDB
995
1018
 
996
1019
 
997
1020
  def cc_caution(data)
1021
+ return nil unless data
998
1022
  data.join('')
999
1023
  end
1000
1024
  private :cc_caution
@@ -1004,6 +1028,7 @@ class UniProtKB < EMBLDB
1004
1028
  #
1005
1029
  # CC P46527:CDKN1B; NbExp=1; IntAct=EBI-359815, EBI-519280;
1006
1030
  def cc_interaction(data)
1031
+ return nil unless data
1007
1032
  str = data.join('')
1008
1033
  it = str.scan(/(.+?); NbExp=(.+?); IntAct=(.+?);/)
1009
1034
  it.map {|ent|
@@ -1059,6 +1084,7 @@ class UniProtKB < EMBLDB
1059
1084
 
1060
1085
 
1061
1086
  def cc_pathway(data)
1087
+ return nil unless data
1062
1088
  data.map {|x| x.sub(/\.$/, '') }.map {|x|
1063
1089
  x.split(/; | and |: /)
1064
1090
  }[0]
@@ -1067,6 +1093,7 @@ class UniProtKB < EMBLDB
1067
1093
 
1068
1094
 
1069
1095
  def cc_rna_editing(data)
1096
+ return nil unless data
1070
1097
  data = data.join('')
1071
1098
  entry = {'Modified_positions' => [], 'Note' => ""}
1072
1099
  if data =~ /Modified_positions=(.+?)(\.|;)/
@@ -1083,6 +1110,7 @@ class UniProtKB < EMBLDB
1083
1110
 
1084
1111
 
1085
1112
  def cc_subcellular_location(data)
1113
+ return nil unless data
1086
1114
  data.map {|x|
1087
1115
  x.split('. ').map {|y|
1088
1116
  y.split('; ').map {|z|
@@ -1101,6 +1129,7 @@ class UniProtKB < EMBLDB
1101
1129
  #++
1102
1130
 
1103
1131
  def cc_web_resource(data)
1132
+ return nil unless data
1104
1133
  data.map {|x|
1105
1134
  entry = {'Name' => nil, 'Note' => nil, 'URL' => nil}
1106
1135
  x.split(';').each do |y|
@@ -1235,10 +1264,14 @@ class UniProtKB < EMBLDB
1235
1264
  begin
1236
1265
  ftlines.each do |line|
1237
1266
  if /^FT +([^\s]+) +(([^\s]+)\:)?([\<\?]?[0-9]+|\?)(?:\.\.([\>\?]?[0-9]+|\?))?\s*$/ =~ line
1238
- cur_ft = [$1.to_s, # Feature Name
1239
- "#{$2}#{$4}", # From
1240
- $5.to_s, # To
1241
- [] # Qualifiers
1267
+ f_name = $1.to_s
1268
+ f_from = "#{$2}#{$4}"
1269
+ f_to = $5.to_s
1270
+ f_to = f_from if f_to.empty?
1271
+ cur_ft = [f_name, # Feature Name
1272
+ f_from, # From
1273
+ f_to, # To
1274
+ [] # Qualifiers
1242
1275
  ]
1243
1276
  table.push cur_ft
1244
1277
  cont = false
data/lib/bio/db/fastq.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/db/fastq.rb - FASTQ format parser class
3
4
  #
@@ -349,7 +350,7 @@ class Fastq
349
350
  return self
350
351
  end
351
352
  if defined? @definition2 then
352
- @quality_string ||= ''
353
+ @quality_string ||= String.new
353
354
  if line[0, 1] == "@" and
354
355
  @quality_string.size >= @sequence_string.size then
355
356
  return false
@@ -358,7 +359,7 @@ class Fastq
358
359
  return self
359
360
  end
360
361
  else
361
- @sequence_string ||= ''
362
+ @sequence_string ||= String.new
362
363
  if line[0, 1] == '+' then
363
364
  @definition2 = line[1..-1]
364
365
  else
data/lib/bio/db/gff.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # coding: US-ASCII
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = bio/db/gff.rb - GFF format class
4
5
  #
@@ -137,13 +138,13 @@ module Bio
137
138
 
138
139
  sc = StringScanner.new(attributes)
139
140
  attrs = []
140
- token = ''
141
+ token = String.new
141
142
  while !sc.eos?
142
143
  if sc.scan(/[^\\\;\"]+/) then
143
144
  token.concat sc.matched
144
145
  elsif sc.scan(/\;/) then
145
146
  attrs.push token unless token.empty?
146
- token = ''
147
+ token = String.new
147
148
  elsif sc.scan(/\"/) then
148
149
  origtext = sc.matched
149
150
  while !sc.eos?
@@ -690,22 +691,22 @@ module Bio
690
691
  sc = StringScanner.new(str)
691
692
  attr_pairs = []
692
693
  tokens = []
693
- cur_token = ''
694
+ cur_token = String.new
694
695
  while !sc.eos?
695
696
  if sc.scan(/[^\\\;\"\s]+/) then
696
697
  cur_token.concat sc.matched
697
698
  elsif sc.scan(/\s+/) then
698
699
  tokens.push cur_token unless cur_token.empty?
699
- cur_token = ''
700
+ cur_token = String.new
700
701
  elsif sc.scan(/\;/) then
701
702
  tokens.push cur_token unless cur_token.empty?
702
- cur_token = ''
703
+ cur_token = String.new
703
704
  attr_pairs.push tokens
704
705
  tokens = []
705
706
  elsif sc.scan(/\"/) then
706
707
  tokens.push cur_token unless cur_token.empty?
707
- cur_token = ''
708
- freetext = ''
708
+ cur_token = String.new
709
+ freetext = String.new
709
710
  while !sc.eos?
710
711
  if sc.scan(/[^\\\"]+/) then
711
712
  freetext.concat sc.matched
@@ -999,10 +1000,15 @@ module Bio
999
1000
  str.empty? ? '.' : str
1000
1001
  end
1001
1002
 
1002
- if URI.const_defined?(:Parser) then
1003
+ if URI.const_defined?(:RFC2396_Parser) then
1004
+ # (private) URI::Parser object for escape/unescape GFF3 columns
1005
+ URI_PARSER = URI::RFC2396_Parser.new
1006
+ elsif URI.const_defined?(:Parser) then
1003
1007
  # (private) URI::Parser object for escape/unescape GFF3 columns
1004
1008
  URI_PARSER = URI::Parser.new
1009
+ end
1005
1010
 
1011
+ if const_defined?(:URI_PARSER) then
1006
1012
  # (private) the same as URI::Parser#escape(str, unsafe)
1007
1013
  def _escape(str, unsafe)
1008
1014
  URI_PARSER.escape(str, unsafe)
data/lib/bio/db/newick.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/db/newick.rb - Newick Standard phylogenetic tree parser / formatter
3
4
  #
@@ -150,7 +151,7 @@ module Bio
150
151
  # Molphy-style boostrap values
151
152
  # let molphy mode if nothing determined
152
153
  @options[:original_format] ||= :molphy
153
- bstr = ''
154
+ bstr = String.new
154
155
  while t = btokens.shift and t != :']'
155
156
  bstr.concat t.to_s
156
157
  end
@@ -162,7 +163,7 @@ module Bio
162
163
  if !btokens and !leaf_tokens.empty? then
163
164
  # syntax error?
164
165
  end
165
- node.name ||= '' # compatibility for older BioRuby
166
+ node.name ||= String.new # compatibility for older BioRuby
166
167
 
167
168
  # returns true
168
169
  true
@@ -242,7 +243,7 @@ module Bio
242
243
 
243
244
  elsif ss.scan(/\'/) then
244
245
  # quoted_label
245
- t = ''
246
+ t = String.new
246
247
  while true
247
248
  if ss.scan(/([^\']*)\'/) then
248
249
  t.concat ss[1]
@@ -317,7 +318,7 @@ module Bio
317
318
  if previous_token == :',' or previous_token == :'(' then
318
319
  # there is a leaf whose name is empty.
319
320
  ary.unshift(token)
320
- ary.unshift('')
321
+ ary.unshift(String.new)
321
322
  token = nil
322
323
  end
323
324
  when :'('
@@ -330,7 +331,7 @@ module Bio
330
331
  if previous_token == :',' or previous_token == :'(' then
331
332
  # there is a leaf whose name is empty.
332
333
  ary.unshift(token)
333
- ary.unshift('')
334
+ ary.unshift(String.new)
334
335
  token = nil
335
336
  else
336
337
  edge = Edge.new
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/db/pdb/chain.rb - chain class for PDB
3
4
  #
@@ -180,7 +181,7 @@ module Bio
180
181
  # gets an amino acid sequence of this chain from ATOM records
181
182
  def aaseq
182
183
  unless defined? @aaseq
183
- string = ""
184
+ string = String.new
184
185
  last_residue_num = nil
185
186
  @residues.each do |residue|
186
187
  if last_residue_num and
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/db/pdb/pdb.rb - PDB database class for PDB file format
3
4
  #
@@ -1645,7 +1646,7 @@ module Bio
1645
1646
  # Returns a string of Bio::PDB::Models. This propogates down the heirarchy
1646
1647
  # till you get to Bio::PDB::Record::ATOM which are outputed in PDB format
1647
1648
  def to_s
1648
- string = ""
1649
+ string = String.new
1649
1650
  @models.each{ |model| string << model.to_s }
1650
1651
  string << "END\n"
1651
1652
  return string
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/db/prosite.rb - PROSITE database class
3
4
  #
@@ -465,6 +466,7 @@ class PROSITE < EMBLDB
465
466
  # translated as: Ala-any-[Ser or Thr]-[Ser or Thr]-(any or none)-Val
466
467
  #
467
468
  def self.pa2re(pattern)
469
+ pattern = pattern.dup
468
470
  pattern.gsub!(/\s/, '') # remove white spaces
469
471
  pattern.sub!(/\.$/, '') # (1) remove trailing '.'
470
472
  pattern.sub!(/^</, '^') # (2) restricted to the N-terminal : `<'
data/lib/bio/db.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/db.rb - common API for database parsers
3
4
  #
@@ -192,19 +193,19 @@ class DB
192
193
  # Returns a String with successive white spaces are replaced by one
193
194
  # space and stripeed.
194
195
  def truncate(str)
195
- str ||= ""
196
+ str ||= String.new
196
197
  return str.gsub(/\s+/, ' ').strip
197
198
  end
198
199
 
199
200
  # Returns a tag name of the field as a String.
200
201
  def tag_get(str)
201
- str ||= ""
202
+ str ||= String.new
202
203
  return str[0,@tagsize].strip
203
204
  end
204
205
 
205
206
  # Returns a String of the field without a tag name.
206
207
  def tag_cut(str)
207
- str ||= ""
208
+ str ||= String.new
208
209
  str[0,@tagsize] = ''
209
210
  return str
210
211
  end
@@ -313,7 +314,7 @@ class EMBLDB < DB
313
314
 
314
315
  # Returns the contents of the entry as a Hash.
315
316
  def entry2hash(entry)
316
- hash = Hash.new { |h,k| h[k] = '' }
317
+ hash = Hash.new { |h,k| h[k] = String.new }
317
318
  entry.each_line do |line|
318
319
  tag = tag_get(line)
319
320
  next if tag == 'XX'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/io/flatfile/buffer.rb - Input stream buffer for FlatFile
3
4
  #
@@ -24,7 +25,7 @@ module Bio
24
25
  @io = io
25
26
  @path = path
26
27
  # initialize prefetch buffer
27
- @buffer = ''
28
+ @buffer = String.new
28
29
  end
29
30
 
30
31
  # Creates a new input stream wrapper from the given IO object.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/io/flatfile/splitter.rb - input data splitter for FlatFile
3
4
  #
@@ -157,7 +158,7 @@ module Bio
157
158
  # Otherwise, returns nil.
158
159
  def skip_leader
159
160
  if @header then
160
- data = ''
161
+ data = String.new
161
162
  while s = stream.gets(@header)
162
163
  data << s
163
164
  if data.split(/[\r\n]+/)[-1] == @header then
data/lib/bio/pathway.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/pathway.rb - Binary relations and Graph algorithms
3
4
  #
@@ -307,7 +308,7 @@ class Pathway
307
308
  end
308
309
  # end workaround removing depencency to order of Hash#each
309
310
 
310
- list = ""
311
+ list = String.new
311
312
  enum.each do |from, hash|
312
313
  list << "#{from} => "
313
314
  # begin workaround removing depencency to order of Hash#each
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/sequence/common.rb - common methods for biological sequence
3
4
  #
@@ -286,7 +287,7 @@ module Common
286
287
  unless position.is_a?(Locations) then
287
288
  position = Locations.new(position)
288
289
  end
289
- s = ''
290
+ s = String.new
290
291
  position.each do |location|
291
292
  if location.sequence
292
293
  s << location.sequence
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # bio/util/restriction_enzyme/range/sequence_range/fragment.rb -
3
4
  #
@@ -27,8 +28,8 @@ class Fragment
27
28
 
28
29
  def for_display(p_str=nil, c_str=nil)
29
30
  df = DisplayFragment.new
30
- df.primary = ''
31
- df.complement = ''
31
+ df.primary = String.new
32
+ df.complement = String.new
32
33
 
33
34
  both_bins = @primary_bin + @complement_bin
34
35
  both_bins.each do |item|
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # = bio/util/sirna.rb - Class for designing small inhibitory RNAs
3
4
  #
@@ -202,7 +203,7 @@ module Bio
202
203
 
203
204
  # human readable report
204
205
  def report
205
- report = "### siRNA\n"
206
+ report = "### siRNA\n".dup
206
207
  report << 'Start: ' + @start.to_s + "\n"
207
208
  report << 'Stop: ' + @stop.to_s + "\n"
208
209
  report << 'Rule: ' + @rule.to_s + "\n"
@@ -280,7 +281,7 @@ module Bio
280
281
  def report
281
282
  # raise NomethodError for compatibility
282
283
  raise NoMethodError if !defined?(@top_strand) || !@top_strand
283
- report = "### shRNA\n"
284
+ report = "### shRNA\n".dup
284
285
  report << "Top strand shRNA (#{@top_strand.length} nt):\n"
285
286
  report << " 5'-#{@top_strand.upcase}-3'\n"
286
287
  report << "Bottom strand shRNA (#{@bottom_strand.length} nt):\n"
data/lib/bio/version.rb CHANGED
@@ -10,7 +10,7 @@
10
10
  module Bio
11
11
 
12
12
  # BioRuby version (Array containing Integer)
13
- BIORUBY_VERSION = [2, 0, 4].extend(Comparable).freeze
13
+ BIORUBY_VERSION = [2, 0, 6].extend(Comparable).freeze
14
14
 
15
15
  # Extra version specifier (String or nil).
16
16
  # Existance of the value indicates development version.