[Bioperl-l] RE: Question: How do I run SwissPfam within Bioperl ?

Jason Stajich jason.stajich at duke.edu
Wed Oct 6 11:14:57 EDT 2004


Actually I think the problem might be that 'test' is the name of the 
swisspfam data while you need to provide the idx file as the first 
argument.  Hence the first 'shift' in the script followed later by the 
iterating through the @ARGV array.

By providing 'test' as the name of the index the module is trying to 
call
tie(%hash, 'DB_File', 'test');
and expecting that since 'test' already exists it must be a DBM file 
(which it isn't, hence the error).

I think the module is written to be smart enough to fail over to SDBM 
instead of DB_File when the latter is not installed.

Try running the script like this
% perl swissPfam.pl test.idx test


However, all this said, this is not really going to 'run SwissPfam' in 
the first place, it is an indexing system for being able to quickly 
jump to different SwissPfam results in a large output file.... Not sure 
if that is what you wanted to do Misaki?

What does your 'test' file look like.

-jason

On Oct 6, 2004, at 10:53 AM, Brian Osborne wrote:

> Misaki,
>
> What the error message is saying is that the Perl module DB_File isn't
> installed, you'll need to install it. This module serves as an 
> interface to
> the Berkeley DB package, you'll need to install this as well. I've 
> always
> downloaded Berkeley DB from www.sleepycat.com.
>
> Brian O.
>
>
> -----Original Message-----
> From: Misaki Sato [mailto:misaki at sfc.keio.ac.jp]
> Sent: Wednesday, October 06, 2004 2:37 AM
> To: jason at bioperl.org; brian_osborne at cognia.com; heikki at ebi.ac.uk
> Subject: Question: How do I run SwissPfam within Bioperl ?
>
> Dear all,
>
> I found a basic structure of SwissPfam like below on some web-sites, 
> but
> still have some questions.
>
> 1, What file format does this recommend ?
>         I tried using FASTA format file "test", but failed like below.
>         Content of "swissPfam.pl" is at the bottom of this mail.
> % perl swissPfam.pl test
> ------------- EXCEPTION  -------------
> MSG: Can't open 'DB_File' dbm file 'test' :
> STACK Bio::Index::Abstract::open_dbm
> /usr/lib/perl5/site_perl/5.8.3/Bio/Index/Abstract.pm:389
> STACK Bio::Index::Abstract::new
> /usr/lib/perl5/site_perl/5.8.3/Bio/Index/Abstract.pm:150
> STACK toplevel swissPfam.pl:7
> --------------------------------------
> %
>
> 2, Are there any additional things for running this module ?
>
> 3, Could you show me an example to use this module?
>
>
> --------Content of swissPfam.pl-----------------------
> #!/usr/bin/perl -w
>    use Bio::Index::SwissPfam;
>    use strict;
>    my $Index_File_Name = shift;
>    my $inx = Bio::Index::SwissPfam->new('-filename' => 
> $Index_File_Name,
>                                         '-write_flag' => 'WRITE');
>    $inx->make_index(@ARGV);
>    use Bio::Index::SwissPfam;
>    use strict;
>    my $Index_File_Name = shift;
>    my $inx = Bio::Index::SwissPfam->new('-filename' => 
> $Index_File_Name);
>    foreach my $id (@ARGV) {
>         my $seq = $inx->fetch($id); # Returns stream
>         while( <$seq> ) {
>                 if(/^>/) {
>                         print; last;
>                 }
>         }
>    }
> -------------------------------------------
> From: 
> http://doc.bioperl.org/releases/bioperl-1.2/Bio/Index/SwissPfam.html
>
>
> Waiting for your reply.
> Thank you.
>
> Misaki Sato
> -------------------------------
> Keio Univ. SFC
> Institute for Advanced Biosciences
>                      Misaki Sato
>          misaki at sfc.keio.ac.jp
> -------------------------------
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
--
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/



More information about the Bioperl-l mailing list