[Bioperl-l] genbank to fasta conversion

Mgavi Brathwaite lsbrath at gmail.com
Thu Aug 20 20:31:20 UTC 2009


Hello,

I have previously converted multiple genbank files to fasta. For some reason
I am having trouble with this simple script.
#!/usr/bin/perl -w
use strict;
use Bio::SeqIO;

open (my $inFile, "C:/Documents and Settings/mydir/Desktop/TARGETING.gb");
open (my $outfile, ">C:/Documents and Settings/mydir/Desktop/TARGET.fa");
my $in  = Bio::SeqIO->new('-file' => "$inFile" ,
                           '-format' => 'GenBank');
my $out = Bio::SeqIO->new('-file' => "$outfile" ,'-format' => 'Fasta');
print $out $_ while <$in>;

I keep getting the error:
------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Could not open GLOB(0x36a214): No such file or directory
STACK: Error::throw
STACK: Bio::Root::Root::throw C:/Perl/site/lib/Bio/Root/Root.pm:359
STACK: Bio::Root::IO::_initialize_io C:/Perl/site/lib/Bio/Root/IO.pm:310
STACK: Bio::SeqIO::_initialize C:/Perl/site/lib/Bio/SeqIO.pm:454
STACK: Bio::SeqIO::genbank::_initialize C:/Perl/site/lib/Bio\SeqIO\
genbank.pm:202
STACK: Bio::SeqIO::new C:/Perl/site/lib/Bio/SeqIO.pm:351
STACK: C:/Perl/site/lib/Bio/SeqIO.pm:377
-----------------------------------------------------------

I am probably missing something simple, but would appreciate any help.

M



More information about the Bioperl-l mailing list