gg_addgenes: Add gene tracks to a ggplot2 plot

View source: R/gg_addgenes.R

gg_addgenesR Documentation

Add gene tracks to a ggplot2 plot

Description

Adds gene tracks to an existing ggplot2 plot.

Usage

gg_addgenes(p, loc, heights = c(3, 2), ...)

Arguments

p

ggplot2 plot object. This can be generated by gg_scatter() and then modified.

loc

Object of class 'locus' to use for plot. See locus().

heights

Vector specifying ratio of heights of upper plot and lower gene track.

...

Additional arguments passed to gg_genetracks() to control colours of gene tracks etc.

Value

A ggplot2 plotting object.

See Also

gg_scatter() gg_genetracks()

Examples

if(require(EnsDb.Hsapiens.v75)) {
data(SLE_gwas_sub)
loc <- locus(SLE_gwas_sub, gene = 'IRF5', flank = c(7e4, 2e5), LD = "r2",
             ens_db = "EnsDb.Hsapiens.v75")
p <- gg_scatter(loc)
gg_addgenes(p, loc)
}

myles-lewis/locuszoomr documentation built on Nov. 29, 2024, 4:49 p.m.