R/survey_gwas.R
survey_gwas.Rd
plot sample size and other information about studies in IEU GWAS ecosystem
survey_gwas(
phrases,
datasource = gwaslake::gwidf_2021_01_30,
title_pref = "IEU GWAS",
title_text = paste(sQuote(phrases), collapse = ", "),
xlab = "N controls",
ylab = "N cases",
...
)
character() vector to grep with ignore.case=TRUE in trait
field, unique matching rows
will be collected
data.frame with trait
as a column, defaults to
gwaslake::gwidf_2021_01_30; result of ieugwasr::gwasinfo() is intended input
character(1) defaults to "IEU GWAS"
character(1) defaults to a paste of phrases with collapse=", "
character(1) x axis label defaults to "N controls"
character(1) x axis label defaults to "N cases"
passed to grep
Returns ggplot, intended for ggplotly. When used with ggplotly, hover over points to get details such as exact definition of trait, study ID, PMID if available. For some phenotypes, numbers of cases or controls are unavailable. If this occurs for all studies assessing the selected phenotypes, an error is thrown.
requireNamespace("ggplot2")
sg = survey_gwas(c("asthma", "asthmatic")) +
ggplot2::theme(text=ggplot2::element_text(size=16))
if (interactive()) {
requireNamespace("plotly")
plotly::ggplotly(sg)
}