Skip to content

Commit

Permalink
Merge pull request #50 from ropensci/v0.4.2
Browse files Browse the repository at this point in the history
V0.4.2
  • Loading branch information
njahn82 committed Aug 21, 2023
2 parents 10f9c0f + ee2fb56 commit 166c407
Show file tree
Hide file tree
Showing 24 changed files with 425 additions and 379 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand All @@ -29,7 +29,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -45,3 +45,5 @@ jobs:
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: europepmc
Title: R Interface to the Europe PubMed Central RESTful Web Service
Version: 0.4.1.09
Version: 0.4.2
Authors@R: c(
person("Najko", "Jahn", email = "najko.jahn@gmail.com",
role = c("aut", "cre", "cph")),
Expand Down Expand Up @@ -36,7 +36,7 @@ Imports:
tibble,
tidyr,
rlang
RoxygenNote: 7.1.1
RoxygenNote: 7.2.3
Suggests:
testthat,
knitr,
Expand Down
6 changes: 3 additions & 3 deletions R/annotations_by_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ epmc_annotations_by_id_ <- function(ids = NULL, .pb = NULL) {
out <- tibble::tibble(
source = req[["source"]],
ext_id = req[["extId"]],
pmcid = dplyr::if_else(
pmcid = ifelse(
is.null(req[["pmcid"]]), NA_character_, req[["pmcid"]]
),
annotations = req[["annotations"]]
)
tidyr::unnest(tidyr::unnest(out, .data$annotations),
.data$tags)
tidyr::unnest(tidyr::unnest(out, "annotations"),
"tags")
} else {
NULL
}
Expand Down
2 changes: 1 addition & 1 deletion R/epmc_details.r
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ parse_aut <- function(res) {
out <- tibble::tibble()
}
if("authorAffiliationDetailsList.authorAffiliation" %in% colnames(out))
out <- tidyr::unnest(out, cols = c(.data$authorAffiliationDetailsList.authorAffiliation))
out <- tidyr::unnest(out, cols = c("authorAffiliationDetailsList.authorAffiliation"))
return(out)
}

Expand Down
2 changes: 1 addition & 1 deletion R/epmc_lablinks.r
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' providers, which can be selected through Europe PMC's advanced search,
#' include Wikipedia, Dryad Digital Repository or other open services.
#' For more information, see
#' \url{http://europepmc.org/labslink}.
#' \url{https://europepmc.org/labslink}.
#'
#' @param ext_id publication identifier
#' @param data_src data source, by default Pubmed/MedLine index will be searched.
Expand Down
2 changes: 1 addition & 1 deletion R/epmc_lablinks_count.r
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' providers, which can be selected through Europe PMC's advanced search,
#' include Wikipedia, Dryad Digital Repository or the institutional repo of
#' Bielefeld University. For more information, see
#' \url{http://europepmc.org/labslink}.
#' \url{https://europepmc.org/labslink}.
#'
#' @param ext_id publication identifier
#' @param data_src data source, by default Pubmed/MedLine index will be searched.
Expand Down
2 changes: 1 addition & 1 deletion R/epmc_profile.r
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' and breaks it down to the various publication types, data sources, and
#' subsets Europe PMC provides.
#' @param query character, search query. For more information on how to
#' build a search query, see \url{http://europepmc.org/Help}
#' build a search query, see \url{https://europepmc.org/Help}
#' @param synonym logical, synonym search. If TRUE, synonym terms from MeSH
#' terminology and the UniProt synonym list are queried, too. Enabled by
#' default.
Expand Down
8 changes: 4 additions & 4 deletions R/epmc_search.r
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#' Search Europe PMC publication database
#'
#' @description This is the main function to search Europe PMC RESTful Web
#' Service (\url{http://europepmc.org/RestfulWebService}). It fully supports
#' Service (\url{https://europepmc.org/RestfulWebService}). It fully supports
#' the comprehensive Europe PMC query language. Simply copy & paste your query
#' terms to R. To get familiar with the Europe PMC query syntax, check the
#' Advanced Search Query Builder \url{https://europepmc.org/advancesearch}.
#'
#' @seealso \url{http://europepmc.org/Help}
#' @seealso \url{https://europepmc.org/Help}
#'
#' @param query character, search query. For more information on how to build a
#' search query, see \url{http://europepmc.org/Help}
#' search query, see \url{https://europepmc.org/Help}
#' @param output character, what kind of output should be returned. One of
#' 'parsed', 'id_list' or 'raw' As default, parsed key metadata will be
#' returned as data.frame. 'id_list' returns a list of IDs and sources. Use
Expand Down Expand Up @@ -159,7 +159,7 @@ epmc_search <- function(query = NULL,
#' pages within the defined limit.
#'
#' @param query character, search query. For more information on how to
#' build a search query, see \url{http://europepmc.org/Help}
#' build a search query, see \url{https://europepmc.org/Help}
#' @param output character, what kind of output should be returned. One of 'parsed', 'id_list'
#' or 'raw' As default, parsed key metadata will be returned as data.frame.
#' 'id_list returns a list of IDs and sources.
Expand Down
10 changes: 6 additions & 4 deletions R/europepmc.r
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
#' to other databases hosted by the European Bioinformatics Institute (EBI).
#'
#' For more information about Europe PMC, see their current paper:
#' 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. \doi{10.1093/nar/gkx1005}.
#' 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. \doi{10.1093/nar/gkaa994}.

#'
#' @name europepmc
Expand All @@ -38,4 +40,4 @@
#' @importFrom tibble as_tibble tibble
#' @importFrom tidyr unnest
#' @importFrom rlang .data
NULL
"_PACKAGE"
7 changes: 4 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ knitr::opts_chunk$set(

[![R build status](https://github.com/ropensci/europepmc/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/europepmc/actions)
[![Build status](https://ci.appveyor.com/api/projects/status/f8xtpvhhr074lk44?svg=true)](https://ci.appveyor.com/project/sckott/europepmc)
[![codecov.io](https://codecov.io/github/ropensci/europepmc/coverage.svg?branch=master)](https://codecov.io/github/ropensci/europepmc?branch=master)
[![codecov.io](https://codecov.io/github/ropensci/europepmc/coverage.svg?branch=master)](https://app.codecov.io/github/ropensci/europepmc?branch=master)
[![cran version](https://www.r-pkg.org/badges/version/europepmc)](https://cran.r-project.org/package=europepmc)
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/europepmc)](https://github.com/r-hub/cranlogs.app)
[![](https://badges.ropensci.org/29_status.svg)](https://github.com/ropensci/software-review/issues/29)
Expand All @@ -30,7 +30,8 @@ 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>
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

Expand Down Expand Up @@ -140,7 +141,7 @@ The package maintainer, Chris Stubben (@cstubben), has also created an Shiny App

- use rOpenSci's `oai` to get metadata and full text via Europe PMC's OAI interface: <https://github.com/ropensci/oai>
- use rOpenSci's `rentrez` to interact with [NCBI databases](https://www.ncbi.nlm.nih.gov/) such as PubMed: <https://github.com/ropensci/rentrez>
- rOpenSci's `fulltext` package gives access to supplementary material of open access life-science publications in Europe PMC: <https://github.com/ropensci/fulltext>
- rOpenSci's `fulltext` package gives access to supplementary material of open access life-science publications in Europe PMC: <https://github.com/ropensci-archive/fulltext>

## Meta

Expand Down
59 changes: 30 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ europepmc - R Interface to Europe PMC RESTful Web Service

[![R build status](https://github.com/ropensci/europepmc/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/europepmc/actions)
[![Build status](https://ci.appveyor.com/api/projects/status/f8xtpvhhr074lk44?svg=true)](https://ci.appveyor.com/project/sckott/europepmc)
[![codecov.io](https://codecov.io/github/ropensci/europepmc/coverage.svg?branch=master)](https://codecov.io/github/ropensci/europepmc?branch=master)
[![codecov.io](https://codecov.io/github/ropensci/europepmc/coverage.svg?branch=master)](https://app.codecov.io/github/ropensci/europepmc?branch=master)
[![cran version](https://www.r-pkg.org/badges/version/europepmc)](https://cran.r-project.org/package=europepmc)
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/europepmc)](https://github.com/r-hub/cranlogs.app)
[![](https://badges.ropensci.org/29_status.svg)](https://github.com/ropensci/software-review/issues/29)
Expand All @@ -23,7 +23,8 @@ 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>
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

Expand Down Expand Up @@ -81,25 +82,25 @@ PMC search syntax to `epmc_search()`.
```r
europepmc::epmc_search(query = '"2019-nCoV" OR "2019nCoV"')
#> # A tibble: 100 × 29
#> id source pmid doi title authorString journalTitle issue journalVolume
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 33406042 MED 33406042 10.1… 2019… Xiao M, Liu… IEEE/ACM Tr… 4 18
#> 2 34059225 MED 34059225 10.1… Livi… Santillan-G… Med Intensi… 5 45
#> 3 34181072 MED 34181072 10.1… Self… Varghese JJ… Support Car… <NA> <NA>
#> 4 34108756 MED 34108756 10.2… COVI… Gabarron E,… Bull World … 6 99
#> 5 33197230 MED 33197230 10.2… Sear… Lazarus JV,… J Med Inter… 11 22
#> 6 33181701 MED 33181701 10.1… The … Kim YJ, Qia… Medicine (B… 46 99
#> 7 34291001 MED 34291001 10.4… How … Moradi G, G… Med J Islam… <NA> 35
#> 8 33521188 MED 33521188 10.1… Tota… Chen AZ, Sh… Arthroplast… <NA> 8
#> 9 33009914 MED 33009914 10.1… A da… Zhu Z, Meng… Database (O… <NA> 2020
#> 10 32341597 MED 32341597 10.1… Obes… Carretero G… Rev Clin Es… 6 220
#> # … with 90 more rows, and 20 more variables: pubYear <chr>, journalIssn <chr>,
#> id source pmid pmcid doi title authorString journalTitle issue
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 36754560 MED 36754560 PMC992… 10.1… Inno… Yerlikaya S… BMJ Open 2
#> 2 37400836 MED 37400836 PMC103… 10.1… Effe… Ebrahimi T,… BMC Oral He… 1
#> 3 37223279 MED 37223279 PMC101… 10.1… Bill… Lamsal R, R… Data Brief <NA>
#> 4 36727245 MED 36727245 PMC101… 10.1… Vasc… Morrissey E… JBI Evid Sy… 5
#> 5 37211453 MED 37211453 PMC101… 10.1… Safe… Smith K, He… Vaccine 26
#> 6 PPR525786 PPR <NA> <NA> 10.1… The … Alihsan B, … <NA> <NA>
#> 7 PPR621660 PPR <NA> <NA> 10.1… Safe… Smith K, He… <NA> <NA>
#> 8 36679914 MED 36679914 PMC986… 10.3… The … Cherif YYS,… Vaccines (B… 1
#> 9 PPR689808 PPR <NA> <NA> 10.2… Perf… MOUNA L, BO… <NA> <NA>
#> 10 37258070 MED 37258070 PMC102… 10.1… Comp… Hui L, Garn… BMJ Open 5
#> # ℹ 90 more rows
#> # ℹ 20 more variables: journalVolume <chr>, pubYear <chr>, journalIssn <chr>,
#> # pageInfo <chr>, pubType <chr>, isOpenAccess <chr>, inEPMC <chr>,
#> # inPMC <chr>, hasPDF <chr>, hasBook <chr>, hasSuppl <chr>,
#> # citedByCount <int>, hasReferences <chr>, hasTextMinedTerms <chr>,
#> # hasDbCrossReferences <chr>, hasLabsLinks <chr>,
#> # hasTMAccessionNumbers <chr>, firstIndexDate <chr>,
#> # firstPublicationDate <chr>, pmcid <chr>, versionNumber <int>
#> # hasTMAccessionNumbers <chr>, firstIndexDate <chr>, …
```

Be aware that Europe PMC expands queries with MeSH synonyms by default. You can turn this behavior off using the `synonym = FALSE` parameter.
Expand All @@ -121,17 +122,17 @@ tt_oa
#> # A tibble: 25 × 3
#> year all_hits query_hits
#> <int> <dbl> <dbl>
#> 1 1995 449064 1495
#> 2 1996 458526 1572
#> 3 1997 456744 1873
#> 4 1998 474613 1762
#> 5 1999 493745 1947
#> 6 2000 532019 2092
#> 7 2001 545674 2187
#> 8 2002 561425 2378
#> 9 2003 588572 2612
#> 10 2004 628141 2845
#> # … with 15 more rows
#> 1 1995 449216 1471
#> 2 1996 458644 1529
#> 3 1997 456805 1834
#> 4 1998 474695 1756
#> 5 1999 493837 1951
#> 6 2000 532142 2078
#> 7 2001 545709 2179
#> 8 2002 561496 2350
#> 9 2003 588612 2596
#> 10 2004 628192 2830
#> # 15 more rows
# we use ggplot2 for plotting the graph
library(ggplot2)
ggplot(tt_oa, aes(year, query_hits / all_hits)) +
Expand Down Expand Up @@ -172,7 +173,7 @@ The package maintainer, Chris Stubben (@cstubben), has also created an Shiny App

- use rOpenSci's `oai` to get metadata and full text via Europe PMC's OAI interface: <https://github.com/ropensci/oai>
- use rOpenSci's `rentrez` to interact with [NCBI databases](https://www.ncbi.nlm.nih.gov/) such as PubMed: <https://github.com/ropensci/rentrez>
- rOpenSci's `fulltext` package gives access to supplementary material of open access life-science publications in Europe PMC: <https://github.com/ropensci/fulltext>
- rOpenSci's `fulltext` package gives access to supplementary material of open access life-science publications in Europe PMC: <https://github.com/ropensci-archive/fulltext>

## Meta

Expand Down
2 changes: 1 addition & 1 deletion man/epmc_lablinks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/epmc_lablinks_count.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/epmc_profile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/epmc_search.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/epmc_search_.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 24 additions & 3 deletions man/europepmc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified man/figures/unnamed-chunk-4-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 166c407

Please sign in to comment.