[Bioperl-l] writing GFF3

Torsten Seemann torsten.seemann at infotech.monash.edu.au
Thu Feb 11 06:43:04 EST 2010

> I would like to create some GFF3 that
> I can load into GBrowse. I could just print the 9 columns, but I'm sure
> there is something that could do this better/already. I found two packages
> in BioPerl, which one should I be using?
> Bio::FeatureIO::gff
> Bio::Tools::gff
> Also, I vaguely recall something being said about deprecating Bio::FeatureIO
> at the BioPerl meeting in San Diego (prior to the GMOD meeting.) -- or I
> could be mixing things up.

I have done similar things to you, and here is the skeleton code I use
based on Bio::Tools::GFF. (FeatureIO::GFF is problematic). Just fill
in the ? with values from your %diff hash.

use Bio::Tools::GFF;
use Bio::SeqFeature::Generic;

my $gff_factory = Bio::Tools::GFF->new(-gff_version=>3);

print "##gff-version 3\n";

for my $diff (keys %diff) {
  my $feature = Bio::SeqFeature::Generic->new(
    -seq_id     => ?,    -source_tag => ?,    -primary    => ?,
    -start      => ?,    -end        => ?,    -strand     => ?,
    -tag        => {      'name' => ?,      'name' =>  ?   }
  print $feature->gff_string($gff_factory), "\n";

--Torsten Seemann
--Victorian Bioinformatics Consortium, Dept. Microbiology, Monash
University, AUSTRALIA

More information about the Bioperl-l mailing list