[Bioperl-l] Eutilities Batch

Bernd Web bernd.web at gmail.com
Thu Oct 5 14:09:38 UTC 2006


Hi,

I am using the new EUtilities. It looks great.
I was trying to use epost followed by elink but i get an error. The
same error is actually given with the example on
http://doc.bioperl.org/bioperl-live/Bio/DB/EUtilities/elink.html:
Can't call method "get_databases" on an undefined value at EU.pl line 25.

For completeness, the code is shown below too.

Any suggestions what is going wrong?

Regards,
Bernd

# chain EUtilities for complex queries

  use Bio::DB::EUtilities;

  my $esearch = Bio::DB::EUtilities->new(-eutil      => 'esearch',
                                         -db         => 'pubmed',
                                         -term       => 'hutP',
                                         -usehistory => 'y');

  $esearch->get_response; # parse the response, fetch a cookie

  my $elink = Bio::DB::EUtilities->new(-eutil        => 'elink',
                                       -db           => 'protein,taxonomy',
                                       -dbfrom       => 'pubmed',
                                       -cookie       => $esearch->next_cookie,
                                       -cmd          => 'neighbor');

  # this retrieves the Bio::DB::EUtilities::ElinkData object

  my ($linkset) = $elink->next_linkset;
  my @ids;

  # step through IDs for each linked database in the ElinkData object

  for my $db ($linkset->get_databases) {
    @ids = $linkset->get_LinkIds_by_db($db); #returns primary ID's
    # do something here
  }



More information about the Bioperl-l mailing list