A small constructor that bundles a highlight specification for reuse across the plotting functions and the top-hits table. Criteria are combined as a union: a marker is highlighted if it satisfies any of the supplied rules.
Arguments
- top_n
Integer; highlight the
top_nmarkers with the smallest p-values (per group whenbyis set).- threshold
Numeric p-value; highlight markers with
P <= threshold.- snps, genes
Character vectors of
SNPids /genenames to highlight.- by
Optional grouping column applied before
top_n(e.g."CHR"for the top hit on each chromosome, or"trait").
Examples
highlight_top(top_n = 10)
#> $top_n
#> [1] 10
#>
#> $threshold
#> NULL
#>
#> $snps
#> NULL
#>
#> $genes
#> NULL
#>
#> $by
#> NULL
#>
#> attr(,"class")
#> [1] "gwas_highlight"
highlight_top(threshold = 5e-8, genes = c("GENE01000"))
#> $top_n
#> NULL
#>
#> $threshold
#> [1] 5e-08
#>
#> $snps
#> NULL
#>
#> $genes
#> [1] "GENE01000"
#>
#> $by
#> NULL
#>
#> attr(,"class")
#> [1] "gwas_highlight"
highlight_top(top_n = 1, by = "CHR") # lead SNP per chromosome
#> $top_n
#> [1] 1
#>
#> $threshold
#> NULL
#>
#> $snps
#> NULL
#>
#> $genes
#> NULL
#>
#> $by
#> [1] "CHR"
#>
#> attr(,"class")
#> [1] "gwas_highlight"