使用CMplot包繪制環(huán)形曼哈度圖
安裝并加載所需R包
install.packages("CMplot")
library(CMplot)
基本用法
CMplot(Pmap, col=c("#377EB8", "#4DAF4A", "#984EA3", "#FF7F00"),
bin.size=1e6, bin.max=NULL, pch=19, band=1, cir.band=0.5, H=1.5,
ylim=NULL, cex.axis=1, plot.type="b", multracks=FALSE, cex=c(0.5,1,1),
r=0.3, xlab="Chromosome", ylab=expression(-log[10](italic(p))), xaxs="i",
yaxs="r", outward=FALSE, threshold = NULL, threshold.col="red",
threshold.lwd=1, threshold.lty=2, amplify= TRUE, chr.labels=NULL,
signal.cex = 1.5, signal.pch = 19, signal.col="red", signal.line=1,
cir.chr=TRUE, cir.chr.h=1.5, chr.den.col=c("darkgreen", "yellow", "red")
, cir.legend=TRUE, cir.legend.cex=0.6, cir.legend.col="black",
LOG10=TRUE, box=FALSE, conf.int.col="grey", file.output=TRUE,
file="jpg", dpi=300, memo="")
常用參數(shù)
Pmap 輸入數(shù)據(jù)文件
col 設(shè)置不同染色體中點(diǎn)的顏色
cex 設(shè)置點(diǎn)的大小
pch 設(shè)置點(diǎn)的形狀
band 設(shè)置不同染色體之間的間隔
H 設(shè)置每個圈的高度
ylim 設(shè)置y軸的范圍
bin.size 設(shè)置SNP密度圖中的窗口大小
cex.axis 設(shè)置坐標(biāo)軸字體和標(biāo)簽字體的大小
plot.type 設(shè)置不同的繪圖類型劫流,可以設(shè)定為 "d", "c", "m", "q" or "b"
multracks 設(shè)置是否需要繪制多個track
r 設(shè)置圈的半徑大小
xlab 設(shè)置x軸標(biāo)簽
ylab 設(shè)置y軸標(biāo)簽
outward 設(shè)置點(diǎn)的朝向是否向外
threshold 設(shè)置閾值并添加閾值線
threshold.col 設(shè)置閾值線的顏色
threshold.lwd 設(shè)置閾值線的寬度
threshold.lty 設(shè)置閾值線的類型
amplify 設(shè)置是否放大顯著的點(diǎn)
signal.cex 設(shè)置顯著點(diǎn)的大小
signal.pch 設(shè)置顯著點(diǎn)的形狀
signal.col 設(shè)置顯著點(diǎn)的顏色
chr.labels 設(shè)置染色體的標(biāo)簽
chr.den.col 設(shè)置SNP密度圖的顏色
cir.band 設(shè)置環(huán)狀曼哈度圖中不同染色體之間的間隔
cir.chr 設(shè)置是否顯示染色體的邊界
cir.chr.h 設(shè)置染色體邊界的高度
cir.legend 設(shè)置是否顯示圖例
cir.legend.cex 設(shè)置圖例字體的大小
cir.legend.col 設(shè)置圖例的顏色
LOG10 設(shè)置是否對p-value取log10對數(shù)
conf.int.col 設(shè)置QQ圖中置信區(qū)間的顏色
file.output 設(shè)置是否輸出圖片
file 設(shè)置輸出圖片的格式,可以設(shè)定為"jpg", "pdf", "tiff"
dpi 設(shè)置輸出圖片的分辨度
memo 設(shè)置輸出圖片文件的名字
加載并查看示數(shù)據(jù)
data(pig60K)
head(pig60K)
SNP Chromosome Position trait1 trait2 trait3
1 ALGA0000009 1 52297 0.7738187 0.51194318 0.51194318
2 ALGA0000014 1 79763 0.7738187 0.51194318 0.51194318
3 ALGA0000021 1 209568 0.7583016 0.98405289 0.98405289
4 ALGA0000022 1 292758 0.7200305 0.48887140 0.48887140
5 ALGA0000046 1 747831 0.9736840 0.22096836 0.22096836
6 ALGA0000047 1 761957 0.9174565 0.05753712 0.05753712
基本數(shù)據(jù)格式:
前三列分別為SNP的名稱丛忆,所在染色體祠汇,SNP的位置,
后面每列為不同性狀的P值熄诡,每個性狀單獨(dú)一列
默認(rèn)繪圖(分別繪制出SNP密度圖可很,曼哈頓圖,環(huán)形曼哈頓圖和QQ圖)
CMplot(pig60K)
單獨(dú)繪制SNP密度圖
CMplot(pig60K,plot.type = "d",bin.size = 1e6, col = c("darkgreen","yellow","red"))
繪制單性狀曼哈頓圖
CMplot(pig60K,plot.type = "m",threshold = c(0.01,0.05)/nrow(pig60K),threshold.col=c('grey','black'),
threshold.lty = c(1,2),threshold.lwd = c(1,1), amplify = T,
signal.cex = c(1,1), signal.pch = c(20,20),signal.col = c("red","orange"))
繪制多性狀曼哈頓圖
CMplot(pig60K,plot.type = "m",threshold = c(0.01,0.05)/nrow(pig60K),threshold.col=c('grey','black'),
threshold.lty = c(1,2),threshold.lwd = c(1,1), amplify = T, multracks = T,
signal.cex = c(1,1), signal.pch = c(20,20),signal.col = c("red","orange"))
繪制環(huán)形曼哈頓圖
CMplot(pig60K,plot.type="c",r=0.5,threshold=c(0.01,0.05)/nrow(pig60K),cex = 0.5,
threshold.col = c("red","orange"), threshold.lty = c(1,2),amplify = T, cir.chr.h = 2,
signal.cex = c(2,2), signal.pch = c(19,20), signal.col=c("red","green"),outward=TRUE)
繪制單性狀QQ圖
CMplot(pig60K,plot.type = "q",threshold = 0.05)
繪制多性狀QQ圖
CMplot(pig60K,plot.type = "q",multracks = T, threshold = 0.05, threshold.col = "orange",
amplify = T,signal.cex = 1.5, signal.pch = 20, signal.col = "red")