#作图前需要安装CMplot软件包
install.packages("CMplot")
library(data.table)
library(CMplot)
#读取数据
map<-read.table("2299.map",sep="",head=FALSE)
head(map)
#提取所需数据的子集
library(dplyr)
map1=map%>%dplyr::select(SNP=2,Chromosome=1,Position=4)
#去除染色体为X1和X2的数据
map2<- subset(map1, Chromosome != "X1")
map3<- subset(mm, Chromosome != "X2")
#作图
CMplot(map3,plot.type="d",bin.size=1e6,col=c("darkgreen","yellow","red"), file="tiff",memo="",dpi=300,file.output=TRUE,verbose=TRUE)
2023-01-02 王志英