block.chomp!("//" + $/ )
- entry = block.split $/
+ entry = block.tr("\r", "\n").split $/
return nil if entry.empty?
seq = @entry[j + 1 .. i].join.delete(" 0123456789")
- Seq.new(nil, seq, "dna") if seq
+ Seq.new(seq: seq, type: :dna) if seq
end
# Method to get the base keys from EMBL entry and return these
end
end
- if keys.has_key? key.to_sym
+ if keys[key.to_sym]
keys[key.to_sym] << " " + val
else
keys[key.to_sym] = val
def each
while @entry[@i] and @entry[@i][0 ... 2] != "SQ"
- if @entry[@i] =~ /^FT\s{3}([A-Za-z_-]+)/
+ if @entry[@i] =~ /^FT\s{3}([53'A-Za-z_-]+)/
if want_feat? $1
record = {}
@j = @i + 1
- while @entry[@j] and @entry[@j][0 ... 2] == "FT" and @entry[@j] !~ /^FT(\s{19}\/|\s{3}[A-Za-z_-])/
+ while @entry[@j] and @entry[@j][0 ... 2] == "FT" and @entry[@j] !~ /^FT(\s{19}\/|\s{3}[53'A-Za-z_-])/
loc << @entry[@j].split(/\s+/, 2).last
@j += 1
end
quals = {}
k = 0
- while @entry[@j] and @entry[@j][0 ... 2] == "FT" and @entry[@j] !~ /^FT\s{3}[A-Za-z_-]/
+ while @entry[@j] and @entry[@j][0 ... 2] == "FT" and @entry[@j] !~ /^FT\s{3}[53'A-Za-z_-]/
if @entry[@j] =~ /^FT\s{19}\/([^=]+)="([^"]+)/
qual = $1
val = $2
if want_qual? qual
k = @j + 1
- while @entry[k] and @entry[k][0 ... 2] == "FT" and @entry[k] !~ /^FT(\s{19}\/|\s{3}[A-Za-z_-])/
+ while @entry[k] and @entry[k][0 ... 2] == "FT" and @entry[k] !~ /^FT(\s{19}\/|\s{3}[53'A-Za-z_-])/
val << @entry[k].split(/\s+/, 2).last.chomp('"')
k += 1
end