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

Denis Pugnere Denis.Pugnere@igh.cnrs.fr
Wed, 29 Aug 2001 18:32:12 +0200 (CEST)


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 :

-- 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