View source: R/mhtplot.trunc.R
| mhtplot.trunc | R Documentation |
Truncated Manhattan plot
mhtplot.trunc(
x,
chr = "CHR",
bp = "BP",
p = NULL,
log10p = NULL,
z = NULL,
snp = "SNP",
col = c("gray10", "gray60"),
chrlabs = NULL,
suggestiveline = -log10(1e-05),
genomewideline = -log10(5e-08),
highlight = NULL,
annotatelog10P = NULL,
annotateTop = FALSE,
cex.mtext = 1.5,
cex.text = 0.7,
mtext.line = 2,
y.ax.space = 5,
y.brk1 = NULL,
y.brk2 = NULL,
trunc.yaxis = TRUE,
cex.axis = 1.2,
delta = 0.05,
...
)
x |
A data.frame. |
chr |
Chromosome column name. |
bp |
Base-pair position column name. |
p |
P-value column name. |
log10p |
Column containing -log10(P). |
z |
Z-statistic column name. |
snp |
SNP/variant identifier column name. |
col |
Point colours alternating by chromosome. |
chrlabs |
Optional chromosome labels. |
suggestiveline |
Horizontal suggestive significance line. |
genomewideline |
Horizontal genome-wide significance line. |
highlight |
SNPs to highlight. |
annotatelog10P |
Threshold for annotation. |
annotateTop |
Annotate only top SNP per chromosome. |
cex.mtext |
Axis title size. |
cex.text |
SNP label size. |
mtext.line |
Axis title line offset. |
y.ax.space |
Y-axis tick spacing. |
y.brk1 |
Lower truncation breakpoint. |
y.brk2 |
Upper truncation breakpoint. |
trunc.yaxis |
Enable truncated y-axis. |
cex.axis |
Axis tick label size. |
delta |
Fractional window around highlighted SNPs. |
... |
Additional graphical parameters passed to points(). |
Draws a Manhattan plot with optional y-axis truncation for extremely significant associations commonly observed in large-scale GWAS or protein GWAS analyses.
Invisibly returns the processed plotting data.
Example FTO locus dataset and truncated Manhattan plot
This example demonstrates the use of mhtplot.trunc() on a
single-chromosome FTO locus dataset with and without y-axis truncation.
txt <- "
CHR POS SNP Z log10P
16 53804965 rs10852521 -39.75000 344.8039
16 53805207 rs11075985 43.88235 419.8925
16 53819877 rs11075989 43.94118 421.0149
16 53819893 rs11075990 -43.94118 421.0149
16 53809247 rs1121980 43.76471 417.6523
16 53845487 rs11642841 38.52941 324.0426
16 53842908 rs12149832 42.23529 389.0756
16 53800954 rs1421085 -45.76471 456.5538
16 53803574 rs1558902 45.88235 458.8962
16 53813367 rs17817449 -46.87500 478.8994
16 53828066 rs17817964 44.29412 427.7808
16 53804340 rs1861866 39.81250 345.8844
16 53818460 rs3751812 44.41176 430.0480
16 53822651 rs7185735 -43.94118 421.0149
16 53810686 rs7193144 -44.29412 427.7808
16 53821862 rs7201850 42.35294 391.2377
16 53821615 rs7202116 -43.94118 421.0149
16 53813450 rs8043757 -42.22222 388.8357
16 53798523 rs8047395 37.76471 311.3650
16 53816275 rs8050136 46.75000 476.3569
16 53816752 rs8051591 -44.00000 422.1388
16 53803156 rs8055197 39.81250 345.8844
16 53812614 rs8057044 39.75000 344.8039
16 53806280 rs9922047 -39.62500 342.6480
16 53831771 rs9922619 43.37500 410.2743
16 53831146 rs9922708 43.25000 407.9218
16 53801549 rs9923147 43.82353 418.7716
16 53819198 rs9923233 43.94118 421.0149
16 53801985 rs9923544 43.82353 418.7716
16 53820503 rs9926289 40.66667 360.8208
16 53799905 rs9928094 -43.88235 419.8925
16 53799977 rs9930333 -44.00000 422.1388
16 53830452 rs9930501 -40.94118 365.6883
16 53830465 rs9930506 -43.31250 409.0972
16 53827179 rs9931494 -42.94118 402.1387
16 53830491 rs9932754 -41.00000 366.7356
16 53816838 rs9935401 46.81250 477.6273
16 53819169 rs9936385 -44.23529 426.6494
16 53799507 rs9937053 43.94118 421.0149
16 53820527 rs9939609 44.05882 423.2642
16 53800568 rs9939973 43.88235 419.8925
16 53800754 rs9940128 43.82353 418.7716
16 53800629 rs9940646 -43.82353 418.7716
16 53825488 rs9941349 42.58824 395.5801
"
FTO <- read.table(text = txt, header = TRUE, stringsAsFactors = FALSE)
par(mar = c(5, 6, 2, 1))
mhtplot.trunc(
x = FTO,
chr = "CHR",
bp = "POS",
log10p = "log10P",
snp = "SNP",
cex = 1.0,
cex.axis = 1.2,
cex.mtext = 1.5,
col = "navy"
)
title("FTO locus without truncation")
par(mar = c(5, 6, 2, 1))
mhtplot.trunc(
x = FTO,
chr = "CHR",
bp = "POS",
log10p = "log10P",
snp = "SNP",
trunc.yaxis = TRUE,
y.brk1 = 200,
y.brk2 = 350,
y.ax.space = 50,
genomewideline = -log10(5e-8),
suggestiveline = NULL,
highlight = c("rs1421085", "rs1558902", "rs17817449",
"rs8050136", "rs9939609"),
annotatelog10P = 420,
annotateTop = FALSE,
cex = 1.2,
cex.text = 0.9,
cex.axis = 1.2,
cex.mtext = 1.5,
col = "steelblue4"
)
title("FTO locus with truncated y-axis")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.