phemirror: phemirror

Description Usage Arguments Value Examples

View source: R/phemirror.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
29
30
phemirror(
  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",
  type = "png",
  hgtratio = 0.5,
  hgt = 7,
  wi = 12,
  res = 300
)

Arguments

top

data frame, must contain PHE, SNP, CHR, POS, pvalue, columns, optional Shape

bottom

data frame, must contain PHE, SNP, CHR, POS, pvalue, columns, optional Shape

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

type

plot type/extension

hgtratio

height ratio of plots, equal to top plot proportion

hgt

height of plot in inches

wi

width of plot in inches

res

resolution of plot in pixels per inch

Value

png image

Examples

1
2
3
4
data(phewas.t)
data(phewas.b)
phemirror(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.