[Bioperl-l] genbank to fasta conversion
Chris Fields
cjfields at illinois.edu
Thu Aug 20 20:38:03 UTC 2009
You are passing filehandles in, not file names. Switch the '-file'
parameter to '-fh'.
chris
On Aug 20, 2009, at 3:31 PM, Mgavi Brathwaite wrote:
> 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
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list