iphemirror: iphemirror

Description Usage Arguments Value Examples

View source: R/iphemirror.R

Description

Create mirrored Manhattan plots for PheWAS Dependencies: ggplot2, gridExtra Suggested: ggrepel

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
iphemirror(
  top,
  bottom,
  phegroup,
  tline,
  bline,
  chroms = c(1:22, "X", "Y"),
  log10 = TRUE,
  yaxis,
  opacity = 1,
  annotate_snp,
  annotate_p,
  highlight_snp,
  highlight_p,
  highlighter = "red",
  toptitle = NULL,
  bottomtitle = NULL,
  chrcolor1 = "#AAAAAA",
  chrcolor2 = "#4D4D4D",
  groupcolors,
  freey = FALSE,
  background = "variegated",
  chrblocks = TRUE,
  file = "phemirror",
  hgtratio = 0.5,
  hgt = 7,
  wi = 12
)

Arguments

top

data frame, must contain: PHE, SNP, CHR, POS, pvalue, columns; optional: Shape, Hover, and Link

bottom

data frame, must contain: PHE, SNP, CHR, POS, pvalue, columns; optional: Shape, Hover, and Link

phegroup

optional grouping dataframe for phenotypes, must contain PHE and Group columns

tline

list of pvalues to draw red threshold lines in top plot

bline

list of pvalues to draw red threshold lines in bottom plot

chroms

list of chromosomes to plot in the order desired, default c(1:22, "X", "Y")

log10

plot -log10() of pvalue column, logical

yaxis

label for y-axis in the format c("top", "bottom"), automatically set if log10=TRUE

opacity

opacity of points, from 0-1, useful for dense plots

annotate_snp

vector of RSIDs to annotate

annotate_p

list of pvalue thresholds to annotate in the order of c(p_top, p_bottom)

highlight_snp

vector of snps to highlight

highlight_p

list of pvalue thresholds to annotate in the order of c(p_top, p_bottom)

highlighter

color to highlight

toptitle

optional string for top plot title

bottomtitle

optional string for bottom plot title

chrcolor1

first alternating color for chromosome

chrcolor2

second alternating color for chromosome

groupcolors

named vector of colors where names correspond to data in 'PHE' or 'Group' column

freey

allow y-axes to scale with the data

background

variegated or white

chrblocks

logical, turns on x-axis chromosome marker blocks

file

file name of saved image

hgtratio

height ratio of plots, equal to top plot proportion

hgt

height of plot in inches

wi

width of plot in inches

Value

html file

Examples

1
2
3
4
5
6
7
8
data(phewas.t)
data(phewas.b)
phewas.t$Hover <- paste("p:", formatC(phewas.t$pvalue, format="e", digits=2))
phewas.b$Hover <- paste("p:", formatC(phewas.b$pvalue, format="e", digits=2))
phewas.t$Link <- paste0("https://www.ncbi.nlm.nih.gov/snp/", phewas.t$SNP)
phewas.b$Link <- paste0("https://www.ncbi.nlm.nih.gov/snp/", phewas.b$SNP)
iphemirror(top=phewas.t, bottom = phewas.b, 
           toptitle = "PheWAS Example: Data 1", bottomtitle = "PheWAS Example: Data 2")

anastasia-lucas/hudson documentation built on Nov. 18, 2021, 5:16 p.m.