This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bedtools Merge .bed file with unique ID column

Hello,

I have added a unique ID column (as shown below) to my .bed file so I can identify merged elements after merging has occurred.

chr4    132181662   132181672   HG00365_1k
chr4    132181662   132181672   HG00368_1k
chr4    132181662   132181672   HG00369_1k
chr4    132181662   132181672   HG00371_1k

After merging I receive:

chrX    68861391        68861401        2
chrX    70102169        70102179        2
chrX    71312620        71312630        125
chrX    72343223        72343233        16 

Is there a specific code that allows me to see which IDs have been merged?

Thank you in advance.

bed bedtools

1 answer

Figured it out this seems to have worked:

bedtools merge -i test.bed -d 500 -c 4 -o collapse

Log in to answer this question.