YinLiLin / CMplot

📊 Circular and Rectangular Manhattan Plot
499 stars 111 forks source link

Highlight text the higest SNP #94

Closed eightYao2 closed 1 year ago

eightYao2 commented 1 year ago

Hi, Appreciat you providing this awesome tool!!! I'm trying to make manhattan plot with highlight the higest point of SNP in every chromosome.I wonder if there is a way to achieve this?

Thank you in advance.

Bests, RC

YinLiLin commented 1 year ago

Thank you for the question, here is the example script for your purpose:

library(CMplot)
data(pig60K)
index <- tapply(pig60K[, 4], pig60K[, 2], which.min)
snps <- NULL
for(i in 1:length(index)){
snps <- c(snps, as.character(pig60K[pig60K[, 2] == names(index[i]), 1][index[i]]))
}
CMplot(pig60K[,1:4], col="grey", plot.type="m", highlight=snps)

Please replace 'pig60K' with your own data, and try again. Best, LL

eightYao2 commented 1 year ago

Thank you. I tried many way to achieve this goal still get somewhere wrong.Thanks for the provide this answer!!