europepmc - R Interface to Europe PMC RESTful Web Service

knitr::opts_chunk$set(
  comment = "#>",
  collapse = TRUE,
  warning = FALSE,
  message = FALSE
)

R build status codecov.io cran version rstudio mirror downloads

europepmc facilitates access to the Europe PMC RESTful Web Service. The client furthermore supports the Europe PMC Annotations API to retrieve text-mined concepts and terms per article.

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 literature and patent sources.

For more infos on Europe PMC, see:

https://europepmc.org/About

Ferguson, C., Araújo, D., Faulk, L., Gou, Y., Hamelers, A., Huang, Z., Ide-Smith, M., Levchenko, M., Marinos, N., Nambiar, R., Nassar, M., Parkin, M., Pi, X., Rahman, F., Rogers, F., Roochun, Y., Saha, S., Selim, M., Shafique, Z., … McEntyre, J. (2020). Europe PMC in 2020. Nucleic Acids Research, 49(D1), D1507–D1514. https://doi.org/10.1093/nar/gkaa994.

Implemented API methods

This client supports the following API methods from the Articles RESTful API:

|API-Method |Description |R functions | |:--------------|:--------------------------------------------------------------------------------------------|:------------------------------------------| |search |Search Europe PMC and get detailed metadata |epmc_search(), epmc_details(), epmc_search_by_doi() | |profile |Obtain a summary of hit counts for several Europe PMC databases |epmc_profile() | |citations |Load metadata representing citing articles for a given publication |epmc_citations() | |references |Retrieve the reference section of a publication |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() | |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() |

From the Europe PMC Annotations API:

|API-Method |Description |R functions | |:-----------|:-------------|:-------------| annotationsByArticleIds | Get the annotations contained in the list of articles specified | epmc_annotations_by_id() |

Installation

From CRAN

install.packages("europepmc")

The latest development version can be installed using the remotes package:

require(remotes)
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: https://europepmc.org/help. Provide your query in the Europe PMC search syntax to epmc_search().

europepmc::epmc_search(query = '"2019-nCoV" OR "2019nCoV"')

Be aware that Europe PMC expands queries with MeSH synonyms by default. You can turn this behavior off using the synonym = FALSE parameter.

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:2019, synonym = FALSE)
tt_oa
# 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")

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

https://docs.ropensci.org/europepmc/articles/evergreenreviewgraphs.html

Re-use of europepmc

Check out the tidypmc package

https://github.com/ropensci/tidypmc

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

https://github.com/cstubben/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



ropensci/europepmc documentation built on Nov. 30, 2023, 12:43 a.m.