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

Hey, I have been trying to solve this but I can't and I am desperate at this point. I have a bed file with enhancer regions that I want. They look like this:

chr6    3592685 3593043 chr6:3592685-3593043    0   .
chr10   3900999 3901229 chr10:3900999-3901229   0   .
chr11   4413870 4414271 chr11:4413870-4414271   0   .

I also have another bed file with ChIP-seq peaks where I have transcription factors. This looks like this:

chr1    184549136   184549586   SETDB1  434 .   184549136   184549586   0   1   450,    0,
chr1    226492413   226492769   CTCF    81  .   226492413   226492769   0   1   356,    0,

I want to overlap the enhancers with these ChIP results. How do I know the 10 transcription factors whose ChIP-sites overlap the most with my enhancers?

Thank you! Please someone.

chip-seq bed

I have been trying to solve

what did you try ? (... and your answer will contain bedtools intersect)

That is what I am doing but it does not seem to be working. I am doing:

bedtools intersect -a enhancer_muscle2.bed -b chip_tfbs.bed > overlap.bed

and I get something like this:

chr6    3592685 3592879 chr6:3592685-3593043    0   .
chr6    3592685 3592995 chr6:3592685-3593043    0   .

but I want to know the transcription factor that is overlapping which it is in column 4 of the chip bed file

I am trying this: bedtools intersect -a enhancer_liver2.bed -b chip_tfbs.bed -wb because the transcription factor is in my second bed file. I get this:

chr16   193028  193281  chr16:193028-193281 0   .   chr16   192893  193448  GATA-1  1000    .   192893  193448  0   1   555,    0,
chr16   193028  193281  chr16:193028-193281 0   .   chr16   192991  193514  Pol510  .   192991  193514  0   1   523,    0,

but how can I be sure these are actually overlapping? Please I don't understand what to do

but how can I be sure these are actually overlapping

uh ?

1 answer

A simpler option is to use BEDOPS bedmap:

bedmap --echo --echo-map-id-uniq --delim '\t' <(cut -f1-3 enhancers.bed) ChIPseqs.bed > answer.bed

The fourth column of answer.bed will contain a listing of peak IDs (TF names) that overlap each enhancer.

Files enhancers.bed and ChIPseqs.bed should be sorted with sort-bed before using them with bedmap, e.g.:

sort-bed enhancers_unsorted.bed > enhancers.bed

The enhancers in your example are not sorted properly. The sort-bed tool is also part of BEDOPS.

Ref. https://github.com/bedops/bedops

Log in to answer this question.