Question: Get percentile cutoff from bigwig files
gravatar for Bade
4.1 years ago by
United States
Bade40 wrote:

Hi Members,

I have bigwig files with genome-wide signal values. And I need to compute the Xth percentile of these signal values. Is there any tool that can compute signal percentiles directly from bigwig files? For Ex - I want to know the 95th percentile of all signal values in a bigwig file.

If not, what would be the best way to compute them? I do not have much experience with bigwig files or tools to analyze them, but I can program or parse files if required.



ADD COMMENTlink modified 4.1 years ago by Alex Reynolds29k • written 4.1 years ago by Bade40
gravatar for Alex Reynolds
4.1 years ago by
Alex Reynolds29k
Seattle, WA USA
Alex Reynolds29k wrote:

Say you are working with hg19. You can:

  1. Use UCSC Kent tools bigWigToWig to convert bigWig to wig
  2. Use BEDOPS wig2bed to convert wig to BED
  3. Use BEDOPS bedmap to map hg19 chromosome extents to signal on a per-chromosome basis, using the --kth option to generate the desired percentile cutoff:

For example:

$ bigWigToWig signal.wig
$ wig2bed < signal.wig > signal.bed
$ bedmap --echo --kth 0.95 hg19.extents.bed signal.bed > answer.bed

It is the same principle for other genomes or builds: Replace hg19.extents.bed with a BEDOPS sort-bed-sorted BED file containing chromosome extents for other genomes or builds.

ADD COMMENTlink modified 4.1 years ago • written 4.1 years ago by Alex Reynolds29k

Sorry to bring this post back from the dead. But I've found myself with the same situation as the OP, with needing, say, the 99th percentile value for a bigWig across the whole genome. However, I realized that using BEDOPS in this manner results in the kth percentile value per-chromosome. Is there a way to get the kth percentile value across the whole genome instead?

I've read the BEDOPS bedmap documentation forwards and backwards and I don't see any obvious way to do it, since it doesn't seem like 'whole genome' can be an entry in the reference file. Other tools such as wiggletools histogram don't provide an exact percentile value like BEDOPS does.

If you have any advice, I would really appreciate it! Thanks for your time.

ADD REPLYlink written 4 months ago by rachel30

A: Whole-genome percentile values in bigWig files

ADD REPLYlink written 4 months ago by Alex Reynolds29k
Please log in to add an answer.


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