Question: Merge multiple BED files (multiple intersect) with average score
0
gravatar for neuro3030
5 months ago by
neuro30300
neuro30300 wrote:

Hi,

I have about 57 BED files with various overlapping intervals between them. I would like to merge them all, like with multiple intersect from BEDTools, but average the score associated with the overlap across the files. I see there is a function in MergeBED to add an additional column to average the score from overlapping intervals, but I don't see this for 'multiple intersect' for multiple files.

The caveat is my limited programming knowledge, so I use the Galaxy server. Is there a way to do this?

Thanks

bed • 416 views
ADD COMMENTlink modified 5 months ago • written 5 months ago by neuro30300

Thanks for this. However, I am unfamiliar with these programs and how to use them. I see they are not listed on the Galaxy server, is there an online version of these tools to upload the files for processing? Thanks

ADD REPLYlink written 5 months ago by neuro30300

Please use ADD COMMENT or ADD REPLY to answer to previous reactions, as such this thread remains logically structured and easy to follow. I have now moved your reaction but as you can see it's not optimal. Adding an answer should only be used for providing a solution to the question asked.

ADD REPLYlink written 5 months ago by WouterDeCoster35k
0
gravatar for Alex Reynolds
5 months ago by
Alex Reynolds26k
Seattle, WA USA
Alex Reynolds26k wrote:

To do this efficiently, you can use bedops and bedmap to calculate this over N files (N=57, in your case).

$ bedops -u A.bed B.bed ... N.bed > union.bed
$ bedops -m A.bed B.bed ... N.bed > merge.bed
$ bedmap --echo --mean --delim "\t" merge.bed union.bed > answer.bed

The file answer.bed will contain merged intervals and the arithmetic mean of signals in overlapping intervals from files A.bed through N.bed (these are your 57 BED5 files, where the fifth column contains signal, per UCSC convention).

More documentation at: http://bedops.readthedocs.io/en/latest/

Galaxy is great, but there's no real substitute for the Unix command line. Learn it if you're doing informatics.

ADD COMMENTlink modified 5 months ago • written 5 months ago by Alex Reynolds26k

Thanks for this. However, I am unfamiliar with these programs and how to use them. I see they are not listed on the Galaxy server, is there an online version of these tools to upload the files for processing? Thanks

ADD REPLYlink written 5 months ago by neuro30300
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: 1738 users visited in the last hour