9.5 GWAS显著SNP筛选及曼哈顿图绘制

在R中进行整理,pmap格式在下面帖子中有详细介绍。第一列为SNP的ID,第二列为chr,第三列为SNP的位置,第四列开始为每个性状的SNP的P值。
9.3 GWAS:关联分析——EMMAX - (jianshu.com)

> pmap<- read.table("pmap.txt", header = T)
> head(pmap)
               ID  Chr  position        p
1 Chr1__100201597 Chr1 100201597 0.546670
2 Chr1__100201604 Chr1 100201604 0.332930
3 Chr1__100201625 Chr1 100201625 0.095997
4 Chr1__100201634 Chr1 100201634 0.182580
5 Chr1__100201638 Chr1 100201638 0.087536
6 Chr1__100201672 Chr1 100201672 0.611720

阈值:

9.4 GWAS:显著性阈值确定——GEC - (jianshu.com)
阈值 = 显著性/有效SNP数

> threshold <- 1/292493
> threshold
[1] 3.418885e-06

显著SNP筛选

> sig <- subset(pmap, p <= threshold)
> sig
[1] ID       Chr      position p       
<0 行> (或0-长度的row.names)

即在此性状中,没有显著的SNP。

图形绘制

> library("CMplot")
> CMplot(pmap, threshold = threshold, amplify = F, memo = "", file = "tiff", plot.type=c("m","q"))

函数解释同9.3 GWAS:关联分析——EMMAX - (jianshu.com)

Manhattan plot

QQ plot

黑白曼哈顿图

> CMplot(pmap, plot.type="m", col=c("grey30","grey60"), LOG10=TRUE, threshold=threshold,threshold.lty=c(1,2), threshold.lwd=c(1,1), threshold.col=c("black"), amplify=TRUE,chr.den.col=NULL, signal.col=c("red"), signal.cex=c(1,1),signal.pch=c(19,19),file="tiff",memo="",file.output=TRUE,verbose=TRUE)


引用转载请注明出处,如有错误敬请指出。

你可能感兴趣的:(9.5 GWAS显著SNP筛选及曼哈顿图绘制)