[Bioperl-l] Bio::Index:SwissPfam file loading problem

Jason Stajich jason.stajich at gmail.com
Wed Jul 20 01:22:45 UTC 2011


As the documentation says, you want to do this:

 my $inx = Bio::Index::SwissPfam->new('-filename' => $Index_File_Name, 
                         					 '-write_flag' => 'WRITE');
# $inx->make_index(@ARGV);
$inx->make_index($swisspfam_file);  # in your case do this

Where $Index_File_Name is the name of the index file you want to create and $swisspfam_file is the name of the datafile you want to process.

Hope that helps.
Jason

On Jul 19, 2011, at 6:38 AM, Eden Dr wrote:

> Hi
> 
> I'm trying to use Bio::Index::SwissPfam module as in the documentation's
> example.
> The file : swisspfam from pfam ftp, current_release:
> ftp://ftp.sanger.ac.uk/pub/databases/Pfam/current_release
> the code:
> use strict;
> use Getopt::Long;
> use File::Basename;
> use Pg;
> use sigtrap 'handler' => \&handle_interrupt, 'INT';
> use Bio::SeqIO;
> use Bio::Index::SwissPfam;
> 
> my $pfam_domains_fasta_file = $ARGV[0];
> 
> my $inx = Bio::Index::SwissPfam->new('-filename' =>
> $pfam_domains_fasta_file);
> my $seq = $inx->fetch('005L_IIV3'); # Returns stream
> while( <$seq> ) {
>    if(/^>/) {
>    print;
> last;
>    }
> }
> exit;
> 
> and I get the following error message:
> 
> ------------- EXCEPTION: Bio::Root::Exception -------------
> MSG: Can't open 'DB_File' dbm file 'swisspfam' : Inappropriate file type or
> format
> STACK: Error::throw
> STACK: Bio::Root::Root::throw
> /usr/local/lib/perl5/site_perl/5.10.1/Bio/Root/Root.pm:368
> STACK: Bio::Index::Abstract::open_dbm
> /usr/local/lib/perl5/site_perl/5.10.1/Bio/Index/Abstract.pm:399
> STACK: Bio::Index::Abstract::new
> /usr/local/lib/perl5/site_perl/5.10.1/Bio/Index/Abstract.pm:163
> STACK: parse_proteins_file.pl:34
> -----------------------------------------------------------
> 
> what do I do wrong?
> 
> Thanks
> Eden
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l





More information about the Bioperl-l mailing list