Intersect and limit distally
1
0
Entering edit mode
7.8 years ago
rbronste ▴ 420

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.

ChIP-Seq sequencing • 900 views
ADD COMMENT
1
Entering edit mode
7.8 years ago

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
ADD COMMENT

Login before adding your answer.

Traffic: 1312 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6