This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merge hundreds bedgraph files with unionbedg in one bash line

Hi All,

How to add header to merged matrix from hundreds of bedgraph files:

it should looks like the follow:

ls *bedgraph | xargs bedtools unionbedg -i *.bedgraph -filler NA -header

how to transfer the array from ls *bedgraph to -header?

Thanks.

bedgraph merge xargs bash

I don't know unionbedg, but why not just bedtools unionbedg -i *.bedgraph -filler NA -header ?

Hi Pierre, I want to transfer the contents of ls *bedgraph to -header, so that the matrix will have the header

that's precisely what -header option does. the above command bedtools unionbedg -i *.bedgraph -filler NA -header does exactly what you need.

0 answers

No answers yet.

Log in to answer this question.