[Bioperl-l] Help in retrieving the DEFINITION line

ANJAN PURKAYASTHA anjan.purkayastha at gmail.com
Tue Oct 19 13:49:11 EDT 2010


Hi,
I need to retrieve the DEFINITION line of a GenBank file, given the GenBank
accession ID.
The following code does not seem to do it:

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");
my $anno_collection = $seq->annotation;
my @annotations = $anno_collection->get_Annotations('definition');
print ("@annotations\n");
}

Any thoughts on how to get this done will be deeply appreciated.
Thanks,
Anjan

-- 
===================================
anjan purkayastha, phd.
research associate
fas center for systems biology,
harvard university
52 oxford street
cambridge ma 02138
phone-703.740.6939
===================================


More information about the Bioperl-l mailing list