[Bioperl-l] Genbank file parsing with $gb = new Bio::SeqIO->new(...)

Ewan Birney birney@ebi.ac.uk
Wed, 29 Aug 2001 17:39:01 +0100 (BST)


On Wed, 29 Aug 2001, Denis Pugnere wrote:

> 
> I'm debugging my code to I relaunch often my script which does blast,
> blast output parsing, genbank file parsing and feature parsing...
> 
> I don't want to use each time the :
> 
> -- perl code :
> $gb = new Bio::DB::GenBank;
> $seqgenbank = $gb->get_Seq_by_acc($nomhit);
> --
> 
> so I save it locally (with the write_seq(seqgenbank) method) and I test if
> the file exists and read the file instead for the next time I lauch again 
> my buggy script :

what format have you written it in (ie, what SeqIO output stream did you
put it in). 


This should work ;)



> 
> -- perl code :
> if (-e "genbank.$nomhit") { 
> 	$gb = new Bio::SeqIO->new( '-file' => "genbank.$nomhit",'-format' => 'genbank' );
> 	$seqgenbank = $gb->next_seq();
> }
> --
> 
> so with these 2 last lines, I have an EXCEPTION :
> MSG: Attempting to set the sequence to [DEFINITIONDrosophilamelanogastergenomicscaffold14
> ... 10 lines of genbank header ...
> ] which does not look healthy
> STACK Bio::PrimarySeq::seq /usr/local/lib/perl5/site_perl/5.6.0/Bio/PrimarySeq.pm:243
> STACK Bio::PrimarySeq::new /usr/local/lib/perl5/site_perl/5.6.0/Bio/PrimarySeq.pm:218
> STACK Bio::Seq::new /usr/local/lib/perl5/site_perl/5.6.0/Bio/Seq.pm:132
> STACK Bio::SeqIO::fasta::next_primary_seq /usr/local/lib/perl5/site_perl/5.6.0/Bio/SeqIO/fasta.pm:130
> STACK Bio::SeqIO::fasta::next_seq /usr/local/lib/perl5/site_perl/5.6.0/Bio/SeqIO/fasta.pm:85
> STACK toplevel gaga.pl:127
> -------------------------------------------
> 
> I suspect it guesses a fasta format !?
> 
> Denis Pugnère
> ---
> Denis.Pugnere@igh.cnrs.fr | IGH/CNRS UPR 1142, 141 Rue de la Cardonille
> Tel : +33 (0)4 9961.9909  |     34396 Montpellier Cedex 5, France
> Fax : +33 (0)4 9961.9901  |           http://www.igh.cnrs.fr
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
> 

-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>. 
-----------------------------------------------------------------