qqman_manhattan: Creates a manhattan plot

Description Usage Arguments Value Examples

View source: R/qqman_manhattan.R

Description

Creates a manhattan plot from PLINK assoc output (or any data frame with chromosome, position, and p-value).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
qqman_manhattan(
  x,
  chr = "CHR",
  bp = "BP",
  p = "P",
  snp = "SNP",
  col = c("gray10", "gray60"),
  col.highlight = "green",
  chrlabs = NULL,
  suggestiveline = -log10(1e-05),
  genomewideline = -log10(5e-08),
  highlight = NULL,
  logp = TRUE,
  annotatePval = NULL,
  annotateTop = TRUE,
  ...
)

Arguments

x

A data.frame with columns "BP," "CHR," "P," and optionally, "SNP."

chr

A string denoting the column name for the chromosome. Defaults to PLINK's "CHR." Said column must be numeric. If you have X, Y, or MT chromosomes, be sure to renumber these 23, 24, 25, etc.

bp

A string denoting the column name for the chromosomal position. Defaults to PLINK's "BP." Said column must be numeric.

p

A string denoting the column name for the p-value. Defaults to PLINK's "P." Said column must be numeric.

snp

A string denoting the column name for the SNP name (rs number). Defaults to PLINK's "SNP." Said column should be a character.

col

A character vector indicating which colors to alternate.

col.highlight

A character vector of colors corresponding to the list of "highlight".

chrlabs

A character vector equal to the number of chromosomes specifying the chromosome labels (e.g., c(1:22, "X", "Y", "MT")).

suggestiveline

Where to draw a "suggestive" line. Default -log10(1e-5). Set to FALSE to disable.

genomewideline

Where to draw a "genome-wide sigificant" line. Default -log10(5e-8). Set to FALSE to disable.

highlight

A list of character vector of SNPs in your dataset to highlight. These SNPs should all be in your dataset.

logp

If TRUE, the -log10 of the p-value is plotted. It isn't very useful to plot raw p-values, but plotting the raw value could be useful for other genome-wide plots, for example, peak heights, bayes factors, test statistics, other "scores," etc.

annotatePval

If set, SNPs below this p-value will be annotated on the plot.

annotateTop

If TRUE, only annotates the top hit on each chromosome that is below the annotatePval threshold.

...

Arguments passed on to other plot/points functions

Value

A manhattan plot.

Examples

1
2
3
#\dontrun{
#qqman_manhattan(gwasResults)
#}

statpng/sp.gwas documentation built on Dec. 17, 2020, 5:55 a.m.