#!/usr/bin/perl -w # this is using code on the lightweight_feature_branch so # cvs -d:ext:USERNAME@pub.open-bio.org:/home/repository/bioperl co -r lightweight_feature_branch -d core_lwf bioperl-live # run it with perl -I /path/to/core_lwf seqfeature_speed.pl use strict; use Benchmark qw(:all); use Bio::Tools::GFF; my $count = shift || 3; cmpthese($count, { 'Slim' => '&parse("sgd.gff3","Bio::SeqFeature::Slim");', 'Generic' => '&parse("sgd.gff3","Bio::SeqFeature::Generic");', 'GraphicsF'=> '&parse("sgd.gff3","Bio::Graphics::Feature");', }); sub parse { my ($file,$type) = @_; my $len; my $in = Bio::Tools::GFF->new (-gff_version => 3, -file => $file, -feature_type => $type); my @name; while( my $f = $in->next_feature ) { $len += $f->length; push @name, $f->display_name; } }