Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add makewindows initial window/step feature #936

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hisakatha
Copy link
Contributor

Add a feature to makewindows that the initial window size and the initial step size can be specified.

I need to get tiling windows representing rounded coordinates at some digits.
That is, rounded coordinates at a digit are the boundaries of target windows.
For example:

chr1     0   500
chr1   500  1500
chr1  1500  2500
...

Currently, this kind of windows may be obtained by bedtools makewindows, bedtools shift, concatenate short intervals for each chromosome, and bedtools sort. However, the target windows can be obtained by only bedtools makewindows with some modifications, and it will be efficient (sorry, but I have not benchmarked).

In this pull request, I introduced "initial window size" (-iw) option and "initial step size" (-is) option. Using the options, you can use bedtools makewindows as follows:

$ bedtools makewindows -g <(echo -e "chromA\t3900\nchromB\t2200") -w 1000 -iw 500 -i srcwinnum -reverse
chromA  0       500     chromA_5
chromA  500     1500    chromA_4
chromA  1500    2500    chromA_3
chromA  2500    3500    chromA_2
chromA  3500    3900    chromA_1
chromB  0       500     chromB_3
chromB  500     1500    chromB_2
chromB  1500    2200    chromB_1
$ bedtools makewindows -g <(echo -e "chromA\t3900\nchromB\t2200") -w 20 -iw 10 -s 1000 -is 990 -i srcwinnum -r
everse
chromA  0       10      chromA_4
chromA  990     1010    chromA_3
chromA  1990    2010    chromA_2
chromA  2990    3010    chromA_1
chromB  0       10      chromB_3
chromB  990     1010    chromB_2
chromB  1990    2010    chromB_1

I'd like to share the changes.
Please feel free to edit my commit and comments.

Add a feature to makewindows that the initial window size
and the initial step size can be specified. Now makewindows
can treat the first window specially, which is useful, for example,
for tiling chromosomes by windows representing rounded coordinates.
For example:
chr1     0   500
chr1   500  1500
chr1  1500  2500
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant