Thanks for the answer. Would you please clarify a bit more. I can't exactly follow what "bedmap --echo --max-element" is doing. I did run this on my wig file. Just pasting top few lines of my wig and output file:
[D_Melanogaster]$ wig2bed < R1.wig | bedmap --echo --max-element - > answer.bed
[D_Melanogaster]$ head -n5 R1.wig
chrX 5 40 8.01596910471638
chrX 105 140 9.84274069026994
chrX 205 240 10.3630144423714
chrX 305 340 9.76566981010343
chrX 405 440 8.91672795759724
[D_Melanogaster]$ head -n5 answer.bed
chr2L 192 227 id-539832 15.701525|chr2L 192 227 id-539832 15.701525
chr2L 292 327 id-539833 18.030737|chr2L 292 327 id-539833 18.030737
chr2L 392 427 id-539834 16.980151|chr2L 392 427 id-539834 16.980151
chr2L 492 527 id-539835 13.950963|chr2L 492 527 id-539835 13.950963
chr2L 592 627 id-539836 11.384652|chr2L 592 627 id-539836 11.384652
What is the difference between signal values shown in wig and output file? Also to further clarify my question, I have already called peaks from wig file using MACS. I already have peak regions in bed narrowpeak file. Following are top few lines of my bed narrowpeak file:
[D_Melanogaster]$ head -n5 R1_peak.bed
chr2L 193 5728 GoatAb_R1_peak.bed_narrowPeak1 323 . 0 0 0 2585
chr2L 5928 8328 GoatAb_R1_peak.bed_narrowPeak2 404 . 0 0 0 350
chr2L 10128 10728 GoatAb_R1_peak.bed_narrowPeak3 80 . 0 0 0 250
chr2L 11128 12228 GoatAb_R1_peak.bed_narrowPeak4 135 . 0 0 0 450
I need a figure showing height of the peaks. Can the score value in the 5th column of narrowpeak file be used for that?
Thank you