Question: Merge hundreds bedgraph files with unionbedg in one bash line
0
gravatar for Shicheng Guo
2.8 years ago by
Shicheng Guo7.7k
Shicheng Guo7.7k wrote:

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.

bash xargs merge bedgraph • 1.1k views
ADD COMMENTlink modified 2.8 years ago • written 2.8 years ago by Shicheng Guo7.7k

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

ADD REPLYlink written 2.8 years ago by Pierre Lindenbaum122k

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

ADD REPLYlink written 2.8 years ago by Shicheng Guo7.7k

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

ADD REPLYlink written 7 months ago by Jorge Amigo11k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1395 users visited in the last hour