How can I find to which regions and chromosomes in a bed file does a chromosome in another file map to?
1
0
Entering edit mode
6.4 years ago

I have two bed files, first one was the input.bed, second one is produced by mapping to the first one. Lets call it output.bed.

In my case I have one to many mapping , for instance a row input.bed maps to multiple regions in output.bed

How can I identify this(which rows) using r or perl?

Is bed tools helpful in this instance?

bed R perl bedtools • 1.5k views
ADD COMMENT
1
Entering edit mode

Take a look at bedtools intersect. Equivalent option in BEDOPS.

ADD REPLY
0
Entering edit mode
6.4 years ago

BEDOPS bedmap is an option, e.g.:

$ bedmap --echo --echo-map reference.bed map.bed > answer.bed

The file answer.bed will contain all elements from reference.bed on each line, with any elements from map.bed that overlap elements from reference.bed.

You can add options to change delimiters or overlap criteria, as well as apply signal or ID mapping operations, etc.

The BEDOPS documentation has more detail:

http://bedops.readthedocs.io/en/latest/content/reference/statistics/bedmap.html

Note: Someone has suggested using bedops --intersect. This answer is not correct, as --intersect calculates new genomic regions where there are overlaps in the genomic intervals in two or more sets, i.e. an intersection.

If you want to map or find associations between two sets, use bedmap to retrieve those associations (or use bedops --element-of, if you do not need to preserve per-element associations, but simply want to see what elements in one set overlap those in another set).

ADD COMMENT

Login before adding your answer.

Traffic: 1534 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