This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Creating sliding window for methylation data

Hi,

I have some WGBS data in BED format (e.g., chr1 10470 10472 0.667 3 C:0.500:2,G:1.000:1) and I want to bin the data into fixed-size windows, such as 1 kb, and then apply smoothing similar to what BSmooth does. I tried to utilized BSmooth but it doesn’t seem to support outputting the window coordinates directly. I’d also like to ensure that each window contains enough data—ideally avoiding windows that are empty or have very few CpG sites.

Does anyone have any ideas on how to achieve this?

wgbs methylation

1 answer

BEDOPS bedmap has windowing and statistics options: https://bedops.readthedocs.io/en/latest/content/reference/statistics/bedmap.html

You would use the window options to set your window size, and then specify statistics operations to calculate summary statistics over those windows. You can output the windows with summary statistics. The documentation goes through a clear example of this.

Thanks for your reply. It’s a great tool, and I did end up using it in some way.

You're welcome and I'm glad it is useful.

Log in to answer this question.