CMplot
CMplot copied to clipboard
How to put highlighted text just above the points?
Hi Lilin,
Thanks very much for developing this useful tool.
I wonder if there is a way to add highlighed text labels right on top of the points, like this one.

Thank you in advance.
Bests, Yiwei
Hi Yiwei,
I am not sure if it can address your issue, please try to add two parameters in CMplot, like: highlight.text.yadj=rep(1, length(N_ht)), highlight.text.xadj=rep(0, length(N_ht)), where N_ht is the number of highlighted SNPs.
Regards, Lilin
Hi Lilin,
Thank you for your quick reply. I tried this method, but it did not work.
In highlight.text.yadj=rep(1, length(N_ht)), highlight.text.xadj=rep(0, length(N_ht)), N_ht should be the highlighted SNPs?
Otherwise it would throw an error like:
Error in highlight_text(x = pvalue.posN[highlight_index[[i]]], y = logpvalue[highlight_index[[i]]], : length of xadj not equals to length of x
Bests, Yiwei
Sorry for the unclear statement, it should be rep(1, N_ht) or rep(1, length(ht).
This setting only helps to initialize the start positions of labels around the highlighted points, however, if there are too many highlighted SNPs, the positions will be changed to generate non-overlapped layout.
Hi Lilin,
Thanks a lot for your prompt reply. There were about six SNPs I wanted to highlight. Using highlight.text.yadj = rep(1, N_ht), highlight.text.xadj = rep(0, N_ht) could not generate the plot I pasted above. Maybe I will use AI to modify the final plot.
Thank you.