View source: R/fast_manhattan.R
fast_manhattan | R Documentation |
This is a very fast and easy-to-individualize plotting function for GWAS results e.g. pvalues based on ggplot2
and scattermore
.
fast_manhattan(
data,
build = "hg19",
color1 = "black",
color2 = "grey",
y_scale = TRUE,
log10p = TRUE,
alpha = 1,
speed = "fast",
pointsize = 0,
pixels = c(512, 512),
dodge_x = FALSE,
highlight = NULL,
...
)
data |
A data.frame. Columns 'chr', 'pos', and 'pvalue' are required |
build |
Genomic build. Currently hg18, hg19, and hg38 are supported. If you are not sure about, set the default "hg19". |
color1 |
Color for odd-numbered chromosomes |
color2 |
Color for even-numbered chromosomes |
y_scale |
When an own y-scale is provided then set this to TRUE to avoid an error. |
log10p |
If TRUE (default), the -log10 transformed pvalues are plotted |
speed |
The speed option. Fast and ultrafast use |
pointsize |
Only when using the 'fast' option you can increase pointsize. Default is 0. When using small pointsizes it could be that points are not shown in the RStudio Plots or Zoom window. But they will plotted when saving to pdf. |
pixels |
Only when using the 'fast' option you can increase pixel width and height. Default is c(512, 512). |
dodge_x |
default FALSE. When turned on all chromosome labels are drawn and every second are moved a little bit to the bottom. |
highlight |
Character vector with matching entries of 'data$rsid' or column 'highlight' in data with NAs or concrete colors e.g. 'deeppink'. |
A ggplot2 object/plot
data("gwas_data")
head(gwas_data)
# slow
fast_manhattan(gwas_data, build='hg18')
# fast
fast_manhattan(gwas_data, build = "hg18", speed = "fast")
# ultrafast
fast_manhattan(gwas_data, build='hg18', speed = "ultrafast")
# highlight most significant snps
fast_manhattan(gwas_data, build='hg18', speed = "fast", highlight = gwas_data[gwas_data$pvalue < 10e-20,]$rsid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.