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

Brian Osborne brian_osborne at cognia.com
Fri Dec 12 10:56:01 EST 2003


Vince,

But the GenBank id, AB072353, works?

Brian O.

-----Original Message-----
From: bioperl-l-bounces at portal.open-bio.org
[mailto:bioperl-l-bounces at portal.open-bio.org]On Behalf Of Vince Forgetta
Sent: Friday, December 12, 2003 10:50 AM
To: Brian Osborne
Cc: bioperl-l at bioperl.org
Subject: Re: [Bioperl-l] using Bio::DB::GenBank get translation

It doesn't seem to work if I try NM_021044 or AF148226. the first is a
RefSeq, the second has a wierd trnaslation field.

Thanks

Brian Osborne wrote:

>Vince,
>
>Your code looked correct to me, I was puzzled, so I ran it and it worked.
>Here's the output:
>
>No translation
>1..864
>No translation
>No translation
>No translation
>No translation
>No translation
>
>Here's the code:
>
>use Bio::DB::GenBank;
>my $gb = new Bio::DB::GenBank;
>my $seq;
>my $accession = shift or die "No accession\n";
>
>$seq = $gb->get_Seq_by_acc($accession);
>
>foreach my $feat ($seq->all_SeqFeatures){
>   my $CDS = "";
>   if ($feat->has_tag('translation')){
>      $CDS = $feat->start."..".$feat->end;
>      print "$CDS\n";
>   }else{
>      print "No translation\n";
>   }
>}
>
>Try it with accession "AB072353", for example.
>
>Brian O.
>
>
>-----Original Message-----
>From: bioperl-l-bounces at portal.open-bio.org
>[mailto:bioperl-l-bounces at portal.open-bio.org]On Behalf Of Vince Forgetta
>Sent: Friday, December 12, 2003 10:13 AM
>To: bioperl-l at bioperl.org
>Subject: [Bioperl-l] using Bio::DB::GenBank get translation
>
>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
>
>
>
>
>


--
+-----------------------------------------------------------+
|  Vincenzo Forgetta                                        |
|  Computational Biology                                    |
|  McGill University and Genome Quebec Innovation Centre    |
|  740 Dr. Penfield Avenue                                  |
|  Room 7211                                                |
|  Montreal, Quebec Canada, H3A 1A4                         |
|  Tel: 514-398-3311 00476                                  |
|  Email: vince.forgetta at staff.mcgill.ca                    |
+-----------------------------------------------------------+



_______________________________________________
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