[Bioperl-l] (no subject)

Sendu Bala bix at sendu.me.uk
Fri Mar 2 08:35:34 EST 2007

Luba Pardo wrote:
> 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?)


> 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];
> The error I got is
> ------------- EXCEPTION: Bio::Root::Exception -------------
> MSG: Must specify a query or list of uids to fetch
> 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?

If you use warnings you'd have seen a problem on the line with the 
split: @coded_by is empty. This is because you aren't supplying a 
protein GI. In this case it would be 405831, not 405830. 405830 is 
already the nucleotide GI so you don't need to do this stuff with 
coded_by. Use the code in the next section of the FAQ instead:


More information about the Bioperl-l mailing list