Hi,
Kind of a basic question but is there a quick easy way to limit an intersected BED file to TSS distal sites, just to single out putative enhancer elements?
Thanks.
Hi,
Kind of a basic question but is there a quick easy way to limit an intersected BED file to TSS distal sites, just to single out putative enhancer elements?
Thanks.
What files/data do you have? Generally, it could be as simple as:
$ bedops --element-of 100% intervals.bed distal_sites.bed > answer.bed
The file answer.bed
would contain intervals from intervals.bed
that are contained entirely within distal regions defined in distal_sites.bed
.
If you need to create a file containing distal sites (say, regions defined as between 5k and 10k away from TSS), and you are starting with stranded TSS elements in files TSS_forward.bed
and TSS_reverse.bed
:
$ bedops --range -5000:0 --everything TSS_forward.bed > TSS_forward.5k.bed
$ bedops --range -10000:0 --everything TSS_forward.bed > TSS_forward.10k.bed
$ bedops --difference TSS_forward.10k.bed TSS_forward.5k.bed > distal_upstream_of_forward_stranded_TSS.bed
Then for TSS of genes on the reverse strand:
$ bedops --range 0:5000 --everything TSS_reverse.bed > TSS_reverse.5k.bed
$ bedops --range 0:10000 --everything TSS_reverse.bed > TSS_reverse.10k.bed
$ bedops --difference TSS_reverse.10k.bed TSS_reverse.5k.bed > distal_upstream_of_reverse_stranded_TSS.bed
Then, finally:
$ bedops --everything distal_upstream_of_{forward,reverse}_stranded_TSS.bed > distal_sites.bed
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.