[Bioperl-l] New bioperl NT user

Jason Stajich jason@cgt.mc.duke.edu
Tue, 16 Apr 2002 14:28:32 -0400 (EDT)


You're not using it correctly - you need to create an index of the EMBL
flatfile, so
my $Index_File_Name = "CALBI.idx";
my $Data_File_Name = "CALBI.embl";
my $inx = Bio::Index::EMBL->new('-filename'   => $Index_File_Name,
                                '-write_flag' => 1);
$inx->make_index($Index_File_Name); # will accept an array of filenames here

my $out = Bio::SeqIO->new('-format' => 'Fasta','-fh' => \*STDOUT);

foreach my $id (@ARGV) {
       my $seq = $inx->fetch($id); # Returns Bio::Seq object
       $out->write_seq($seq) if( $seq ); # protect this in case you enter
	                                 # an unknown id/accession
}

On Tue, 16 Apr 2002, Pedro Beltrão wrote:

> I can't seem to just open a local index for a EMBL flat file. The script is
> in the same directory has the the flat file but the script returns a "No
> such file or directory" error. I tryed on the same script a file open and
> it goes okay.
> I would appreciate any info on the problem or where to learn more about it.
>
>
> Code:
> #----------------------------------------------
> use Bio::Index::EMBL;
>
> my $Index_File_Name = "CALBI.embl";
> my $inx = Bio::Index::EMBL->new('-filename' => $Index_File_Name);
>
> my $out = Bio::SeqIO->new('-format' => 'Fasta','-fh' => \*STDOUT);
>
> foreach my $id (@ARGV) {
> 	my $seq = $inx->fetch($id); # Returns Bio::Seq object
> 	$out->write_seq($seq);
> }
> ------------- EXCEPTION  -------------
> MSG: Can't open 'SDBM_File' dbm file 'CALBI.embl' : No such file or
> directory
> STACK Bio::Index::Abstract::open_dbm
> C:/Perl/site/lib/Bio/Index/Abstract.pm:393
> STACK Bio::Index::Abstract::new C:/Perl/site/lib/Bio/Index/Abstract.pm:151
> STACK Bio::Index::AbstractSeq::new
> C:/Perl/site/lib/Bio/Index/AbstractSeq.pm:91
> STACK toplevel parseEMBL2.pl:9
>
> --------------------------------------
>

-- 
Jason Stajich
Duke University
jason@cgt.mc.duke.edu