bedtools2 icon indicating copy to clipboard operation
bedtools2 copied to clipboard

bedtools fisher

Open juicybrain opened this issue 3 years ago • 4 comments

Hi,

Thank you for the creation and maintenance of bedtools.

It's hard for me to comprehend the results of using " bedtools fisher" to calculate the overlapping of two bed files. It works well for some cases; however, one situation occurs repeatedly. Notably, the "Number of query intervals" and "Number of possible intervals" are equal in both cases. I checked to make sure the bed files are sorted, and the genome size file is valid. Could you please help with this? Thank you very much!

The result would be like:

case1: '# Number of query intervals: 1026 '# Number of db intervals: 14 '# Number of overlaps: 43 '# Number of possible intervals (estimated): 1026 '# phyper(43 - 1, 1026, 1026 - 1026, 14, lower.tail=F) '# Contingency Table Of Counts '#_________________________________________ '# | in -b | not in -b | '# in -a | 43 | 983 | '# not in -a | 0 | 0 | '#_________________________________________ '# p-values for fisher's exact test left right two-tail ratio 1 1 1 -nan

case2:

'# Number of query intervals: 1381 '# Number of db intervals: 53 '# Number of overlaps: 104 '# Number of possible intervals (estimated): 1381 '# phyper(104 - 1, 1381, 1381 - 1381, 53, lower.tail=F) '# Contingency Table Of Counts '#_________________________________________ '# | in -b | not in -b | '# in -a | 104 | 1277 | '# not in -a | 0 | 0 | '#_________________________________________ '# p-values for fisher's exact test left right two-tail ratio 1 1 1 -nan

juicybrain avatar May 13 '22 01:05 juicybrain

could you share the relevant input files?

arq5x avatar May 26 '22 21:05 arq5x

I am having the exact same problem

lucananni93 avatar Jun 16 '22 17:06 lucananni93

There were changes to fisher's calculations in bedtools 2.30.0. Are you using that version, or an earlier version?

jmarshall avatar Jun 17 '22 09:06 jmarshall

I am using bedtools version 2.30.0

lucananni93 avatar Jun 17 '22 11:06 lucananni93