Report name of overlapping features using `bedtools intersect`

27 views
Skip to first unread message

Gloria Sheynkman

unread,
Nov 25, 2020, 9:44:07 AM11/25/20
to bedtools-discuss

I am using bedtools intersect to compare the gene ranges of two databases.
Is there a way to report not only that there exists overlap between a feature, but the name of the features?

In the example, below:
$cat A.bed
chr1 10 20 Gene A
chr1 30 40 Gene B

$cat B.bed
chr1 15 20 Gene A'

Could the output be:
chr1 10 20 Gene A chr1 15 20 Gene A'

Thanks,

Gloria


Aaron Quinlan

unread,
Nov 25, 2020, 9:45:06 AM11/25/20
to bedtools...@googlegroups.com
Hi Gloria,

Certainly. Use the -wa and -wb options together.

Aaron

--
You received this message because you are subscribed to the Google Groups "bedtools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bedtools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bedtools-discuss/15fe1240-911d-451e-83cd-fc66f979de32n%40googlegroups.com.

Gloria Sheynkman

unread,
Nov 25, 2020, 9:57:07 AM11/25/20
to bedtools-discuss
Thank you for the answer - bedtools is a dream.
Reply all
Reply to author
Forward
0 new messages