Skip to content

Instantly share code, notes, and snippets.

@jvfe
Created June 14, 2020 12:29
Show Gist options
  • Save jvfe/2c72a0c3ec439f3cc7b37bd8c32bebd2 to your computer and use it in GitHub Desktop.
Save jvfe/2c72a0c3ec439f3cc7b37bd8c32bebd2 to your computer and use it in GitHub Desktop.
get_summary <- function(geneids){
summary_list <- entrez_summary("gene", id = geneids, ) %>%
extract_from_esummary(elements = c("uid", "summary"), simplify = TRUE) %>%
as_tibble() %>%
unnest()
gene_names <- summary_list %>%
slice(1) %>%
as.character()
gene_summaries <- summary_list %>%
slice(2) %>%
as.character()
tibble(entrezgene_id = gene_names, summary = gene_summaries)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment