This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BED Heatmap

I have BED files of ChIP-seq peaks with different conditions, and I would like to make a heatmap showing the similarity/overlap between the peaks.

I have designed a program to take in bedtools intersect overlaps by using a double for loop. The program builds a CSV and heatmap based on the information provided in this double for loop below. I was wondering if a bedtools intersect double for loop would be the best way to find the similarity/overlap between peaks?

for i in *bed; do for j in *bed; do echo $i $j;bedtools intersect -u -a $i -b $j | wc -l; done; done

The reason I'm asking this is because

bedtools intersect -u -a test1 -b test2 | wc -l

can give a different result from

bedtools intersect -u -a test2 -b test1 | wc -l

causing the heatmap to be unsymmetrical.

chip-seq

This works! Thank you. However, I'm running into another problem.

bedtools intersect -a test1.bed -b test2.bed -wa -wb | wc -l

In this output, I have more entries that are not even present in the test1.bed.

0 answers

No answers yet.

Log in to answer this question.