[Bioperl-l] Bio::index::Fasta- where's the indexed file?

zhihua li lzhtom at hotmail.com
Tue Feb 6 03:31:56 UTC 2007


Thanks a lot!

After checking out the script bp_index, I changed the syntax to:
 my $inx = Bio::Index::Fasta->new("test.fasta.idx", 'WRITE');
$inx->make_index("test.fasta");


Now I have a index file test.fasta.idx in my current directory. And I can 
use it in my later script
by saying 
 my $inx = Bio::Index::Fasta->new(-filename => "test.fasta.idx");

So now everything is OK. But I don't understand why I have to use that 
syntax. And why the syntax provided in the document didn't work?






>From: Jason Stajich <jason at bioperl.org>
>To: zhihua li <lzhtom at hotmail.com>
>CC: bioperl-l at lists.open-bio.org, arokfl at yahoo.com
>Subject: Re: [Bioperl-l] Bio::index::Fasta- where's the indexed file?
>Date: Thu, 1 Feb 2007 22:24:44 -0800
>
>I don't think BIOPERL_INDEX does anything in the module so that
>documentation is not quite right.  the env variable is used in the
>scripts/index/bp_index and bp_fetch scripts so maybe a cut+paste job
>went bad somewhere.
>
>you need to specify the full path you want with -filename - you can
>just prepen the BIOPERL_INDEX to the filename like.
>-filename => $ENV{BIOPERL_INDEX}."/$index"
>
>-jason
>On Feb 1, 2007, at 7:27 PM, zhihua li wrote:
>
> > Sorry guys, the former empty mail was sent out by mistake.
> >
> > I'm using Bio::index::Fasta to index a file containing lots of
> > sequences in fasta format. All is fine except one thing.
> >
> > According to the bioperl tutorial and the documents, the following
> > code will make a indexed file:
> >
> > my $inx = Bio::Index::Fasta->new(-filename => "test.fasta.idx",
> >                                     -write_flag => 1);
> >    $inx->make_index("test.fasta");
> >
> > And in another script I can access the indexed file by sayinig
> >
> > $ENV{BIOPERL_INDEX} = "."; # find index in current directory
> > my $inx = Bio::Index::Fasta->new(-filename => "test.fasta.idx");
> > my $seq=$inx->fetch("ent1001");        #fetch the sequence named
> > ent1001
> >
> > However, after running the first script, I cannot find a new file
> > test.fasta.idx in my current directory. And not surprisingly, when
> > I ran the second script, perl told me it couldn't find
> > "test.fasta.idx".
> >
> > What's going on here?
> >
> > Thanks a lot!
> >
> > _________________________________________________________________
> > 与联机的朋友进è?交流,è?使用 MSN Messenger:  http://
> > messenger.msn.com/cn
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at lists.open-bio.org
> > http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>--
>Jason Stajich
>Miller Research Fellow
>University of California, Berkeley
>lab: 510.642.8441
>http://pmb.berkeley.edu/~taylor/people/js.html
>http://fungalgenomes.org/
>
>
>_______________________________________________
>Bioperl-l mailing list
>Bioperl-l at lists.open-bio.org
>http://lists.open-bio.org/mailman/listinfo/bioperl-l

_________________________________________________________________
Ãâ·ÑÏÂÔØ MSN Explorer:   http://explorer.msn.com/lccn/  




More information about the Bioperl-l mailing list