R包CMplot对多个性状的GWAS结果进行可视化

setwd("/mnt/d/wsj/GLM/Q")
library(CMplot)
SNPs <- c("NC_041007.1:38508460", "NC_041007.1:38516387")  # 用您实际的SNP名称替换这里的示例SNP
file_list <- list.files(pattern = "\\.txt$")
#曼哈顿图
for (file in file_list) {
data <- read.table(file)
  CMplot(data, plot.type="m", LOG10=TRUE, ylim=NULL, threshold=c(1e-6),threshold.lty=c(1,2),
         threshold.lwd=c(1,1), threshold.col=c("black","grey"), amplify=TRUE,bin.size=1e6, highlight=SNPs, highlight.col=c("green", "blue"), highlight.cex=1,
         chr.den.col=c("darkgreen", "yellow", "red"),signal.col=c("red","green"),signal.cex=c(1.5,1.5),
         signal.pch=c(19,19),file="jpg",file.name=file, dpi=300,file.output=,verbose=TRUE,
         width=14,height=6,main="")
}


#QQ图
setwd("D:/wsj/MLM/Q")
library(CMplot)
file_list <- list.files(pattern = "\\.txt$")

# 循环遍历每个文件,进行绘图并保存为jpg文件
for (file in file_list) {
data <- read.table(file)
  CMplot(data,plot.type="q",box=FALSE,file="jpg",file.name=file,main="",dpi=300,
    conf.int=TRUE,conf.int.col=NULL,threshold.col="red",threshold.lty=2,
    file.output=TRUE,verbose=TRUE,width=5,height=5)
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值