Getting List Of Pmcids From Pubmed Central
3
4
Entering edit mode
14.0 years ago
Yogesh Pandit ▴ 520

Hi,

For a given query, how can I retrieve a list of all the PMCIDs, from Pubmed Central, (using Java/Perl) that are returned.

Thanks

pubmed text • 5.2k views
ADD COMMENT
0
Entering edit mode

@pierre,neilfws,Alex

The question was how to retrieve PMC ids and not PM ids - Pubmed Central id are completely DIFFERENT from Pubmed Ids. None of the above code will get the PMC ids.

ADD REPLY
0
Entering edit mode

Incorrect I'm afraid. In all of the above code, the database specified is "pmc" Also, your comment is not an answer.

ADD REPLY
0
Entering edit mode

EUtils also offer converting PMID into PMC ID

ADD REPLY
9
Entering edit mode
14.0 years ago
Alex ★ 1.5k

And a BioPython example:

#!/usr/bin/env python
from Bio import Entrez

Entrez.email = "name@example.com"
handle = Entrez.esearch(db="pmc", term="colorectal[TITL] AND human[ORGN]")
record = Entrez.read(handle)

print record["IdList"]
['2946291', '2883131', '2837015', '2438340', 
'2134920', '1531685', '194569', '153461', '1506207']

For more information, see here.

ADD COMMENT
8
Entering edit mode
14.0 years ago

Use NCBI EUtils to get your articles PMCID. e.g:

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pmc&term=Rotavirus

returns:

[HTML]
http://www.ncbi.nlm.nih.gov/entrez/query/DTD/eSearch_020511.dtd">
[HTML]
  [HTML]4652[HTML]
  [HTML]20[HTML]
  [HTML]0[HTML]
  [HTML]
        [HTML]1852122[HTML]
        [HTML]2488191[HTML]
        [HTML]2921258[HTML]
        [HTML]2268446[HTML]
            (...)

You can then extract those Ids using XSLT or SAX, or DOM or Stax or whatever...

ADD COMMENT
7
Entering edit mode
14.0 years ago
Neilfws 49k

As Pierre says, the EUtils are your friend. You can either work with the raw XML, as in his example, or use your language of choice. The major Bio* libraries (Bioperl, BioPython, BioRuby) all have libraries for working with EUtils. Search them for Bio::DB::EUtilities, Bio.entrez and Bio::NCBI::REST, respectively.

Here's a Bioperl example:

#!/usr/bin/perl -w
use strict;
use Bio::DB::EUtilities;

my $factory = Bio::DB::EUtilities->new(-eutil  => 'esearch',
                                       -db     => 'pmc',
                                       -term   => 'colorectal[TITL] AND human[ORGN]',
                                       -email  => 'mymail@foo.bar',
                                       -retmax => 10);

my @ids = $factory->get_ids;
print "@ids\n";

[2946291 2883131 2837015 2438340 2134920 1531685 194569 153461 1506207]

And here's a BioRuby example:

#!/usr/bin/ruby
require "rubygems"
require "bio"

Bio::NCBI.default_email = "me@me.com"
ncbi   = Bio::NCBI::REST.new
search = ncbi.esearch("human[ORGN] colorectal[TITL]",
                     {"db" => "pmc", "retmax" => 10})

puts search.inspect
["2946291", "2883131", "2837015", "2438340", "2134920",
 "1531685", "194569", "153461", "1506207"]

You'll note that despite retmax = 10, both of these returned 9 results :-)

ADD COMMENT

Login before adding your answer.

Traffic: 2661 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6