asntech / intervene

Intervene: a tool for intersection and visualization of multiple genomic region and gene sets
http://intervene.rtfd.io/
Other
132 stars 28 forks source link

Differences between bedtools command line vs intervene pairwise? #59

Open unique379r opened 9 months ago

unique379r commented 9 months ago

Hi, I have question about values obtain from bedtools and intervene of Jaccard similarity.

Command bedtools jaccard in bash script:

bedtools jaccard -a "$file1" -b "$file2" -f 1.0 -r -e | grep -v "intersection" | awk '{print $3}'

Sample  A   B   C   D   E   
A   1   0.307771    0.326171    0.257917    0.261808    
B   0.307771    1   0.32018 0.242112    0.248604    
C   0.326171    0.32018 1   0.260097    0.270409    
D   0.257917    0.242112    0.260097    1   0.363778    
E   0.261808    0.248604    0.270409    0.363778    1   

From intervene pairwise

intervene pairwise -i *.bed --compute jaccard --bedtools-options f=1.0,r,e --htype tribar --output pairwise-results
    A   B   C   D   E
A   1.0 0.34152 0.355896    0.277933    0.282856
B   0.34152 1.0 0.354377    0.268735    0.269864
C   0.355896    0.354377    1.0 0.285222    0.290961
D   0.277933    0.268735    0.285222    1.0 0.386835
E   0.282856    0.269864    0.290961    0.386835    1.0

I am wondering, why the both results slightly differ in the values(jaccard index) of the sample.

Any clue ? Any insight would be helpful for my analysis.

Thanks Rupesh

asntech commented 9 months ago

Hi @unique379r are you using the same order of files (-a and -b) when computing the scores using the bedtools that you're using with the intervene?

unique379r commented 9 months ago

Thats a good point, i will confirm and get back you soon. thanks