[Bioperl-l] using Bio::DB::GenBank get translation

Simon, Deborah Deborah.Simon at ingenium-ag.com
Fri Dec 12 10:57:59 EST 2003


I do something like...

use Bio::DB::GenBank;
my $gb = new Bio::DB::GenBank;

my $seqobj = $gb->get_Seq_by_gi($gi); 
foreach my $featobj ( $seqobj->top_SeqFeatures() ) 
   { 
	if ($featobj->primary_tag eq "CDS")
	{
	print $featobj->start;
	print $featobj->end;
	}	
   }

... always works fine for me. If this is not the "right" way please let me know.

-deb 

> -----Original Message-----
> From: Jason Stajich [mailto:jason at cgt.duhs.duke.edu]
> Sent: Friday, 12. December 2003 16:42
> To: Vince Forgetta
> Cc: bioperl-l at bioperl.org
> Subject: Re: [Bioperl-l] using Bio::DB::GenBank get translation
> 
> 
> Code for local and remotely obtained sequences should be 
> identical - that
> is the whole point of the engineering these 
> Sequence/Feature/Annotation
> objects.
> 
> 
> Does the accession actually have a translation tag when you pull
> it up in Entrez?
> 
> -jason
> On Fri, 12 Dec 2003, Vince Forgetta wrote:
> 
> > Hi all,
> >
> > i have seen on some previous posts that you can retrieve 
> the CDS start
> > and stop from a GenBank DNA sequence accessionif the file is stored
> > locally and read in using Bio::SeqIO. How would I retrieve the
> > translation start and stop of a GenBank accession downloaded using
> > Bio::DB::GenBank. For example, the code below does not seem 
> to find a
> > tag "translation":
> >
> > use Bio::DB::GenBank;
> > my $gb = new Bio::DB::GenBank;
> > my $seq;
> >  my $accession;
> >  $seq = $gb->get_Seq_by_acc($accession);
> >  while (not(defined($seq)));
> > foreach my $feat ($seq->all_SeqFeatures()){
> >         my $CDS = "";
> >         if ($feat->has_tag('translation')){
> >         $CDS = $feat->start."..".$feat->end;
> >         return "$CDS\n";
> >     }else{
> >         return "Not found\n";
> >     }
> >
> >
> > Thank you for your time.
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at portal.open-bio.org
> > http://portal.open-bio.org/mailman/listinfo/bioperl-l
> >
> 
> --
> Jason Stajich
> Duke University
> jason at cgt.mc.duke.edu
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 



More information about the Bioperl-l mailing list