Bedtools Merge .bed file with unique ID column
1
0
Entering edit mode
5.4 years ago
reece • 0

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.8k views
ADD COMMENT
0
Entering edit mode
5.4 years ago
reece • 0

Figured it out this seems to have worked:

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

Login before adding your answer.

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