This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bedmap to output one instance of gene

Why does bedmap output the data like below (with multiple of the same gene)? Is it listing the gene represented at that base, can it only be listed once? Thank you :).

bedmap --echo --echo-map-id --delim '\t' sort_intersect_epilepsy70.bed sort_unix_epilepsy70.bed > Answer.bed

Answer.bed

chr1 40539722 40539865 PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1 chr1 40542503 40542595 PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1 chr1 40544221 40544340 PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1 chr1 40546058 40546169 PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1;PPT1

Desired Answer.bed

chr1 40539722 40539865 PPT1
chr1 40542503 40542595 PPT1
chr1 40544221 40544340 PPT1
bedops

1 answer

Use --echo-map-id-uniq instead of --echo-map-id to get a list of unique IDs.

Log in to answer this question.