YinLiLin / CMplot

📊 Circular and Rectangular Manhattan Plot
520 stars 112 forks source link

highlight SNPs of interest #37

Closed devenderarora closed 3 years ago

devenderarora commented 4 years ago

Dear Sir, I am having trouble in highlighting selected snps in to the data. I am able to plot manhattan plot without highlighting the data but I need to mention the interested peaks. My data look like this: id,chrom,start,stop,pos_start,pos_stop,modelL,nullL,sel_coef,nSNPs,nSNPs_avail,xpclr,xpclr_norm 1_00000001_00010000,1,1,10000,370,9391,-21.57511232,-21.57511232,0,25,25,0,-0.288632752 1_00010001_00020000,1,10001,20000,10204,19529,-28.5999139,-28.5999139,0,28,28,0,-0.288632752 1_00020001_00030000,1,20001,30000,20802,29869,-49.15397259,-49.15397259,0,43,43,0,-0.288632752 1_00030001_00040000,1,30001,40000,30199,39497,-23.50799212,-23.50799212,0,28,28,0,-0.288632752

Want to highlight xpclr peaks (58.0014, 64.837) and their gene ids.

I am running CMplot(bp, type="h",plot.type="m", band=0.5, LOG10=FALSE, ylab="SNP effect",ylim=c(), highlight.gene=c("Gene1", "Gene2") threshold.lty=2, threshold.lwd=1, threshold.col="red", amplify=FALSE,cex=0.6, chr.den.col=NULL, file="jpg",memo="",dpi=300,file.output=TRUE,verbose=TRUE)

Please suggest what to fix? Thanks

YinLiLin commented 4 years ago

Hi, theoretically CMplot can only be used for visualizing the SNP based results, but not for the segments with start and end position, some users just roughly use the mean value of segments to plot. For your problem, please refer to the documents on GitHub, if you would like to highlight some peaks, please firstly pick up the names of the peaks of interest, which are located at the first column of the data, then assign it as a vector to parameter highlight, also to parameter highlight.text if you want to show the full names on the plot, there is no parameter named highlight.gene in CMplot, please refer to the following codes:

CMplot(data, ..., highlight = yourpeaks, highlight.text = yourpeaks)
devenderarora commented 4 years ago

Dear YinLiLin, I am running the script as below: CMplot(data, ..., highlight = 58.0014, highlight.text = GENE1) I am getting an error: No shared SNPs between Pmap and highlight How to fix this situation?

YinLiLin commented 4 years ago

Try CMplot(data, ..., highlight = GENE1, highlight.text = GENE1)

devenderarora commented 4 years ago

I tried with the above mentioned script but ended up with "object GENE1 not found" Is there any way I can highlight peaks only from xpclr column only. I only have 5 peaks of interest and I can label them manually.

YinLiLin commented 4 years ago

Yes, but you should assign a vector containing all the names of peaks you interest to "GENE" prior to plotting

devenderarora commented 3 years ago

Dear YinLiLin, Thankyou for your great help. I able to fix and highlight the gene of interest on specific peaks. Regards Devender Arora