Get percentile cutoff from bigwig files
1
0
Entering edit mode
8.7 years ago
Bade ▴ 40

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.

Thanks

Bade

RNA-Seq bigwig wiggle statistics bed • 2.4k views
ADD COMMENT
3
Entering edit mode
8.7 years ago

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.bw 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 COMMENT
0
Entering edit mode

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 REPLY

Login before adding your answer.

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