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

Jason Stajich jason at cgt.duhs.duke.edu
Fri Dec 12 10:41:56 EST 2003


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


More information about the Bioperl-l mailing list