[Bioperl-l] Help in retrieving the DEFINITION line

Dave Messina David.Messina at sbc.su.se
Tue Oct 19 16:03:08 EDT 2010


Hi Anjan,

You can get to the definition directly, via the desc() method.

So, this works:

use strict;
use warnings;
use Bio::Perl;
use Bio::DB::GenBank;
my $gb= new Bio::DB::GenBank;

open(F, "test_id");

while(<F>){
	chomp;
	my $id= $_;
	my $seq= $gb->get_Seq_by_acc("$id");

	# I added these lines:
	my $definition      = $seq->desc;
        print $definition, "\n";}
}



Dave



More information about the Bioperl-l mailing list