Entering edit mode
9.5 years ago
biocyberman
▴
870
I have been looking at bedtools
and bedops
to do the following thing but haven't figured out:
Input bed:
chr1 1000 2000 geneA 0 +
chr1 2100 2500 geneB 0 +
chr1 2800 3200 geneC 0 +
chr1 3700 4600 geneD 0 +
Output by 500 bases fragments inside those BED intervals:
chr1 1000 1500 geneA 0 + # split action
chr1 1500 2000 geneA 0 + # split action
chr1 2100 2900 geneB,geneC 0 + # join action: 400 from 2100 - 2500, and 100 from 2800 - 2900
chr1 2900 3900 geneC,geneD 0 + # join action: 300 from 2900 - 3200, and 200 from 3700 - 3900
chr1 3900 4400 geneD 0 + # split action
chr1 4400 4600 geneD 0 + # split action, take the rest
For simplicity, input bed do not have overlapping intervals.
I know that this is not the answer you're looking for but maybe you should try to write a little
perl/python/awk
script to do it.If there is no quick way, I will have to spend time and do it.
Reading more carefully about
--stagger
and--chop
operation ofbedops
, they may actually can do what I want.No, bedops doesn't do what I want: