[bioruby] get DNA sequences described in a GFF file via DAS

class Bio::GFF::Record
  def to_segment
    start , stop =  self.start.to_i , self.end.to_i
    start , stop = stop , start if start > stop
    return Bio::DAS::SEGMENT.region(self.seqname, start, stop)
  end
end
das =   Bio::DAS.new('http://genome.ucsc.edu/cgi-bin/')

Bio::FlatFile.open(Bio::GFF,gff_file).each{|gff|
  gff.records.each{|r|
    seg = r.to_segment
    puts das.get_dna('hg17', seg)[0].sequence
  }
}