Question: bedGraph compress tools
0
gravatar for marina.v.yurieva
6 months ago by
Farmington, CT
marina.v.yurieva470 wrote:

I'm trying to compress my bedGraph file because of the USCS file size limit, and was trying to use bedtools merge to collapse it on the score column but it merges too much (if the features are less than 1bp apart, it merges them together, so in a peak region it merges the whole peak). Is there a tool that collapses every n-bp in a bed file and calculates the mean of the score (column 4)? From my bedGraph:

chr1    11585   11587   0.00465
chr1    11587   11592   0.0062
chr1    11592   11615   0.00775
chr1    11615   11631   0.0093
chr1    11631   11642   0.01085
chr1    11642   11656   0.0124
chr1    11656   11667   0.01395

If I want to collapse every 30 bps, my output would be:

chr1    11585   11615   0.00775
chr1    11615   11645   0.010075
chr1    11645   11667   0.013175

I know that I can convert bedGraph to bigWig but I'd like to keep bedGraph format and just decrease its resolution if it's possible.

bedgraph bedtools • 320 views
ADD COMMENTlink written 6 months ago by marina.v.yurieva470
1

I think you have two options:

  1. Use e.g. deeptools bamCoverage with the -bs parameter that allows to set a bin size that the reads are aggregated over for your bedGraph, or
  2. Simply compress the bedGraph you have with gzip to reduce its size
ADD REPLYlink written 6 months ago by ATpoint13k

I tried bamCoverage. It worked really well, only had to play with the bin sizes a few times. Thank you!

ADD REPLYlink written 6 months ago by marina.v.yurieva470

Why would you like to keep it in bedGraph format? That's a really annoying format to deal with if all you want is to visualize data.

ADD REPLYlink written 6 months ago by Devon Ryan88k

I don't really have a free host website to share the files on, so it's much easier to upload it to GB...

ADD REPLYlink written 6 months ago by marina.v.yurieva470

Do you rely on UCSC? THere are alternatives like the IGV, that can read bigwigs from disk.

ADD REPLYlink written 6 months ago by ATpoint13k

Right, but I need to upload the data and share it with my boss, UCSC is the easiest way to do that. If it was for just myself, wouldn't been a problem...

ADD REPLYlink written 6 months ago by marina.v.yurieva470

Do you need bins of equal size for some subsequent analysis, or only for compressing your file?

ADD REPLYlink written 6 months ago by AngieHinrichs0

No, I need just bins for the compression

ADD REPLYlink written 6 months ago by marina.v.yurieva470
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: 613 users visited in the last hour