[Bioperl-l] Re: Bio::Biblio to access pubmed?

Siddhartha Basu sidd.basu at gmail.com
Thu Oct 9 16:53:41 UTC 2008


Hi,
As an alternate I also use Bio::DB::EUtilities frequently query and extract data from pubmed.
Currently it returns xml which needed to be parsed to get specific
information. Here is a small example using xpath query....


#!/usr/bin/perl -w

use strict;
use Bio::DB::EUtilities;
use XML::Twig::XPath;

my $pubmed_id = $ARGV[0] || '18835579';

my $eutils = Bio::DB::EUtilities->new(
    eutil => 'efetch',
    -db   => 'pubmed',
    -id   => $pubmed_id
);

if ( $eutils->get_Response->is_error() ) {
    die $eutils->get_Response->message(), "\n";
}


my $twig = XML::Twig::XPath->new->parse($eutils->get_Response->content());
my ($title) = $twig->findnodes('//Article/ArticleTitle');
print $title->getValue,"\n";

my @authors = $twig->findnodes('//Article/AuthorList/Author');
print $_->getValue,"\n" foreach @authors;


-siddhartha


On Wed, 08 Oct 2008, michael watson (IAH-C) wrote:

> Hi
> 
> I am looking for methods of querying pubmed using perl, getting an
> object which I can then print out various attributes of the papers
> returned (author, title etc) in tabular format.
> 
> I came across Bio::Biblio but I can't see any examples of using it with
> pubmed?  Does anyone have any?
> 
> Thanks
> Mick
> 
> Head of Informatics
> Institute for Animal Health
> Compton
> Berks
> RG20 7NN
> 01635 578411 
> 
> http://www.iah.ac.uk/research/bioinformatics/bioinf.shtml
> 
> The information contained in this message may be confidential or legally
> privileged and is intended solely for the addressee. 
> If you have received this message in error please delete it & notify the
> originator immediately.
> Unauthorised use, disclosure, copying or alteration of this message is
> forbidden & may be unlawful. 
> The contents of this e-mail are the views of the sender and do not
> necessarily represent the views of the Institute. 
> This email and associated attachments has been checked locally for
> viruses but we can accept no responsibility once it has left our
> systems.
> Communications on Institute computers are monitored to secure the
> effective operation of the systems and for other lawful purposes. 
> 
> _______________________________________________
> 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