Title: | Pubmed Unified REtrieval for Multi-Output Exploration |
---|---|
Description: | Access a variety of 'PubMed' data through a single, user-friendly interface, including abstracts <https://pubmed.ncbi.nlm.nih.gov/>, bibliometrics from 'iCite' <https://icite.od.nih.gov/>, pubtations from 'PubTator3' <https://www.ncbi.nlm.nih.gov/research/pubtator3/>, and full-text records from 'PMC' <https://www.ncbi.nlm.nih.gov/pmc/>. |
Authors: | Jason Timm [aut, cre] |
Maintainer: | Jason Timm <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.2 |
Built: | 2025-02-12 21:28:26 UTC |
Source: | https://github.com/jaytimm/puremoe |
Function queries PubMed to extract reference citations from the fetched records. It processes XML records to obtain detailed information about references, including citation text and available article identifiers such as PubMed ID, PMC ID, DOI, and ISBN.
.get_references(x, sleep)
.get_references(x, sleep)
x |
A character vector with search terms or IDs for fetching records from 'PubMed'. |
sleep |
Numeric value indicating time (in seconds) to wait between requests to avoid overwhelming the server. |
A data.table consisting of 'PubMed' IDs, citation text, and available article identifiers (PubMed ID, PMC ID, DOI, ISBN).
This function downloads 'MeSH' and 'SCR' embeddings data from the specified URLs and processes it for use. The data is saved locally in RDS format. If the files do not exist, they will be downloaded and processed.
data_mesh_embeddings( path = NULL, use_persistent_storage = FALSE, force_install = FALSE )
data_mesh_embeddings( path = NULL, use_persistent_storage = FALSE, force_install = FALSE )
path |
A character string specifying the directory path where data should be stored. If not provided and persistent storage is requested, it defaults to a system-appropriate persistent location managed by 'rappdirs'. |
use_persistent_storage |
A logical value indicating whether to use persistent storage. If TRUE and no path is provided, data will be stored in a system-appropriate location. Defaults to FALSE, using a temporary directory. |
force_install |
A logical value indicating whether to force re-downloading of the data even if it already exists locally. |
This dataset is not viewable until it has been downloaded.
Citation
Noh, J., & Kavuluru, R. (2021). Improved biomedical word embeddings in the transformer era. Journal of biomedical informatics, 120, 103867.
A data frame containing the processed Mesh and SCR embeddings data.
if (interactive()) { data <- data_mesh_embeddings() }
if (interactive()) { data <- data_mesh_embeddings() }
This function downloads and combines the 'MeSH' (Medical Subject Headings) Thesaurus and a supplemental concept thesaurus. The data is sourced from specified URLs and stored locally for subsequent use. By default, the data is stored in a temporary directory. Users can opt into persistent storage by setting 'use_persistent_storage' to TRUE and optionally specifying a path.
data_mesh_thesaurus( path = NULL, use_persistent_storage = FALSE, force_install = FALSE )
data_mesh_thesaurus( path = NULL, use_persistent_storage = FALSE, force_install = FALSE )
path |
A character string specifying the directory path where data should be stored. If not provided and persistent storage is requested, it defaults to a system-appropriate persistent location managed by 'rappdirs'. |
use_persistent_storage |
A logical value indicating whether to use persistent storage. If TRUE and no path is provided, data will be stored in a system-appropriate location. Defaults to FALSE, using a temporary directory. |
force_install |
A logical value indicating whether to force re-downloading of the data even if it already exists locally. |
A data.table containing the combined MeSH and supplemental thesaurus data.
if (interactive()) { data <- data_mesh_thesaurus() }
if (interactive()) { data <- data_mesh_thesaurus() }
This function downloads and loads the 'MeSH' (Medical Subject Headings) Trees data.
data_mesh_trees( path = NULL, use_persistent_storage = FALSE, force_install = FALSE )
data_mesh_trees( path = NULL, use_persistent_storage = FALSE, force_install = FALSE )
path |
A character string specifying the directory path where data should be stored. If not provided and persistent storage is requested, it defaults to a system-appropriate persistent location managed by 'rappdirs'. |
use_persistent_storage |
A logical value indicating whether to use persistent storage. If TRUE and no path is provided, data will be stored in a system-appropriate location. Defaults to FALSE, using a temporary directory. |
force_install |
A logical value indicating whether to force re-downloading of the data even if it already exists locally. |
The data is sourced from specified URLs and stored locally for subsequent use. By default, the data is stored in a temporary directory. Users can opt into persistent storage by setting 'use_persistent_storage' to TRUE and optionally specifying a path.
A data frame containing the MeSH Trees data.
data <- data_mesh_trees()
data <- data_mesh_trees()
This function downloads and loads pharmacological actions data from a specified URL.
data_pharm_action( path = NULL, use_persistent_storage = FALSE, force_install = FALSE )
data_pharm_action( path = NULL, use_persistent_storage = FALSE, force_install = FALSE )
path |
A character string specifying the directory path where data should be stored. If not provided and persistent storage is requested, it defaults to a system-appropriate persistent location managed by 'rappdirs'. |
use_persistent_storage |
A logical value indicating whether to use persistent storage. If TRUE and no path is provided, data will be stored in a system-appropriate location. Defaults to FALSE, using a temporary directory. |
force_install |
A logical value indicating whether to force re-downloading of the data even if it already exists locally. |
The data is sourced from specified URLs and stored locally for subsequent use. By default, the data is stored in a temporary directory. Users can opt into persistent storage by setting 'use_persistent_storage' to TRUE and optionally specifying a path.
A data frame containing pharmacological actions data.
data <- data_pharm_action()
data <- data_pharm_action()
This function downloads the 'PubMed Central' (PMC) open access file list from the 'National Center for Biotechnology Information' (NCBI) and processes it for use.
data_pmc_list( path = NULL, use_persistent_storage = FALSE, force_install = FALSE, timeout = 300 )
data_pmc_list( path = NULL, use_persistent_storage = FALSE, force_install = FALSE, timeout = 300 )
path |
A character string specifying the directory path where data should be stored. If not provided and persistent storage is requested, it defaults to a system-appropriate persistent location managed by 'rappdirs'. |
use_persistent_storage |
A logical value indicating whether to use persistent storage. If TRUE and no path is provided, data will be stored in a system-appropriate location. Defaults to FALSE, using a temporary directory. |
force_install |
A logical value indicating whether to force re-downloading of the data even if it already exists locally. |
timeout |
An integer indicating the timeout in seconds for the download. Defaults to 300 seconds. |
The data is sourced from the specified URL and stored locally for subsequent use. By default, the data is stored in a temporary directory. Users can opt into persistent storage by setting 'use_persistent_storage' to TRUE and optionally specifying a path.
A data frame containing the processed PMC open access file list.
if (interactive()) { data <- data_pmc_list() }
if (interactive()) { data <- data_pmc_list() }
This function retrieves different types of data (like 'PubMed' records, affiliations, 'iCites 'data, etc.) from 'PubMed' based on provided PMIDs. It supports parallel processing for efficiency.
get_records( pmids, endpoint = c("pubtations", "icites", "pubmed_affiliations", "pubmed_references", "pubmed_abstracts", "pmc_fulltext"), cores = 3, sleep = 1, ncbi_key = NULL )
get_records( pmids, endpoint = c("pubtations", "icites", "pubmed_affiliations", "pubmed_references", "pubmed_abstracts", "pmc_fulltext"), cores = 3, sleep = 1, ncbi_key = NULL )
pmids |
A vector of PMIDs for which data is to be retrieved. |
endpoint |
A character vector specifying the type of data to retrieve ('pubtations', 'icites', 'affiliations', 'pubmed', 'pmc'). |
cores |
Number of cores to use for parallel processing (default is 3). |
sleep |
Duration (in seconds) to pause after each batch |
ncbi_key |
(Optional) NCBI API key for authenticated access. |
A data.table containing combined results from the specified endpoint.
pmids <- c("38136652") results <- get_records(pmids, endpoint = "pubmed_abstracts", cores = 1)
pmids <- c("38136652") results <- get_records(pmids, endpoint = "pubmed_abstracts", cores = 1)
Performs a 'PubMed' search based on a query, optionally filtered by publication years. Returns a unique set of 'PubMed' IDs matching the query.
search_pubmed( x, start_year = NULL, end_year = NULL, retmax = 9999, use_pub_years = FALSE )
search_pubmed( x, start_year = NULL, end_year = NULL, retmax = 9999, use_pub_years = FALSE )
x |
Character string, the search query. |
start_year |
Integer, the start year of publication date range (used if 'use_pub_years' is TRUE). |
end_year |
Integer, the end year of publication date range (used if 'use_pub_years' is TRUE). |
retmax |
Integer, maximum number of records to retrieve, defaults to 9999. |
use_pub_years |
Logical, whether to filter search by publication years, defaults to TRUE. |
Numeric vector of unique PubMed IDs.
ethnob1 <- search_pubmed("ethnobotany", 2010, 2012)
ethnob1 <- search_pubmed("ethnobotany", 2010, 2012)