How To Pile Up Multiple Bed Files Into 1 File
3
0
Entering edit mode
12.6 years ago
Hanfei Sun ▴ 60

I want to pileup a set of BED files (all from H3K4me3) to see some generic site of this Histone Modification.

However, I haven't found a suitable tool to do that..

I'm using a awkward way to do that, like this:

  1. cat all BED files into 1 BED file
  2. use bedtools to convert the BED file to BAM file
  3. use samtools' mpileup command to pileup the BAM file

At last, the result is a large BAM file and very time-consuming.

Does anybody know a easier way to do that?

bed pileup sam bam intersect • 4.8k views
ADD COMMENT
1
Entering edit mode
12.6 years ago

You could use pipes to help with streamlining the steps, if you're not already. You could try bedtools genomeCoverageBed to do the pileup instead of samtools.

ADD COMMENT
0
Entering edit mode
12.6 years ago
Mary 11k

Do you want to do a display like they have for the histone modifications on the UCSC browser now? Those are called "multi wig". See if this info helps: http://biowhat.ucsd.edu/homer/ngs/ucsc.html

ADD COMMENT
0
Entering edit mode

No, it's not multiple wiggle file. It's multiple BED file. I just want to find some peaks appears in most of the H3K4me3 samples

ADD REPLY
0
Entering edit mode
12.5 years ago

The BEDOPS tool called bedops will merge your BED data for you:

$ bedops --everything *.bed > merged.bed

You could convert data faster by piping output to bed2bam, which supports standard input:

$ bedops --everything *.bed | bed2bam -a stdin -g chrlist.txt > merged.bam
ADD COMMENT

Login before adding your answer.

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