gmirror: gmirror

Description Usage Arguments Value Examples

View source: R/gmirror.R

Description

Create mirrored Manhattan plots for GWAS 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
gmirror(
  top,
  bottom,
  tline,
  bline,
  chroms = c(1:22, "X", "Y"),
  log10 = TRUE,
  yaxis,
  opacity = 1,
  annotate_snp,
  annotate_p,
  toptitle = NULL,
  bottomtitle = NULL,
  highlight_snp,
  highlight_p,
  highlighter = "red",
  chrcolor1 = "#AAAAAA",
  chrcolor2 = "#4D4D4D",
  freey = FALSE,
  background = "variegated",
  chrblocks = FALSE,
  file = "gmirror",
  type = "png",
  hgt = 7,
  hgtratio = 0.5,
  wi = 12,
  res = 300
)

Arguments

top

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

bottom

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

tline

list of pvalues to draw red threshold lines in top plot

bline

ist 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 to 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)

toptitle

optional string for top plot title

bottomtitle

optional string for bottom plot title

highlight_snp

vector of snps to highlight

highlight_p

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

highlighter

color to highlight

chrcolor1

first alternating color for chromosome

chrcolor2

second alternating color for chromosome

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

hgt

height of plot in inches

hgtratio

height ratio of plots, equal to top plot proportion

wi

width of plot in inches

res

resolution of plot in pixels per inch

Value

png image

Examples

1
2
3
4
5
data(gwas.t)
data(gwas.b)
gmirror(top=gwas.t, bottom=gwas.b, tline=0.05/nrow(gwas.t), bline=0.05/nrow(gwas.b), 
toptitle="GWAS Comparison Example: Data 1", bottomtitle = "GWAS Comparison Example: Data 2", 
highlight_p = c(0.05/nrow(gwas.t), 0.05/nrow(gwas.b)), highlighter="green")

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