[Bioperl-l] (no subject)
Sendu Bala
bix at sendu.me.uk
Fri Mar 2 13:35:34 UTC 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?)
[
http://www.bioperl.org/wiki/FAQ#How_do_I_retrieve_a_nucleotide_coding_sequence_when_I_have_a_protein_gi_number.3F
]
[snip]
> 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];
[snip]
> The error I got is
>
> ------------- EXCEPTION: Bio::Root::Exception -------------
> MSG: Must specify a query or list of uids to fetch
[snip]
> 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:
http://www.bioperl.org/wiki/FAQ#How_do_I_get_the_complete_spliced_nucleotide_sequence_from_the_CDS_section.3F
More information about the Bioperl-l
mailing list