YinLiLin / CMplot

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

Multitrack threshold not coloring/sizing as expected #82

Closed michaelofrancis closed 1 year ago

michaelofrancis commented 1 year ago

Hello,

When I run the code from the example, the plot colors and dot sizes between threshold 1 and threshold 2 work as expected. This is copied from the example:

CMplot(pig60K, plot.type="m", col=c("grey30","grey60"), LOG10=TRUE, ylim=c(2,12), threshold=c(1e-6,1e-4), threshold.lty=c(1,2), threshold.lwd=c(1,1), threshold.col=c("black","grey"), amplify=TRUE, chr.den.col=NULL, signal.col=c("red","green"), signal.cex=c(1.5,1.5),signal.pch=c(19,19), file="jpg",memo="",dpi=300,file.output=TRUE,verbose=TRUE,width=14,height=6)

image

However, if I add multracks=TRUE to plot these traits on the same plot, the coloring/sizing between the two threshold lines does not work as expected.

CMplot(pig60K, plot.type="m", multracks=TRUE, col=c("grey30","grey60"), LOG10=TRUE, ylim=c(2,12), threshold=c(1e-6,1e-4), threshold.lty=c(1,2), threshold.lwd=c(1,1), threshold.col=c("black","grey"), amplify=TRUE, chr.den.col=NULL, signal.col=c("red","green"), signal.cex=c(1.5,1.5),signal.pch=c(19,19), file="jpg",memo="",dpi=300,file.output=TRUE,verbose=TRUE,width=14,height=6)

image

Your help would be appreciated. Thanks!

YinLiLin commented 1 year ago

Hi, the "signal.col" will be used to highlight the traits if "multracks=TRUE", rather than highlighting the points located in different intervals, this highlighting strategy is required by another user. Anyway, i will change it back as you desired.

michaelofrancis commented 1 year ago

Thanks! I think the way I am describing here is more intuitive and it seems like it was your original thought as well.

michaelofrancis commented 1 year ago

Were you going to edit it? Or is there a previous commit that I can use which has that option?

YinLiLin commented 1 year ago

Yep, i will edit it, and submit a new version in the coming days.

YinLiLin commented 1 year ago

Hi, sorry for the late response, the latest version 4.3.0 on GitHub has been updated for the issue you proposed, please source the online script and have a try.

> source("https://raw.githubusercontent.com/YinLiLin/CMplot/master/R/CMplot.r")
> CMplot(pig60K, plot.type="m", multracks=TRUE, col=c("grey30","grey60"), LOG10=TRUE, ylim=c(2,12), 
threshold=c(1e-6,1e-4),threshold.lty=c(1,2), threshold.lwd=c(1,1), threshold.col=c("black","grey"), 
amplify=TRUE, chr.den.col=NULL, signal.col=c("red","green"), signal.cex=c(1.5,1.5),signal.pch=c(19,19),
file="jpg",memo="",dpi=300,file.output=TRUE,verbose=TRUE,width=14,height=6)

Multraits-Manhattan trait1 trait2 trait3

michaelofrancis commented 1 year ago

Thank you! Excellent software!