[Bioperl-l] (no subject)

Luba Pardo lubapardo at gmail.com
Thu Mar 1 09:47:23 EST 2007

Dear all,
Sorry if the questions is too basic but I am trying to learn BioPerl
modules. So I am trying to get the CDS sequence from a gi identification
protein using the "features" method. I started to run the example of the FAQ
doc (How do I retrieve a nucleotide coding sequence when I have a protein gi
number?)  , but I can not get the script to run.
the script is:

use Bio::Factory::FTLocationFactory;
use Bio::DB::GenPept;
use Bio::DB::GenBank;

my $gp = Bio::DB::GenPept->new;
my $gb = Bio::DB::GenBank->new;
# factory to turn strings into Bio::Location objects
my $loc_factory = Bio::Factory::FTLocationFactory->new;
my $protein_gi = '405830';
my $prot_obj = $gp->get_Seq_by_id($protein_gi);;
foreach my $feat ( $prot_obj->top_SeqFeatures ) {
   if ( $feat->primary_tag eq 'CDS' ) {
   # example: 'coded_by="U05729.1:1..122"'
   my @coded_by = $feat->each_tag_value('coded_by');
   my ($nuc_acc,$loc_str) = split /\:/, $coded_by[0];
   my $nuc_obj = $gb->get_Seq_by_acc($nuc_acc);
   # create Bio::Location object from a string
   my $loc_object = $loc_factory->from_string($loc_str);
   # create a Feature object by using a Location
   my $feat_obj = Bio::SeqFeature::Generic->new(-location =>$loc_object);
   # associate the Feature object with the nucleotide Seq object
    my $cds_obj = $feat_obj->spliced_seq;
    print "CDS sequence is ",$cds_obj->seq,"\n";

The error I got is

------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Must specify a query or list of uids to fetch
STACK: Error::throw
STACK: Bio::Root::Root::throw
STACK: Bio::DB::NCBIHelper::get_request
STACK: Bio::DB::WebDBSeqI::get_seq_stream
STACK: Bio::DB::NCBIHelper::get_Stream_by_acc
STACK: Bio::DB::WebDBSeqI::get_Seq_by_acc
STACK: feature1.pl:16

But I can not see where part of the script is that I have to specify a list
of gi. That very odd. Am I interpreting the script wrong? I also tried :

------------- EXCEPTION: Bio::Root::Exception -------------
MSG: acc complement(join(AL593843.9 does not exist
STACK: Error::throw
STACK: Bio::Root::Root::throw
STACK: Bio::DB::WebDBSeqI::get_Seq_by_acc
STACK: feature1.pl:16

Can anyone let me know what am I doing wromg?

Thank you very much in advance

L. Pardo

More information about the Bioperl-l mailing list