bio 2.0.5 → 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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +7 -16
- data/ChangeLog +146 -0
- data/README.rdoc +1 -1
- data/RELEASE_NOTES.rdoc +28 -0
- data/bioruby.gemspec +3 -1
- data/doc/Tutorial.md +1274 -0
- data/doc/Tutorial_ja.md +2595 -0
- data/lib/bio/appl/clustalw/report.rb +3 -2
- data/lib/bio/appl/iprscan/report.rb +2 -1
- data/lib/bio/appl/meme/mast.rb +2 -1
- data/lib/bio/appl/paml/common.rb +2 -1
- data/lib/bio/db/embl/common.rb +5 -2
- data/lib/bio/db/fastq.rb +3 -2
- data/lib/bio/db/gff.rb +14 -8
- data/lib/bio/db/newick.rb +6 -5
- data/lib/bio/db/pdb/chain.rb +2 -1
- data/lib/bio/db/pdb/pdb.rb +2 -1
- data/lib/bio/db/prosite.rb +2 -0
- data/lib/bio/db.rb +5 -4
- data/lib/bio/io/flatfile/buffer.rb +2 -1
- data/lib/bio/io/flatfile/splitter.rb +2 -1
- data/lib/bio/pathway.rb +2 -1
- data/lib/bio/sequence/common.rb +2 -1
- data/lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb +3 -2
- data/lib/bio/util/sirna.rb +3 -2
- data/lib/bio/version.rb +1 -1
- data/test/network/bio/db/kegg/test_genes_hsa7422.rb +8 -10
- data/test/unit/bio/appl/iprscan/test_report.rb +3 -2
- data/test/unit/bio/io/flatfile/test_splitter.rb +7 -4
- data/test/unit/bio/sequence/test_common.rb +3 -2
- data/test/unit/bio/test_alignment.rb +17 -16
- data/test/unit/bio/test_sequence.rb +3 -2
- metadata +5 -6
@@ -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
|
data/lib/bio/appl/meme/mast.rb
CHANGED
@@ -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
|
data/lib/bio/appl/paml/common.rb
CHANGED
@@ -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/db/embl/common.rb
CHANGED
@@ -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' =>
|
247
|
-
'
|
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
|
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?(:
|
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 ||=
|
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
|
data/lib/bio/db/pdb/chain.rb
CHANGED
@@ -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
|
data/lib/bio/db/pdb/pdb.rb
CHANGED
@@ -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
|
data/lib/bio/db/prosite.rb
CHANGED
@@ -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
|
data/lib/bio/sequence/common.rb
CHANGED
@@ -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|
|
data/lib/bio/util/sirna.rb
CHANGED
@@ -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,
|
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.
|
@@ -38,7 +38,6 @@ module Bio
|
|
38
38
|
"H01457 Diabetic retinopathy",
|
39
39
|
"H01459 Diabetic neuropathy",
|
40
40
|
"H01529 Avascular necrosis of femoral head",
|
41
|
-
"H01709 Glucocorticoid-induced osteonecrosis",
|
42
41
|
"H02559 Microvascular complications of diabetes"]
|
43
42
|
|
44
43
|
assert_equal(expected, @obj.diseases_as_strings)
|
@@ -49,7 +48,6 @@ module Bio
|
|
49
48
|
"H01457"=>"Diabetic retinopathy",
|
50
49
|
"H01459"=>"Diabetic neuropathy",
|
51
50
|
"H01529"=>"Avascular necrosis of femoral head",
|
52
|
-
"H01709"=>"Glucocorticoid-induced osteonecrosis",
|
53
51
|
"H02559"=>"Microvascular complications of diabetes"}
|
54
52
|
assert_equal(expected, @obj.diseases_as_hash)
|
55
53
|
end
|
@@ -64,6 +62,7 @@ module Bio
|
|
64
62
|
"Dilpacimab: D11642",
|
65
63
|
"Emvododstat: D11890",
|
66
64
|
"Faricimab: D11516<JP/US>",
|
65
|
+
"Ivonescimab: D12808",
|
67
66
|
"Navicixizumab: D11126",
|
68
67
|
"Pegaptanib: D05386",
|
69
68
|
"Ranibizumab: D05697<JP/US>",
|
@@ -74,29 +73,28 @@ module Bio
|
|
74
73
|
end
|
75
74
|
|
76
75
|
def test_networks_as_strings
|
77
|
-
expected = ["
|
78
|
-
"
|
79
|
-
"
|
80
|
-
"nt06224 CXCR signaling",
|
81
|
-
"nt06225 HIF-1 signaling",
|
82
|
-
"nt06227 Nuclear receptor signaling",
|
76
|
+
expected = ["nt06219 JAK-STAT signaling (cancer)",
|
77
|
+
"nt06225 HIF-1 signaling (cancer)",
|
78
|
+
"nt06227 Nuclear receptor signaling (cancer)",
|
83
79
|
"nt06262 Pancreatic cancer",
|
84
80
|
"nt06264 Renal cell carcinoma",
|
85
81
|
"nt06360 Cushing syndrome",
|
86
82
|
"nt06526 MAPK signaling",
|
87
83
|
"nt06528 Calcium signaling",
|
88
84
|
"nt06530 PI3K signaling",
|
85
|
+
"nt06542 HIF signaling",
|
89
86
|
"N00079 HIF-1 signaling pathway",
|
90
87
|
"N00080 Loss of VHL to HIF-1 signaling pathway",
|
91
88
|
"N00081 Mutation-inactivated VHL to HIF-1 signaling pathway",
|
92
89
|
"N00095 ERBB2-overexpression to EGF-Jak-STAT signaling pathway",
|
93
|
-
"N00157 KSHV vGPCR to GNB/G-ERK signaling pathway",
|
94
90
|
"N00317 AhR signaling pathway",
|
95
91
|
"N01412 Metals to HTF-1 signaling pathway",
|
96
92
|
"N01592 GF-RTK-RAS-ERK signaling pathway",
|
97
93
|
"N01641 RTK-PLCG-ITPR signaling pathway",
|
98
94
|
"N01656 GF-RTK-PI3K signaling pathway",
|
99
|
-
"N01658 GF-RTK-RAS-PI3K signaling pathway"
|
95
|
+
"N01658 GF-RTK-RAS-PI3K signaling pathway",
|
96
|
+
"N01870 HIF-2A signaling pathway",
|
97
|
+
"N01873 VHL mutation to HIF-2 signaling pathway"]
|
100
98
|
assert_equal(expected, @obj.networks_as_strings)
|
101
99
|
end
|
102
100
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# test/unit/bio/appl/iprscan/test_report.rb - Unit test for Bio::InterProScan::Report
|
3
4
|
#
|
@@ -211,14 +212,14 @@ END
|
|
211
212
|
class TestIprscanRawReport < Test::Unit::TestCase
|
212
213
|
def setup
|
213
214
|
test_raw = Bio::TestIprscanData.raw_format
|
214
|
-
entry =
|
215
|
+
entry = String.new
|
215
216
|
@obj = []
|
216
217
|
while line = test_raw.gets
|
217
218
|
if entry.split("\t").first == line.split("\t").first
|
218
219
|
entry << line
|
219
220
|
elsif entry != '' and entry.split("\t").first != line.split("\t").first
|
220
221
|
@obj << Bio::Iprscan::Report.parse_raw_entry(entry)
|
221
|
-
entry =
|
222
|
+
entry = String.new
|
222
223
|
else
|
223
224
|
entry << line
|
224
225
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# = test/unit/bio/io/flatfile/test_splitter.rb - unit test for Bio::FlatFile::Splitter
|
3
4
|
#
|
@@ -37,7 +38,7 @@ module Bio::TestFlatFileSplitter
|
|
37
38
|
end
|
38
39
|
end #class TestDataClass
|
39
40
|
|
40
|
-
|
41
|
+
testdata01 = <<__END_OF_TESTDATA__
|
41
42
|
|
42
43
|
# This is test
|
43
44
|
|
@@ -54,10 +55,12 @@ tttttttttttttttttttttttt
|
|
54
55
|
>test3
|
55
56
|
atatatatatatatatatatatat
|
56
57
|
__END_OF_TESTDATA__
|
57
|
-
TestData01.chomp!
|
58
|
-
# workaround for Windows
|
59
|
-
TestData01.gsub!(/\r\n/, "\n")
|
60
58
|
|
59
|
+
testdata01 = testdata01.chomp
|
60
|
+
# workaround for Windows
|
61
|
+
testdata01.gsub!(/\r\n/, "\n")
|
62
|
+
TestData01 = testdata01
|
63
|
+
|
61
64
|
class TestTemplate < Test::Unit::TestCase
|
62
65
|
def setup
|
63
66
|
@stream = Bio::FlatFile::BufferedInputStream.new(StringIO.new(TestData01), 'TestData01')
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# test/unit/bio/sequence/test_common.rb - Unit test for Bio::Sequencce::Common
|
3
4
|
#
|
@@ -155,7 +156,7 @@ module Bio; module TestSequenceCommon
|
|
155
156
|
|
156
157
|
rseqs = (0..2).collect do |i|
|
157
158
|
newcomposition = Hash.new(0)
|
158
|
-
newseq =
|
159
|
+
newseq = String.new
|
159
160
|
ret = @seq.randomize do |c|
|
160
161
|
assert_kind_of(TSequence, c)
|
161
162
|
newcomposition[c] += 1
|
@@ -215,7 +216,7 @@ module Bio; module TestSequenceCommon
|
|
215
216
|
|
216
217
|
rseqs = (0..2).collect do |i|
|
217
218
|
newcomposition = Hash.new(0)
|
218
|
-
newseq =
|
219
|
+
newseq = String.new
|
219
220
|
ret = @seq.randomize(hash) do |c|
|
220
221
|
#assert_kind_of(TSequence, c)
|
221
222
|
assert_kind_of(String, c)
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# test/unit/bio/test_alignment.rb - Unit test for Bio::Alignment
|
3
4
|
#
|
@@ -436,29 +437,29 @@ module Bio
|
|
436
437
|
|
437
438
|
def test_convert_match
|
438
439
|
a = A[
|
439
|
-
'aaaa',
|
440
|
-
'accc',
|
441
|
-
'acac',
|
442
|
-
'actc'
|
440
|
+
'aaaa'.dup,
|
441
|
+
'accc'.dup,
|
442
|
+
'acac'.dup,
|
443
|
+
'actc'.dup
|
443
444
|
]
|
444
445
|
a.convert_match
|
445
446
|
assert_equal(A[ 'aaaa', '.ccc', '.c.c', '.ctc' ], a)
|
446
447
|
end
|
447
448
|
|
448
449
|
def test_convert_unmatch
|
449
|
-
a = A[ 'aaaa', '.ccc', '.c.c', '.ctc' ]
|
450
|
+
a = A[ 'aaaa'.dup, '.ccc'.dup, '.c.c'.dup, '.ctc'.dup ]
|
450
451
|
a.convert_unmatch
|
451
452
|
assert_equal(A[ 'aaaa', 'accc', 'acac', 'actc' ], a)
|
452
453
|
end
|
453
454
|
|
454
455
|
def test_alignment_normalize!
|
455
|
-
a = A[ 'a', 'atg', 'atgc', '' ]
|
456
|
+
a = A[ 'a'.dup, 'atg'.dup, 'atgc'.dup, ''.dup ]
|
456
457
|
a.alignment_normalize!
|
457
458
|
assert_equal(A[ 'a---', 'atg-', 'atgc', '----'], a)
|
458
459
|
end
|
459
460
|
|
460
461
|
def test_alignment_rstrip!
|
461
|
-
a = A[ '--aaa--', '--t-t--', '---g---', '--t' ]
|
462
|
+
a = A[ '--aaa--'.dup, '--t-t--'.dup, '---g---'.dup, '--t'.dup ]
|
462
463
|
assert(a.alignment_rstrip!)
|
463
464
|
assert_equal(A[ '--aaa', '--t-t', '---g-', '--t' ], a)
|
464
465
|
end
|
@@ -470,7 +471,7 @@ module Bio
|
|
470
471
|
end
|
471
472
|
|
472
473
|
def test_alignment_lstrip!
|
473
|
-
a = A[ '--aaa--', '--t-t--', '---g---', '--t' ]
|
474
|
+
a = A[ '--aaa--'.dup, '--t-t--'.dup, '---g---'.dup, '--t'.dup ]
|
474
475
|
assert(a.alignment_lstrip!)
|
475
476
|
assert_equal(A[ 'aaa--', 't-t--', '-g---', 't' ], a)
|
476
477
|
end
|
@@ -482,7 +483,7 @@ module Bio
|
|
482
483
|
end
|
483
484
|
|
484
485
|
def test_alignment_strip!
|
485
|
-
a = A[ '--aaa--', '--t-t--', '---g---', '--t' ]
|
486
|
+
a = A[ '--aaa--'.dup, '--t-t--'.dup, '---g---'.dup, '--t'.dup ]
|
486
487
|
assert(a.alignment_strip!)
|
487
488
|
assert_equal(A[ 'aaa', 't-t', '-g-', 't' ], a)
|
488
489
|
end
|
@@ -494,7 +495,7 @@ module Bio
|
|
494
495
|
end
|
495
496
|
|
496
497
|
def test_remove_all_gaps!
|
497
|
-
a = A[ '--aaa--', '--t-t--', '---g---', '--t' ]
|
498
|
+
a = A[ '--aaa--'.dup, '--t-t--'.dup, '---g---'.dup, '--t'.dup ]
|
498
499
|
assert(a.remove_all_gaps!)
|
499
500
|
assert_equal(A[ 'aaa', 'tt', 'g', 't' ], a)
|
500
501
|
end
|
@@ -525,7 +526,7 @@ module Bio
|
|
525
526
|
end
|
526
527
|
|
527
528
|
def test_alignment_concat
|
528
|
-
a = A[ 'aaa', 'c', 'gg', 't' ]
|
529
|
+
a = A[ 'aaa'.dup, 'c'.dup, 'gg'.dup, 't'.dup ]
|
529
530
|
a.alignment_concat(A[ 'ttt', 'gg', 'aa', 'cc', 'aa' ])
|
530
531
|
assert_equal(A[ 'aaattt', 'cgg', 'ggaa', 'tcc' ], a)
|
531
532
|
a.alignment_concat([ 'c', 't' ])
|
@@ -702,7 +703,7 @@ module Bio
|
|
702
703
|
end
|
703
704
|
|
704
705
|
def test_add_seq_using_seq_with_seq_method
|
705
|
-
seq = "agtc"
|
706
|
+
seq = "agtc".dup
|
706
707
|
class <<seq
|
707
708
|
def seq
|
708
709
|
Sequence::NA.new(self)
|
@@ -716,7 +717,7 @@ module Bio
|
|
716
717
|
end
|
717
718
|
|
718
719
|
def test_add_seq_using_seq_with_naseq_method
|
719
|
-
seq = "agtc"
|
720
|
+
seq = "agtc".dup
|
720
721
|
class <<seq
|
721
722
|
def naseq
|
722
723
|
Sequence::NA.new(self)
|
@@ -730,7 +731,7 @@ module Bio
|
|
730
731
|
end
|
731
732
|
|
732
733
|
def test_add_seq_using_seq_with_aaseq_method
|
733
|
-
seq = "AVGR"
|
734
|
+
seq = "AVGR".dup
|
734
735
|
class <<seq
|
735
736
|
def aaseq
|
736
737
|
Sequence::AA.new(self)
|
@@ -744,7 +745,7 @@ module Bio
|
|
744
745
|
end
|
745
746
|
|
746
747
|
def test_add_seq_using_seq_with_definition_method
|
747
|
-
seq = "atgc"
|
748
|
+
seq = "atgc".dup
|
748
749
|
class <<seq
|
749
750
|
def definition
|
750
751
|
"this is the key"
|
@@ -757,7 +758,7 @@ module Bio
|
|
757
758
|
end
|
758
759
|
|
759
760
|
def test_add_seq_using_seq_with_entry_id_method
|
760
|
-
seq = "atgc"
|
761
|
+
seq = "atgc".dup
|
761
762
|
class <<seq
|
762
763
|
def entry_id
|
763
764
|
271828
|