Question: Merge two bigwig(+/- strand) files from RNA-seq
2
gravatar for izzy.yichao.cai
3.7 years ago by
izzy.yichao.cai170 wrote:

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!

sequencing rna-seq next-gen • 3.2k views
ADD COMMENTlink modified 9 months ago by cmdcolin1.5k • written 3.7 years ago by izzy.yichao.cai170

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 REPLYlink written 3.7 years ago by Devon Ryan98k

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 REPLYlink modified 3.7 years ago • written 3.7 years ago by izzy.yichao.cai170
  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 REPLYlink modified 3.7 years ago • written 3.7 years ago by Devon Ryan98k

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 REPLYlink written 9 months ago by alex.v.nesta30
0
gravatar for Malcolm.Cook
3.7 years ago by
Malcolm.Cook1.2k
kansas, usa
Malcolm.Cook1.2k wrote:

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 COMMENTlink written 3.7 years ago by Malcolm.Cook1.2k
1

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

ADD REPLYlink written 3.7 years ago by izzy.yichao.cai170

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

ADD REPLYlink written 3.7 years ago by Devon Ryan98k
0
gravatar for cmdcolin
9 months ago by
cmdcolin1.5k
United States
cmdcolin1.5k wrote:

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 COMMENTlink modified 9 months ago • written 9 months ago by cmdcolin1.5k
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: 2257 users visited in the last hour
_