Merge two bigwig(+/- strand) files from RNA-seq
2
2
Entering edit mode
6.9 years ago

Hi all,

I am working on expression data from EpigeneticRoadmap and wanted to generate an expression track.(Link here)

Since the cell line expression data only has bigwig file in two separate files. One from positive strand; the other from negative strand and has negative values. UCSC BigWigMerge may not be useful since it would only add up the values of signal.

Anyone know how to merge these two bigwig files together? Thanks for the input!

RNA-Seq next-gen sequencing • 6.8k views
ADD COMMENT
1
Entering edit mode

Did you ever get this working? I'm about to write up a script to do this myself, but it would be great if you could save me some time.

ADD REPLY
0
Entering edit mode

If there's not a premade program then I can show you how to do it with a bit of python and the pyBigWig package.

ADD REPLY
0
Entering edit mode

Emmm. I am not that familiar with python. By a quick browse at the pyBigWig package, I need to first convert all the signal value in the negative strand to positive value, and then generate a new bigwig file with header and new value. Then I can use other tools like BigWigMerge from UCSC to merge my bigwig file?

How do I create a new bigwig file using that package?

ADD REPLY
0
Entering edit mode
  1. Open a new file (fp = pyBigWig.open("some_new_file.bw", "w"))
  2. Add a header (just use the .chroms() function on one of the bigWig files you want to merge).
  3. Get values at whatever resolution you want from your current files (base pair if you'd like) and average/sum/whatever them.
  4. Write them to the new file.
  5. Make sure to close the new file (fp.close()).
ADD REPLY
1
Entering edit mode
6.9 years ago
Malcolm.Cook ★ 1.5k

WiggleTools which provides "Basic operations on the space of numerical functions defined on the genome using lazy evaluators for flexibility and efficiency" should handle this swimmingly

ADD COMMENT
1
Entering edit mode

Looks promising, but the installation is a pain. I am still trying to get it installed.

ADD REPLY
1
Entering edit mode

If you're using conda (I highly recommend this), the conda install -c bioconda wiggletools.

ADD REPLY
0
Entering edit mode

could you share the snipped of code you use with wiggletools?

ADD REPLY
0
Entering edit mode
3.9 years ago
cmdcolin ★ 3.8k

I think the question is not really about merging the files, which is not really possible since bigwig only allows one signal per file

Therefore we really want to display multiple bigwigs on a single track. This can be done via jbrowse with the multibigwig plugin (https://github.com/elsiklab/multibigwig/). Other genome browsers may have something similar

ADD COMMENT

Login before adding your answer.

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