Builds a publication-ready gt table of the top hits, mirroring the top-markers table in the ggvolc package. Positions are shown with thousands separators, p-values in scientific notation, and \(-\log_{10}(P)\) is optionally colour-scaled.
Usage
gwas_table(
data,
highlight = highlight_top(top_n = 10),
columns = NULL,
color = TRUE,
title = NULL,
subtitle = NULL
)Arguments
- data
A GWAS data frame (passed through
validate_gwas()).- highlight
A
highlight_top()spec, or a single number (top_n). Defaults to the 10 smallest-p markers.- columns
Optional character vector of columns to keep (and order). By default keeps
SNP,gene,trait,CHR,POS,P,neg_log10_pwhen present.- color
Logical; colour the
neg_log10_pcolumn by value (defaultTRUE).- title, subtitle
Optional table title and subtitle.
Value
A gt table object (class gt_tbl, see gt::gt()). Requires the
gt package.
Examples
if (requireNamespace("gt", quietly = TRUE)) {
data(gwas_example)
gwas_table(gwas_example, highlight = highlight_top(top_n = 8))
}
SNP
Gene
Chr
Position
P-value
−log10(P)