Return the number of IDs
entrez_summary(db = "pubmed", id = opsin_search$ids)
## Warning: ID 2328101885 produced error 'cannot get document summary'
## Warning: ID 2328088504 produced error 'cannot get document summary'
## Warning: ID 2328071543 produced error 'cannot get document summary'
## Warning: ID 2328070562 produced error 'cannot get document summary'
## Warning: ID 2328065778 produced error 'cannot get document summary'
## Warning: ID 2328033094 produced error 'cannot get document summary'
## Warning: ID 2325510557 produced error 'cannot get document summary'
## Warning: ID 2325510556 produced error 'cannot get document summary'
## Warning: ID 2325510555 produced error 'cannot get document summary'
## Warning: ID 2325510554 produced error 'cannot get document summary'
## Warning: ID 2325510552 produced error 'cannot get document summary'
## Warning: ID 922960043 produced error 'cannot get document summary'
## Warning: ID 2327721060 produced error 'cannot get document summary'
## Warning: ID 2327720543 produced error 'cannot get document summary'
## Warning: ID 2327717981 produced error 'cannot get document summary'
## Warning: ID 2327712446 produced error 'cannot get document summary'
## Warning: ID 2327712445 produced error 'cannot get document summary'
## Warning: ID 2327707916 produced error 'cannot get document summary'
## Warning: ID 2327707414 produced error 'cannot get document summary'
## Warning: ID 2327703735 produced error 'cannot get document summary'
## List of 20 esummary records. First record:
##
## $`2328101885`
## esummary result with 1 items:
## [1] uid
opsin_search <- entrez_search(db = "pubmed", term = "opsin [TITLE] AND amphibians")
opsin_search
## Entrez search result with 58 hits (object contains 20 IDs and no web_history object)
## Search term (as translated): opsin[TITLE] AND ("amphibians"[MeSH Terms] OR "amp ...
Question #3
I used to study the SHH gene for my master’s degree, so I wanted to
compare the number of searches of SHH (Sonic Hedgehog) vs my current
gene of study, OPSIN genes
year <- 1960:2022
opsin_search <- glue("opsin[TITLE]) AND {year}[PDAT]")
SHH_search <- glue("sonic hedgehog [TITLE] AND {year}[PDAT]")
search_counts <- tibble(year = year,
opsin_search = opsin_search,
SHH_search = SHH_search) %>%
mutate(opsin = map_dbl(opsin_search, ~entrez_search(db="pubmed",
term = .x)$count),
SHH = map_dbl(SHH_search, ~entrez_search(db="pubmed",
term = .x)$count))
search_counts %>%
select(year, opsin, SHH) %>%
pivot_longer(-year) %>%
ggplot(aes(x = year,
y = value,
group = name,
color = name))+
ylab("Search Count") +
xlab("Year") +
geom_line()+
geom_smooth()+
geom_point(color = "black")+
theme_bw()+
ggtitle("Comparison of Sonic Hedge vs Opsin Gene Searches")
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'