R Interface to the Europe PubMed Central RESTful Web Service

An R Client for the Europe PubMed Central RESTful Web Service (see < https://europepmc.org/RestfulWebService> for more information). It gives access to both metadata on life science literature and open access full texts. Europe PMC indexes all PubMed content and other literature sources including Agricola, a bibliographic database of citations to the agricultural literature, or Biological Patents. In addition to bibliographic metadata, the client allows users to fetch citations and reference lists. Links between life-science literature and other EBI databases, including ENA, PDB or ChEMBL are also accessible. No registration or API key is required. See the vignettes for usage examples.


Build Status Build status codecov.io cran version rstudio mirror downloads

europepmc facilitates access to the Europe PMC RESTful Web Service.

Europe PMC covers life science literature and gives access to open access full texts. Europe PMC ingests all PubMed content and extends its index with other sources, including Agricola, a bibliographic database of citations to the agricultural literature, or Biological Patents.

For more infos on Europe PMC, see:

https://europepmc.org/About

Levchenko, M., Gou, Y., Graef, F., Hamelers, A., Huang, Z., Ide-Smith, M., … McEntyre, J. (2017). Europe PMC in 2017. Nucleic Acids Research, 46(D1), D1254–D1260. https://doi.org/10.1093/nar/gkx1005

Implemented API methods

This client supports the following API methods:

API-Method Description R functions
search Search Europe PMC and get detailed metadata epmc_search(), epmc_details()
profile Obtain a summary of hit counts for several Europe PMC databases epmc_profile(), epmc_profile_hits()
citations Load metadata representing citing articles for a given publication epmc_citations()
references Retrieve the reference section of a pubication epmc_refs()
databaseLinks Get links to biological databases such as UniProt or ENA epmc_db(), epmc_db_count()
labslinks Access links to Europe PMC provided by third parties epmc_lablinks(), epmc_lablinks_count()
textMinedTerms Retrieve text-mined terms epmc_tm(), epmc_tm_count()
fullTextXML Fetch full-texts deposited in PMC epmc_ftxt()
bookXML retrieve book XML formatted full text for the Open Access subset of the Europe PMC bookshelf epmc_ftxt_book()

Installation

From CRAN

install.packages("europepmc")

The latest development version can be installed using devtools package:

require(devtools)
install_github("ropensci/europepmc")

Loading into R

library(europepmc)

Search Europe PMC

The search covers both metadata (e.g. abstracts or title) and full texts. To build your query, please refer to the comprehensive guidance on how to search Europe PMC: http://europepmc.org/help. Simply provide your query in the Europe PMC search syntax to epmc_search().

europepmc::epmc_search("Lagotto Romagnolo")
#> # A tibble: 42 x 27
#>    id     source pmid   doi   title    authorString     journalTitle issue
#>    <chr>  <chr>  <chr>  <chr> <chr>    <chr>            <chr>        <chr>
#>  1 28583… MED    28583… 10.1… Basal A… Syrjä P, Anwar … Vet Pathol   6    
#>  2 25945… MED    25945… 10.1… Behavio… Jokinen TS, Tii… J Vet Inter… 4    
#>  3 24354… MED    24354… 10.1… FDG-PET… Jokinen TS, Haa… Vet Radiol … 3    
#>  4 17552… MED    17552… 10.1… Benign … Jokinen TS, Met… J Vet Inter… 3    
#>  5 17490… MED    17490… 10.1… Cerebel… Jokinen TS, Rus… J Small Ani… 8    
#>  6 29056… MED    29056… 10.1… Relatio… Byosiere SE, Fe… Behav Proce… <NA> 
#>  7 27525… MED    27525… 10.1… Genetic… Donner J, Kauko… PLoS One     8    
#>  8 29166… MED    29166… 10.1… Frequen… Zierath S, Hugh… PLoS One     11   
#>  9 29237… MED    29237… 10.1… Molecul… Yu Y, Hasegawa … BMC Vet Res  1    
#> 10 25875… MED    25875… 10.1… A misse… Kyöstilä K, Syr… PLoS Genet   4    
#> # ... with 32 more rows, and 19 more variables: journalVolume <chr>,
#> #   pubYear <chr>, journalIssn <chr>, pageInfo <chr>, pubType <chr>,
#> #   isOpenAccess <chr>, inEPMC <chr>, inPMC <chr>, hasPDF <chr>,
#> #   hasBook <chr>, citedByCount <int>, hasReferences <chr>,
#> #   hasTextMinedTerms <chr>, hasDbCrossReferences <chr>,
#> #   hasLabsLinks <chr>, hasTMAccessionNumbers <chr>,
#> #   firstPublicationDate <chr>, pmcid <chr>, hasSuppl <chr>

By default, epmc_search() returns 100 records. To adjust the limit, simply use the limit parameter.

See vignette Introducing europepmc, an R interface to Europe PMC RESTful API for a long-form documentation about how to search Europe PMC with this client.

Creating proper review graphs with epmc_hits_trend()

There is also a nice function allowing you to easily create review graphs like described in Maëlle Salmon's blog post:

tt_oa <- europepmc::epmc_hits_trend("Malaria", period = 1995:2016, synonym = FALSE)
tt_oa
#> # A tibble: 22 x 3
#>     year all_hits query_hits
#>    <int>    <dbl>      <dbl>
#>  1  1995   448477       1485
#>  2  1996   458064       1560
#>  3  1997   455691       1853
#>  4  1998   473173       1749
#>  5  1999   492786       1935
#>  6  2000   531286       2127
#>  7  2001   544411       2203
#>  8  2002   560843       2352
#>  9  2003   587503       2554
#> 10  2004   627130       2748
#> # ... with 12 more rows
# we use ggplot2 for plotting the graph
library(ggplot2)
ggplot(tt_oa, aes(year, query_hits / all_hits)) + 
  geom_point() + 
  geom_line() +
  xlab("Year published") + 
  ylab("Proportion of articles on Malaria in Europe PMC")

plot of chunk unnamed-chunk-4

For more info, read the vignette about creating literature review graphs:

https://ropensci.github.io/europepmc/articles/evergreenreviewgraphs.html

Re-use of europepmc

Chris Stubben (@cstubben) has created an Shiny App that allows you to search and browse Europe PMC:

https://cstubben.shinyapps.io/euPMC/

Other ways to access Europe PubMed Central

Other APIs

Other R clients

Meta

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License: GPL-3

Please use the issue tracker for bug reporting and feature requests.


rofooter

News

europepmc 0.3

  • Implement API version 6.0

Minor changes

  • improved feedback when calling the API
  • link to most current paper from the Europe PMC team

europepmc 0.2

  • Move to HTTPS
  • new epmc_hits_trends() function to obtain data for review graphs (thanks @maelle)
  • new vignette "Making proper trend graphs" and updated search documentation

Minor changes

  • fix sort param
  • rename jsonlite::rbind_pages() function
  • improve europepmc::epmc_tm() output

europepmc 0.1.4

  • fixed example in vignette which lead to warnings
  • synonym search is operational again

europepmc 0.1.3

Minor changes

europepmc 0.1.2

  • cache HTTP 500 errors which sometimes occur and re-try up to five times. It is based on googlesheet's approach
  • new function epmc_profile() to get an overview of hit counts for several databases or publication types
  • update imported packages in DESCRIPTION

europepmc 0.1.1

Implement RESTful API v4.5.3

Major changes

  • epmc_search(): implement cursorMark to paginate through results
  • epmc_search(): added sort parameter
  • epmc_search(): support of raw output file #7

Minor changes

  • epmc_search() and other functions return non-nested data.frames as tibbles to better support the tidyverse
  • epmc_search() improve error handling when nothing was found
  • epmc_details() [added MeSH qualifer #8]((https://github.com/ropensci/europepmc/issues/8)
  • remove NBKas data source forepmc_details(), use PMIDs (MED`) instead
  • fix warnings regarding vignettes and imported dependencies reported by CRAN

europepmc 0.1

Initial submission to CRAN

Major changes

Support of the following Europe PMC RESTful API methods:

  • search
  • citations
  • references
  • databaseLinks
  • labsLinks
  • textMinedTerms
  • fullTextXML
  • bookXML

Changes made during the ropensci onboarding review by @toph-allen https://github.com/ropensci/onboarding/issues/29

Answering to @cstubben reports and suggestions:

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("europepmc")

0.3 by Najko Jahn, 9 months ago


http://github.com/ropensci/europepmc/


Report a bug at http://github.com/ropensci/europepmc/issues


Browse source code at https://github.com/cran/europepmc


Authors: Najko Jahn [aut, cre, cph] , Maëlle Salmon [ctb]


Documentation:   PDF Manual  


Task views: Web Technologies and Services


GPL-3 license


Imports httr, jsonlite, plyr, dplyr, progress, urltools, purrr, xml2

Suggests testthat, knitr, rmarkdown, ggplot2, readr


See at CRAN