[Bioperl-l] Get nucleic CDS sequence from Genbank files using spliced_seq

Jason Stajich jason at bioperl.org
Fri Oct 12 12:18:15 EDT 2007


1.

Always 'use strict;' in your code - you'll see the bug more clearly  
that you should use $feat not $cds in the if stmt.


2.
You should pass in an actual Bio::DB::GenBank object to the -db  
argument.

my $db = Bio::DB::GenBank->new;
my $cds = $seq->spliced_seq(-db => $db);

-jason
On Oct 12, 2007, at 1:48 AM, Johann PELLET wrote:

> Hi,
> I have two questions:
> First, I have problems for example with this genbank entry: NC_008210.
> Indeed, for one CDS, the location is :
> join(161990..162784,complement(88222..88806),complement(86666..87448))
>
> When I parse a genbank file with this entry.
>
> my $seq_in  = Bio::SeqIO->new( -format => 'genbank',
>                                -file => $input_file);
>
> while( my $seq = $seq_in->next_seq() ) {
>     my @features = $seq->get_SeqFeatures();
>     for ( my $i =0; $i < scalar @features; $i++ ){
>         my $feat = @features[$i];
>          if ( $feat->primary_tag eq 'CDS' ){
>
>
>              my $seq_CDS_obj=$cds->spliced_seq( -nosort => 0);
>              my $seq_CDS=$seq_CDS_obj->seq;
>


>
> I have this error:
> Can't call method "isa" without a package or object reference at ....
>
> Secondly, When location is like:
> join(complement(AY421753.1:1..6),complement(3813..5699)) I know  
> that we
> must use spliced_seq with the argument db, but it's not working.
>       my $seq_CDS_obj=$cds->spliced_seq( -db => "genbank");
> How can we valid a Bio::DB::RandomAccessI?
>
> Thanks
>
> -- 
> Johann Pellet
> phone (work): +33(0)4 37282352
> E-mail:    pellet at cervi-lyon.inserm.fr
> Centre d'Etudes et de Recherche en Virologie et Immunologie
> INSERM U503
> 21, Avenue Tony Garnier
> 69365 Lyon cedex 07 France
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

--
Jason Stajich
jason at bioperl.org




More information about the Bioperl-l mailing list