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(nil, seq, :dna) if seq
end
# Method to get the base keys from Genbank entry and return these
j += 1
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] !~ /^ORIGIN/
- if @entry[@i] =~ /^\s{5}([A-Za-z_-]+)/
+ if @entry[@i] =~ /^\s{5}([53'A-Za-z_-]+)/
if want_feat? $1
record = {}
@j = @i + 1
- while @entry[@j] and @entry[@j] !~ /^(\s{21}\/|\s{5}[A-Za-z_-]|[A-Z])/
+ while @entry[@j] and @entry[@j] !~ /^(\s{21}\/|\s{5}[53'A-Za-z_-]|[A-Z])/
loc << @entry[@j].lstrip
@j += 1
end
quals = {}
k = 0
- while @entry[@j] and @entry[@j] !~ /^\s{5}[A-Za-z_-]|^[A-Z]/
+ while @entry[@j] and @entry[@j] !~ /^\s{5}[53'A-Za-z_-]|^[A-Z]/
if @entry[@j] =~ /^\s{21}\/([^=]+)="([^"]+)/
qual = $1
val = $2
if want_qual? qual
k = @j + 1
- while @entry[k] and @entry[k] !~ /^(\s{21}\/|\s{5}[A-Za-z_-]|[A-Z])/
+ while @entry[k] and @entry[k] !~ /^(\s{21}\/|\s{5}[53'A-Za-z_-]|[A-Z])/
val << @entry[k].lstrip.chomp('"')
k += 1
end