Skip to content

Problem displaying generated bigwig track in WashU genome browser #83

@ypauling

Description

@ypauling

Hi @jackh726 ,
Thanks for developing this tool! This is very helpful for the bioinformatics community!

I have been trying to write a simple tool that converts ATAC fragments file in bed format to bigwig files, with some normalization methods implemented. At the end of the program I used bigtools to write to the output. However I cannot load the track in WashU Genome Browser. This is pretty strange because I can load the file using pyBigWig, and I can also load the track in UCSC browser. I have also tried to convert the generated bigwig to bedGraph and then convert it back to bigwig using UCSC tool, and that works for the WashU Genome Browser. After some debugging I found that the BBIheader from bigtools is different from UCSC tools. In WashU Genome Browser it expects that the chromTreeOffset is smaller than unzoomedDataOffset, which are the third and fifth 32bit in the generated bigwig file. The zoom level is also different.

Since I am not quite familiar with the header section of a bigwig file, I am wondering if you have any idea about how to solve this problem. Specifically, is there a way to change the header when writing bigwig files?

Here is my script for the bigwig writing:
https://github.com/ypauling/rust_tools/blob/main/bed_to_bigwig/src/bigwig_writer.rs
There is nothing fancy here. I just created a iterator that yields (chrom, bigtools:Value) pair and pass that to BedParserStreamingIterator. Please ignore any design issues since I am using this as an opportunity to learn Rust.

Here are two files I generated to test:
https://epigenomics.sdsc.edu/biy022/scmethlyhic/A24_test.bw
https://epigenomics.sdsc.edu/biy022/scmethlyhic/A24_test2.bw
The second file is generated by converting first file to bedGraph and then convert it back to bigwig with UCSC tools.

Here are the info from bigWigInfo tools for the first and second bw file listed above

version: 4
isCompressed: yes
isSwapped: 0
primaryDataSize: 13,272,568
primaryIndexSize: 90,564
zoomLevels: 4
chromCount: 22
basesCovered: 2,875,001,522
mean: 14.213647
min: 0.000000
max: 20294.000000
std: 35.555634
version: 4
isCompressed: yes
isSwapped: 0
primaryDataSize: 11,485,555
primaryIndexSize: 86,492
zoomLevels: 8
chromCount: 22
basesCovered: 2,875,001,522
mean: 14.213647
min: 0.000000
max: 20294.000000
std: 35.555634

I would really appreciate any help!
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions