Question: Excluding intervals with repeats
0
gravatar for rbronste
10 months ago by
rbronste230
rbronste230 wrote:

Is there a quick and easy method for excluding intervals from a bed file that contain any kind of repetitive elements? Thanks.

masking repeats bed • 268 views
ADD COMMENTlink written 10 months ago by rbronste230
1
gravatar for ATpoint
10 months ago by
ATpoint12k
Germany
ATpoint12k wrote:

Given that you have a file with the repeats in BED format, you may use BEDtools intersect with the -v option:

bedtools intersect -v -a your.bed -b repeat.bed > your_without_repeats.bed
ADD COMMENTlink written 10 months ago by ATpoint12k

Yes I was thinking of doing it this way, one weird thing though is if I do:

bedtools intersect -v -a your.bed -b repeat.bed > your_without_repeats.bed

Lets say I get 300 out of an original 1000 for:

your_without_repeats.bed

However when I do the following to get a file of those intervals that overlap with repeats:

bedtools intersect -a your.bed -b repeat.bed > your_with_repeats.bed

I don't get exactly 700, but another number?

ADD REPLYlink written 10 months ago by rbronste230

The reason for this is that the second command outputs parts of an -a that partly overlap b. In that case the non-overlapping part of the interval is outputted. If you use -wa option, you should get 700.

ADD REPLYlink written 10 months ago by ATpoint12k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1608 users visited in the last hour