arq5x / bedtools

A powerful toolset for genome arithmetic.
http://code.google.com/p/bedtools/
GNU General Public License v2.0
140 stars 85 forks source link

Invalid -f Argument in windowBed #85

Open duartemolha opened 11 years ago

duartemolha commented 11 years ago

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.

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

bedtools v2.16.2, Linux Debian

duartemolha commented 11 years ago

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

arq5x commented 11 years ago

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.

duartemolha commented 11 years ago

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 commented 11 years ago

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