fixed number of bins with makewindows

83 views
Skip to first unread message

Aarthi Mohan

unread,
Mar 16, 2016, 10:04:38 AM3/16/16
to bedtools-discuss
Hi,

This might be a very trivial doubt, but I would like to know how makewindows partition a given interval when we use -n (fixed number of windows). 

Example of what I see in my case:
bedtools makewindows -b test1.bed -n 10 -i srcwinnum
chr1    11      15      xxxxx_1
chr1    15      19      xxxxx_2
chr1    19      23      xxxxx_3
chr1    23      27      xxxxx_4
chr1    27      31      xxxxx_5
chr1    31      35      xxxxx_6
chr1    35      39      xxxxx_7
chr1    39      43      xxxxx_8
chr1    43      44      xxxxx_9

Why is it am getting 9 bins instead of 10? Same thing happens for the some genes in my annotation file, where I get less than 'n' bins. 

Bedtools version: 2.25.0

Thanks for your help!

Best,
Aarthi

Aaron Quinlan

unread,
Mar 16, 2016, 2:57:35 PM3/16/16
to bedtools...@googlegroups.com
Thanks for reporting this, Aarthi. It looks like an accounting bug and I will look into resolving it.

Best,
Aaron

--
You received this message because you are subscribed to the Google Groups "bedtools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bedtools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gokhul Krishna Kilaru

unread,
Mar 16, 2016, 3:10:07 PM3/16/16
to bedtools-discuss
Thanks Aaron. Even I was having the same issue.

Aarthi Mohan

unread,
Mar 24, 2016, 8:30:23 AM3/24/16
to bedtools-discuss
Thanks Aaron, it will be really helpful.

Regards,
Aarthi

Aaron Quinlan

unread,
May 4, 2016, 10:17:24 PM5/4/16
to bedtools...@googlegroups.com
Hi Aarthi,

Thanks again for reporting this - I have addressed it and the fix is in the repository on github (https://github.com/arq5x/bedtools2)

$ bedtools makewindows -b test1.bed -n 10 -i srcwinnum
1 11 14 A_1
1 14 17 A_2
1 17 20 A_3
1 20 23 A_4
1 23 26 A_5
1 26 29 A_6
1 29 32 A_7
1 32 35 A_8
1 35 38 A_9
1 38 44 A_10

I have also added a warning when an interval’s length is less than the number of bins requested:

$ cat test2.bed
1 10 19 B
bedtools makewindows -b test2.bed -n 10 -i srcwinnum
WARNING: Interval 1:10-19 is smaller than the number of windows requested. Skipping.
Reply all
Reply to author
Forward
0 new messages