This is a test version of Biostars. For the public version, visit https://www.biostars.org.
overlap statistics among multiple bed files

Hi everyone

I am working on multiple bed files and would like to have a summary of overlap (or percentage overlap) among those regions coming from multiple files. Is there any method that provide summary of "overlap" among different bed files ?

Thanks in advance

bedtools

1 answer

find DIR1 -type f  -name "*.bed" | while read A; do find DIR1 -type f  -name "*.bed" | while read B; do bedtools intersect -a "${A}" -b "${B}" | bedtools summary -i - -g /path/to/genome.txt | awk -vA=${A} -vB=${B} '{printf("%s\t%s\t%s\n",A,B,$0);}' ; done ; done 

thanks alot for sharing it. I tried it on my bed files but I am getting error of "error: unrecognized command: summary" In bedtolls, there is no summary parameter .

$ bedtools --version
bedtools v2.30.0

$ bedtools 2>&1 | grep summa
    groupby       Group by common cols. & summarize oth. cols. (~ SQL "groupBy")
    summary       Statistical summary of intervals in a file.

I had to update my bedtools and code worked. Thanks alot

Log in to answer this question.