Question: bedops command to map bed to genes
0
gravatar for cmccabe
3.3 years ago by
cmccabe170
Chicago
cmccabe170 wrote:

I am trying to understand how the bedops command:

bedmap --echo --echo-map-id-uniq epilepsy70_medex_edit.bed gene_exon.bed > answer.bed

maps regions in a bed to genes.

For example, if the input.bed - epilepsy70_medex_edit - (has three coordinates in it)

 
chr19    50365271    50365391 |
chr19    50365430    50365550 |NAPSA
chr19    50365614    50365734 |NAPSA

how does the two coordinates map to NAPSA and the other to nothing?  Thank you :)

gene_exon.bed

chr19    50358476    50358780    NAPSA     9
chr19    50358477    50358780    NAPSA     2
chr19    50358477    50359862    NAPSA     2
chr19    50358552    50358555    NAPSA     9
chr19    50358555    50358780    NAPSA     9
chr19    50359010    50359109    NAPSA     8
chr19    50359010    50359109    NAPSA     8
chr19    50359010    50359221    NAPSA     1
chr19    50359502    50359647    NAPSA     7
chr19    50359502    50359647    NAPSA     7
chr19    50359605    50359647    NAPSA     7
chr19    50359605    50359647    NAPSA     7
chr19    50359739    50359862    NAPSA     6
chr19    50359739    50359862    NAPSA     6
chr19    50359739    50359862    NAPSA     6
chr19    50359739    50359862    NAPSA     6
chr19    50359748    50359862    NAPSA     5
chr19    50360940    50361140    NAPSA     5
chr19    50360940    50361140    NAPSA     5
chr19    50360940    50361140    NAPSA     5
chr19    50360940    50361140    NAPSA     5
chr19    50360940    50361140    NAPSA     4
chr19    50360940    50362843    NAPSA     1
chr19    50360944    50361140    NAPSA     3
chr19    50361662    50361754    NAPSA     4
chr19    50361662    50361754    NAPSA     4
chr19    50361662    50361781    NAPSA     4
chr19    50361662    50361781    NAPSA     4
chr19    50361662    50361781    NAPSA     3
chr19    50361662    50362313    NAPSA     2
chr19    50361691    50361694    NAPSA     3
chr19    50361694    50361781    NAPSA     3
chr19    50361908    50362313    NAPSA     2
chr19    50361968    50362092    NAPSA     3
chr19    50361968    50362092    NAPSA     3
chr19    50361968    50362092    NAPSA     3
chr19    50361968    50362092    NAPSA     3
chr19    50362171    50362313    NAPSA     2
chr19    50362171    50362313    NAPSA     2
chr19    50362171    50362313    NAPSA     2
chr19    50362171    50362313    NAPSA     2
chr19    50362171    50362313    NAPSA     2
chr19    50362171    50362313    NAPSA     2
chr19    50362623    50362782    NAPSA     1
chr19    50365538    50365621    NAPSA     1
chr19    50365538    50365621    NAPSA     1
chr19    50365538    50365621    NAPSA     1
chr19    50365538    50365625    NAPSA     1
chr19    50365538    50365787    NAPSA     1
chr19    50365538    50365830    NAPSA     1
chr19    50365538    50365830    NAPSA     1
chr19    50365618    50365621    NAPSA     1
chr19    50365618    50365621    NAPSA     1
chr19    50365618    50365621    NAPSA     1
bedops • 744 views
ADD COMMENTlink modified 3.3 years ago by Alex Reynolds26k • written 3.3 years ago by cmccabe170
1
gravatar for Alex Reynolds
3.3 years ago by
Alex Reynolds26k
Seattle, WA USA
Alex Reynolds26k wrote:

Mapping only happens where there are overlaps. You only get results when there are mapped elements. If there are no mapped elements, you do not get any IDs or other values.

You can run some ad-hoc tests with bedops --element-of to verify where there are overlaps:

$ echo -e "chr19\t50365430\t50365550" | bedops --element-of 1 gene_exon.bed -
chr19    50365538    50365621    NAPSA    1
chr19    50365538    50365621    NAPSA    1
chr19    50365538    50365621    NAPSA    1
chr19    50365538    50365625    NAPSA    1
chr19    50365538    50365787    NAPSA    1
chr19    50365538    50365830    NAPSA    1
chr19    50365538    50365830    NAPSA    1
$

And, likewise, where there are no overlaps:

$ echo -e "chr19\t50365271\t50365391" | bedops --element-of 1 gene_exon.bed -
$

You can add the --skip-unmapped option to bedmap if you want to leave out reference elements (like that one) that have no mapped elements that associate with them.

ADD COMMENTlink modified 3.3 years ago • written 3.3 years ago by Alex Reynolds26k

Thank you :)

ADD REPLYlink written 3.3 years ago by cmccabe170
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: 708 users visited in the last hour