xie186 / ViewBS

ViewBS - a powerful toolkit for visualization of high-throughput bisulfite sequencing data
GNU General Public License v3.0
83 stars 27 forks source link

According to per bins meth to calculate bin average bin methylation ? #36

Closed qliugithub closed 3 years ago

qliugithub commented 5 years ago

Hello, I find MethOverRegion was calculate bin average according to per bin's methylation rather than all_bin_Total C/ all_bin_Total (C + T), can u add one function which similarly with MethHeatmap can calculate bin average bin methylation according to per bin's methylation rather than Total C/ Total (C + T), and then drawing element metaplot, thanks.

xie186 commented 5 years ago

Hi @qliugithub,

Thanks for using ViewBS. I think ViewBS does exactly what you are suggesting here. Please see the code here: https://github.com/xie186/ViewBS/blob/13506b5004027e472bc0ecc421b51b02514ca31e/lib/Meth/OverRegion.pm#L62

Please let me know if you have further questions.

Best, Shaojun

qliugithub commented 4 years ago

sorry. Util now noticed. I was mean, Firstly calculate one type meth per bin , and then calculate the average meth of all this type bin, for example: bin1 bin2 bin3 A 1 0.5 1 B 0 .3 0.2 C 0.2 0.5 1 then bin1's meth was (1 + 0.3 + 0.2)/3 = 0.5, rather than bin1's (total_C)/(Total_C + Total_T) thanks!