[BioRuby] db/embl/embl.rb
Michael Han
mh6 at sanger.ac.uk
Tue Mar 13 12:57:21 UTC 2007
Hi,
I think the bioruby embl parser is slightly broken with the last EMBL
format.
I did some changes to the embl.rb that should fix it.
Could someone have a look at the changes?
thanks,
Michael
---------------------- db/embl/embl.rb ----------
# added the new fields to the id_line parser
def id_line(key=nil)
unless @data['ID']
tmp = Hash.new
idline = fetch('ID').split(/; +/)
tmp['ENTRY_NAME'], tmp['DATA_CLASS'] = idline[0].split(/ +/)
tmp['SEQUENCE_VERSION'] = idline[1]
tmp['MOLECULE_CLASS'] = idline[2]
tmp['MOLECULE_TYPE'] = idline[3]
tmp['DIVISION'] = idline[4]
tmp['SEQUENCE_LENGTH'] = idline[5].strip.split(' ').first.to_i
@data['ID'] = tmp
end
if key
@data['ID'][key]
else
@data['ID']
end
end
# and for the sequence version
def sv
id_line('SEQUENCE_VERSION')
end
def version
sv.split(" ")[1].to_i
end
More information about the BioRuby
mailing list