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

Seth D. Axen saxen at lbl.gov
Wed Oct 19 00:15:21 UTC 2011


Thanks Carne and Chris! The problem was with my BioPerl version. Once I used
the latest version, the script ran perfectly.
Seth

2011/10/17 Fields, Christopher J <cjfields at illinois.edu>

> On Oct 17, 2011, at 8:16 PM, Carnë Draug wrote:
>
> > On 18 October 2011 01:37, Seth D. Axen <saxen at lbl.gov> wrote:
> >> 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
> >
> > Hi
> >
> > your code works fine for me. Can the problem be on your IDs or its
> > file? By the way, drop the -w from the shebang line, you are alredy
> > using warnings.
> >
> > Carnë
>
>
> Also, check the BioPerl version, there was a very large change in the API
> before the v1.6 release.
>
> chris
>
>
>
>




More information about the Bioperl-l mailing list