Skip to contents

This function takes an existing absolute copy-number plot, a vector of gene names, and optionally an Ensembl DB to use for looking up gene annotations. Ensure that you use an Ensembl DB which annotates the same genome version used for your existing plot. A plot with the genes of interest labeled is returned.

Usage

AddGenesToPlot(plot, genes, edb = EnsDb.Hsapiens.v75::EnsDb.Hsapiens.v75, ...)

Arguments

plot

A ggplot object, corresponding to the existing absolute copy-number plot.

genes

A vector of gene symbols you'd like to label on the plot – use upper case.

edb

The name of the local Ensembl DB package to use for looking up gene information. Defaults to EnsDb.Hsapiens.v75, which annotates hg19/GRCh37.

...

Additional options controlling the visual display of the labels; passed to ggrepel::geom_label_repel(), and supports any of its arguments.

Value

A ggplot object with the gene labels added.

See also

ggrepel::geom_label_repel() for supported arguments that alter the visual display of the labels.