bedtools icon indicating copy to clipboard operation
bedtools copied to clipboard

Invalid -f Argument in windowBed

Open duartemolha opened this issue 10 years ago • 4 comments

What steps will reproduce the problem?

  1. windowBed -a file1.bed -b file2.bed -c f 1.0

What is the expected output? What do you see instead?

I expect counts of the number of entries in file B that overlap with file A and where the entire faction of entry in file A is overlaped by an entry in File B

I get instead an error says *ERROR: Unrecognized parameter: -f This indicated that the file of operation I am trying to achieve is not supported... However, if is documented in the usage for the tool under the -c Argument: -c For each entry in A, report the number of overlaps with B. - Reports 0 for A entries that have no overlap with B. - Overlaps restricted by -f.

What version of the product are you using? On what operating system?

bedtools v2.16.2, Linux Debian

duartemolha avatar Sep 17 '13 13:09 duartemolha

Just updated to the latest bedtools and the issue is still there.

duartemolha avatar Sep 17 '13 13:09 duartemolha

Sorry, the docs are wrong. The -f option is not currently available in the window tool. You can easily get the behavior you want be adding slop to your A file with the slop command and then pipe the results to intersect, which does have the -f option.

arq5x avatar Sep 17 '13 13:09 arq5x

A question I have regarding window. In the current form, it counts any overlap right? So if file B contains 3 regions that overlap with A even by only 1bp it will be counted. Am I correct?

Also I believe the current default behavior of assuming a query of 1000 bp upstream and downstream is counterintuitive IMHO. It took me a while to realize I was getting incorrect results because I assumed window -c would count only overlapping features and not default to a search space of 1kb either side.

duartemolha avatar Sep 17 '13 14:09 duartemolha

A good improvement to windowBed would be to allow the -w flag to have negative values... so you could output counts for overlaps...

As an example:

windowBed -a file1.bed -b file2.bed -w -60 -c 

This would basicaly only count the number of features in file2 that overlaped at least 60bp of file1.bed

duartemolha avatar Sep 17 '13 14:09 duartemolha