ggmanLabel: Add labels to ggman Plot

Description Usage Arguments Details Value Examples

View source: R/ggmanLabel.R

Description

Label points in the ggman plot.

Usage

1
2
ggmanLabel(ggmanPlot, labelDfm, snp = "snp", label = "label",
  type = "label", ...)

Arguments

ggmanPlot

A ggplot layer of class 'ggman'; see ggman

labelDfm

A data frame object with the SNPs and the labels;

snp

Name of the column containing the markers;

label

Name of the column containing the labels; It can be the snp column itself.

type

type of label; either "label" or "text"; see details section

...

other arguments applicable to geom_text_repel or geom_label_repel

Details

This function adds a layer of textual annotation using geom_label_repel(if type = "label") or geom_text_repel (if type = "text").

Value

A labelled Manhattan Plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#label type annotations
p1 <- ggman(toy.gwas, snp = "snp", bp = "bp", chrom = "chrom",
pvalue = "pvalue")
#subset significant snps
toy.gwas.sig <- toy.gwas[-log10(toy.gwas$pvalue)>8,]
ggmanLabel(p1, labelDfm = toy.gwas.sig, snp = "snp", label = "snp")


#text type annotations
ggmanLabel(p1, labelDfm = toy.gwas.sig, snp = "snp", label = "snp", type = "text")

#change the colour and size of labels
ggmanLabel(p1, labelDfm = toy.gwas.sig, snp = "snp", label = "snp", colour = "black", size = 2)

veera-dr/ggman documentation built on May 3, 2019, 4:59 p.m.