Merge hundreds bedgraph files with unionbedg in one bash line
0
0
Entering edit mode
7.4 years ago
Shicheng Guo ★ 9.4k

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 • 2.8k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

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