hi Mike,

If I well understood your question, you want to index a fasta file to
fetch it. For that puropose, I already wrote a perl scirpt to do that
(view attachment). It is a very simple script, run it without any
parameters to get a description on the fine way to use it. This file
will create an index file that you can fetch it:

e. g; once you create your index file (myfile.idx) by the attached
script, you can fetch any sequence(id) by :

my $indexFile = Bio::Index::Fasta->new(myfile.idx);
my $seq = $indexFile->fetch(id);

Hope this help

Pierre

On Tue, 2006-03-21 at 11:09 -0600, Mike Muratet wrote:

> Greetings
> 
> I am trying to get index/fetch some fasta files with Bio::Registry and 
> Bio::DB::Flat. I created a seqdatabase.ini in $HOME/.bioinformatics 
> containing:
> 
> VERSION=1.00
> 
> [fungal_genomes]
> protocol=flat
> location=/opt/mmuratet/fungal_genomes
> dbname=fungal_genomes
> 
> I used the release script bp_bioflat_index.pl to index the files in 
> /opt/mmuratet/fungal_genomes and there is a binary key_acc file and a 
> config file whose first few lines are:
> 
> index   BerkeleyDB/1
> format  URN:LSID:open-bio.org:fasta/dna
> fileid_11 
> /opt/mmuratet/fungal_genomes/fusarium_verticillioides_2.fasta   42688995
> 
> I couldn't get my own script to work, so I tried the bp_biogetseq.pl 
> script:
> 
> bp_biogetseq.pl --dbname fungal_genomes --format fasta \
> --namespace acc 'Aspergillus nidulans supercontig 1.5'
> 
> -------------------- WARNING ---------------------
> MSG: Couldn't call new_from_registry on [Bio::DB::Flat]
> 
> ------------- EXCEPTION  -------------
> MSG: you must specify an indexing scheme
> STACK Bio::DB::Flat::new /usr/lib/perl5/site_perl/5.8.5/Bio/DB/Flat.pm:163
> STACK Bio::DB::Flat::new_from_registry 
> /usr/lib/perl5/site_perl/5.8.5/Bio/DB/Flat.pm:255
> STACK (eval) /usr/lib/perl5/site_perl/5.8.5/Bio/DB/Registry.pm:183
> STACK Bio::DB::Registry::_load_registry 
> /usr/lib/perl5/site_perl/5.8.5/Bio/DB/Registry.pm:182
> STACK Bio::DB::Registry::new 
> /usr/lib/perl5/site_perl/5.8.5/Bio/DB/Registry.pm:95
> STACK toplevel /usr/bin/bp_biogetseq.pl:28
> 
> --------------------------------------
> 
> ---------------------------------------------------
> Could not find sequence with identifier [Aspergillus nidulans supercontig 
> 1.5]
> 
> Can anyone see anything I've done wrong? It all seems in agreement with 
> the documentation. I found a few old threads but I can't see where it ever 
> got resolved. I have set the environment variables OBDA_INDEX=bdb and 
> OBDA_LOCATION=/opt/mmuratet/fungal_genomes.
> 
> Thanks
> 
> Mike
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
