manhattan | R Documentation |
This function was designed to create a manhattan plot using a data frame with columns "Chrom" (Chromosome), "Position" and "p.val" (significance for the test).
manhattan(map, col=NULL, fdr.level=0.05, show.fdr=TRUE, PVCN=NULL, ylim=NULL, ...)
map |
the data frame with 3 columns with names; "Chrom" (Chromosome), "Position" and "p.val" (significance for the test). |
col |
colors prefered by the user to be used in the manhattan plot. The default is NULL which will use the red-blue palette. |
fdr.level |
false discovery rate to be drawn in the plot. |
show.fdr |
a TRUE/FALSE value indicating if the FDR value should be shown in the manhattan plot or not. By default is TRUE meaning that will be displayed. |
PVCN |
In case the user wants to provide the name of the column that should be treated as the "p.val" column expected by the program in the 'map' argument. |
ylim |
the y axis limits for the manhattan plot if the user wants to customize it. By default the plot will reflect the minimum and maximum values found. |
... |
additional arguments to be passed to the plot function such as pch, cex, etc. |
If all parameters are correctly indicated the program will return:
a manhattan plot
Giovanny Covarrubias-Pazaran
Covarrubias-Pazaran G (2016) Genome assisted prediction of quantitative traits using the R package sommer. PLoS ONE 11(6): doi:10.1371/journal.pone.0156744
The core functions of the package mmer
#random population of 200 lines with 1000 markers
M <- matrix(rep(0,200*1000),1000,200)
for (i in 1:200) {
M[,i] <- ifelse(runif(1000)<0.5,-1,1)
}
colnames(M) <- 1:200
set.seed(1234)
pp <- abs(rnorm(500,0,3));pp[23:34] <- abs(rnorm(12,0,20))
geno <- data.frame(Locus=paste("m",1:500, sep="."),Chrom=sort(rep(c(1:5),100)),
Position=rep(seq(1,100,1),5),
p.val=pp, check.names=FALSE)
geno$Locus <- as.character(geno$Locus)
## look at the data, 5LGs, 100 markers in each
## -log(p.val) value for simulated trait
head(geno)
tail(geno)
manhattan(geno)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.