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
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
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.
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...
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 :-)
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
@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.
Incorrect I'm afraid. In all of the above code, the database specified is "pmc" Also, your comment is not an answer.
EUtils also offer converting PMID into PMC ID