This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Divide the genome to vary lengths windows in R

Hi,

I have BED file with vary windows lengths, and I want to divide the whole genome to non-overlapping bins in same lengths distribution of the BED file in R.

For example, if the chromosome length is 50, and the windows lengths are 10,10,20 , the output should be:

chr1 1 10
chr1 11 20
chr1 21 40
chr1 41 50

Any suggestions?

Thank you!

bedtools r bed

Can you add a representative example?

These windows are not indexed correctly for the BED format, and are not of the same length distribution.

1 answer

You can use bedtools makewindows in R or linux.

Log in to answer this question.