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",
  ...
)

Arguments

phrases

character() vector to grep with ignore.case=TRUE in trait field, unique matching rows will be collected

datasource

data.frame with trait as a column, defaults to gwaslake::gwidf_2021_01_30; result of ieugwasr::gwasinfo() is intended input

title_pref

character(1) defaults to "IEU GWAS"

title_text

character(1) defaults to a paste of phrases with collapse=", "

xlab

character(1) x axis label defaults to "N controls"

ylab

character(1) x axis label defaults to "N cases"

...

passed to grep

Note

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.

Examples

requireNamespace("ggplot2")
sg = survey_gwas(c("asthma", "asthmatic")) + 
 ggplot2::theme(text=ggplot2::element_text(size=16))
if (interactive()) {
 requireNamespace("plotly")
 plotly::ggplotly(sg)
}