[Bioperl-l] Error While Using Bio::DB::EUtilities::efetch

Seth D. Axen saxen at lbl.gov
Tue Oct 18 00:37:59 UTC 2011


Hello,
   I am having problems using the Bio::DB::EUtilities module to retrieve
data from Entrez. The following script is adapted from the code at
http://www.bioperl.org/wiki/HOWTO:EUtilities_Cookbook#Retrieve_raw_data_records_from_GenBank.2C_save_raw_data_to_file.2C_then_parse_via_Bio::SeqIO.
The input is a file containing a very long list of GI numbers from NCBI
protein. When I run the script, I receive the following error message: Can't
locate object method "get_Response" via package
"Bio::DB::EUtilities::efetch" at getGP.pl line 23.

#!/usr/bin/perl -w
use warnings;
use strict;
use Bio::DB::EUtilities;
use Bio::SeqIO;
use Data::Dumper;

my $id_file = $ARGV[0];
my $temp_file = 'temp.gp';
my @ids;

open (IDFILE, "<$id_file") || die "Could not open $id_file\n";
@ids = <IDFILE>;
close IDFILE;

my $factory = Bio::DB::EUtilities->new(-eutil   => 'efetch',
                                       -db      => 'protein',
                                       -rettype => 'gb',
                                       -email   => 'saxen at lbl.gov',
                                       -id      => \@ids);

# dump HTTP::Response content to a file (not retained in memory)
$factory->get_Response(-file => $temp_file);

my $seqin = Bio::SeqIO->new(-file   => $temp_file,
                            -format => 'genbank');

while (my $seq = $seqin->next_seq) {
   print Dumper($seq);
}

   I would appreciate any insight as to why I am receiving this error.
Thanks in advance for your time!
   Seth Axen



More information about the Bioperl-l mailing list