[Bioperl-l] indexing and accessing local database

Brian Osborne brian_osborne@cognia.com
Tue, 9 Jul 2002 15:32:27 -0400


Qunfeng,

>> I couldn't find any Doc about how to reuse the index instead of
generating it every time.

I believe you use the same new() call again, even if the index file is
already made. Take a look at the documentation inside Bio::DB::Fasta, it
sounds like the module is "smart", it knows whether new indices should be
created or not. Of course if it doesn't work at all...

Brian O.

-----Original Message-----
From: bioperl-l-admin@bioperl.org [mailto:bioperl-l-admin@bioperl.org]On
Behalf Of Qunfeng Dong
Sent: Tuesday, July 09, 2002 2:29 PM
To: Brian Osborne
Cc: bioperl-l@bioperl.org
Subject: RE: [Bioperl-l] indexing and accessing local database

No,it didn't print anything, even though AF468672 is one of the accession
number
in the indexed fasta file.

Qunfeng

> Qunfeng,
>
> But did the "print $seq->seq" print anything printable?
>
> Brian O.
>
> -----Original Message-----
> From: Qunfeng Dong [mailto:qfdong@iastate.edu]
> Sent: Tuesday, July 09, 2002 2:18 PM
> To: Brian Osborne
> Cc: bioperl-l@bioperl.org
> Subject: RE: [Bioperl-l] indexing and accessing local database
>
> Brian, Thanks for the suggestion, I didn't use Bio::DB::Fasta because I
> couldn't
> find any Doc about how to reuse the index instead of generating it every
> time.
> Anyway, I tried the following code
> ****************************************
> #!/usr/bin/perl -w
> #name: DBindex.pl
> use Bio::DB::Fasta;
> $File_Name = shift;
> $inx = Bio::DB::Fasta->new($File_Name);
> $seq = $inx->get_Seq_by_id("AF468672");
> print $seq->seq;
> *****************************************
> then ran it as
> % DBindex.pl fastaFile
> then I got the following error msg
>
> Use of uninitialized value in numeric lt (<) at
> /usr/lib/perl5/site_perl/5.6.1/Bio/DB/Fasta.pm line 604.
> Odd number of elements in hash assignment at
> /usr/lib/perl5/site_perl/5.6.1/Bio/DB/Fasta.pm line 969.
> Use of uninitialized value in numeric gt (>) at
> /usr/lib/perl5/site_perl/5.6.1/Bio/DB/Fasta.pm line 817.
>
>
>
> Something must be wrong. Maybe I shouldn't use BioPerl and stick to the
> blast
> database with fastacmd :-)
>
>
> Qunfeng
>
>
> > Qunfeng,
> >
> > I'm also seeing a segmentation fault on my Cygwin/Windows machine with
> code
> > like yours, using Bio::Index::Fasta. But I'm surprised that I can index
> > using Bio::DB::Fasta. If you don't care which indexing module you're
using
> > then I suggest you try something like this and see what happens:
> >
> > use Bio::DB::Fasta;
> > $File_Name = shift;
> > $inx = Bio::DB::Fasta->new($File_Name);
> > $seq = $inx->get_Seq_by_id("P8413");
> > print $seq->seq;
> >
> >
> > Brian O.
> >
> > -----Original Message-----
> > From: bioperl-l-admin@bioperl.org [mailto:bioperl-l-admin@bioperl.org]On
> > Behalf Of Qunfeng Dong
> > Sent: Tuesday, July 09, 2002 12:44 PM
> > To: Jason Stajich
> > Cc: bioperl-l@bioperl.org
> > Subject: Re: [Bioperl-l] indexing and accessing local database
> >
> > It's Linux and perl 5 (and when I install bioperl, perl is also
installed)
> >
> >
> > > What operating system are you using and version of Perl?
> > >
> > > On Tue, 9 Jul 2002, Qunfeng Dong wrote:
> > >
> > > > Hi,
> > > >
> > > > I am trying to follow the sample code from
> > > >
> >
>
http://bioperl.org/Core/POD/bptutorial.html#III_1_1_Accessing_remote_databas
> > > >
> > > > to build a local fasta sequence database
> > > >  #!/usr/bin/perl -w
> > > >  #scriptName - BuildIndex.pl
> > > >   use Bio::Index::Fasta; # using fasta file format
> > > >   $Index_File_Name = shift;
> > > >   $inx = Bio::Index::Fasta->new(
> > > >       -filename => $Index_File_Name,
> > > >       -write_flag => 1);
> > > >   $inx->make_index(@ARGV);
> > > >
> > > >
> > > > then I ran the script BuildIndex.pl as
> > > > % BuildIndex.pl indexName FastaSeqName
> > > > and I got Segmentation fault. Any idea why?
> > > >
> > > > Qunfeng Dong
> > > >
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > Bioperl-l mailing list
> > > > Bioperl-l@bioperl.org
> > > > http://bioperl.org/mailman/listinfo/bioperl-l
> > > >
> > >
> > > --
> > > Jason Stajich
> > > Duke University
> > > jason at cgt.mc.duke.edu
> > >
> > >
> >
> >
> > Qunfeng Dong, Ph.D
> > ZmDB Manager
> > 2104 Molecular Biology Building
> > Iowa State University
> > Ames, IA 50010
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l@bioperl.org
> > http://bioperl.org/mailman/listinfo/bioperl-l
> >
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l@bioperl.org
> > http://bioperl.org/mailman/listinfo/bioperl-l
> >
>
>
> Qunfeng Dong, Ph.D
> ZmDB Manager
> 2104 Molecular Biology Building
> Iowa State University
> Ames, IA 50010
>
>
>
>
>
>
>
>


Qunfeng Dong, Ph.D
ZmDB Manager
2104 Molecular Biology Building
Iowa State University
Ames, IA 50010






_______________________________________________
Bioperl-l mailing list
Bioperl-l@bioperl.org
http://bioperl.org/mailman/listinfo/bioperl-l