I have multiple (n) bed files with identical intervals and one unique information column. I would like to combine these into one bed file with n information columns.
file1.bed:
chr start stop col.foo
chr1 1 10 foo
chr1 20 30 foo
file2.bed:
chr start stop col.bar
chr1 1 10 bar
chr1 20 30 bar
desired_output.bed:
chr start stop col.foo col.bar
chr1 1 10 foo bar
chr1 20 30 foo bar
I tried using bedtools merge, but don't see an obvious solution. This only keeps the information column of one of the files:
bedtools merge -c 4 -o collapse -delim = "\t" -i file1.bed -i file2.bed