[BioRuby] Problem with Bio::GFF::GFF2
George Githinji
georgkam at gmail.com
Tue Jun 9 12:26:45 UTC 2009
Hi all,
I am try to parse a GFF file. The file looks like this
##gff-version 2
##source-version bepipred-1.0b
##date 2009-06-09
##Type Protein seq1
# seqname source feature start end score N/A ?
#
---------------------------------------------------------------------------
seq1 bepipred-1.0b epitope 1 1 0.173 . . .
seq1 bepipred-1.0b epitope 2 2 -0.043 . . .
seq1 bepipred-1.0b epitope 3 3 -0.014 . . .
seq1 bepipred-1.0b epitope 4 4 0.144 . . .
seq1 bepipred-1.0b epitope 5 5 0.250 . . .
seq1 bepipred-1.0b epitope 6 6 0.218 . . .
....truncated
and i have written the following lines with an aim of extracting the start,
end and score attributes. but before that i wanted to know whether the full
attributes are available. so i did the following.
require 'rubygems'
require 'bio'
bep_gff = Bio::GFF::GFF2.new(File.open('/home/george/bpred.gff'))
bep_gff.records.each do |record|
puts record.attributes_to_hash.inspect
end
However, i get empty hashes.
Any ideas?
Thank you
--
---------------
Sincerely
George
Skype: george_g2
Blog: http://biorelated.wordpress.com/
More information about the BioRuby
mailing list