Question: error while reading bigwig files in computeMatrix (deeptools)
1
gravatar for Lila M
10 months ago by
Lila M 800
UK
Lila M 800 wrote:

Hi everybody, I'm trying to run this pipeline with bigwif files

computeMatrix reference-point --referencePoint TSS --beforeRegionStartLength 30 --afterRegionStartLength 300 -R transcribed_genes_sort.txt -S BJ_rep1_neg_strand.bw BJ_rep1_pos_strand.bw BJ_rep2_neg_strand.bw BJ_rep2_pos_strand.bw -bl DACblacklist.bed.gz --skipZeros -p 1 -o matrix_TSS.gz

and I get this error

[bwHdrRead] There was an error while reading in the header!
Traceback (most recent call last):
  File "/home/projas/.local/bin/computeMatrix", line 11, in <module>
    main(args)
  File "/home/projas/.local/lib/python3.5/site-packages/deeptools/computeMatrix.py", line 414, in main
    hm.computeMatrix(scores_file_list, args.regionsFileName, parameters, blackListFileName=args.blackListFileName, verbose=args.verbose, allArgs=args)
  File "/home/projas/.local/lib/python3.5/site-packages/deeptools/heatmapper.py", line 235, in computeMatrix
    chromSizes, _ = getScorePerBigWigBin.getChromSizes(score_file_list)
  File "/home/projas/.local/lib/python3.5/site-packages/deeptools/getScorePerBigWigBin.py", line 161, in getChromSizes
    fh = pyBigWig.open(fname)
RuntimeError: Received an error during file opening!

However, the header of the bigwig files is something like:

chr1    13264   13314   1.8
chr1    13444   13454   3
chr1    13454   13464   4.6
chr1    13464   13474   8.6

Any ideas? Thanks!

ADD COMMENTlink modified 10 months ago by Devon Ryan93k • written 10 months ago by Lila M 800
1

Tagging: Devon Ryan

ADD REPLYlink written 10 months ago by genomax75k
1

It looks like the bigWig file itself simply got corrupted. Can you recreate or redownload it?

ADD REPLYlink written 10 months ago by Devon Ryan93k

I did but still have the same error :/

ADD REPLYlink written 10 months ago by Lila M 800
1

This "header" that you showed, how did you obtain this? Is your file truely in bigwig format or is it a bedGraph with a wrong suffix. As always for these kind of questions, please share to full commands for bigwig creation.

ADD REPLYlink written 10 months ago by ATpoint26k
1

what I did was: 1)wig to bigwig:

    wigToBigWig GSM2936611_BJ.c.a_merged_coverage_strand-_scaled_bin10_EXT0.copy2_lane2_rep1.wig.gz -clip  http://hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/hg19.chrom.sizes BJ_lane1_rep1.bw

    wigToBigWig GSM2936611_BJ.c.a_merged_coverage_strand-_scaled_bin10_EXT0.copy2_lane2_rep1.wig.gz -clip  http://hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/hg19.chrom.sizes BJ_lane2_rep1.bw

1)merge lane1 and lane2:

 bigWigMerge  BJ_lane1_rep1.bw BJ_lane2_rep1.bw BJ_rep1_neg_strand.bw
ADD REPLYlink modified 10 months ago • written 10 months ago by Lila M 800
1

Can you post the bigWigs somewhere? I can take a look then.

ADD REPLYlink written 10 months ago by Devon Ryan93k

Is there any way to send you the files?

ADD REPLYlink written 10 months ago by Lila M 800
1
gravatar for Devon Ryan
10 months ago by
Devon Ryan93k
Freiburg, Germany
Devon Ryan93k wrote:

For those wondering, the cause of the problem was that the input files were actually bedGraph (text files) rather than bigWigs (binary format). Presumably there was something wrong with the conversion command with UCSC tools.

ADD COMMENTlink written 10 months ago by Devon Ryan93k

So is there other way to transform the files?

ADD REPLYlink written 10 months ago by Lila M 800
1

What is the file you started with? In your initial question, what you show is bedGraph, so chr-start-end-score. In the comment above, you mention WigToBigWig. If you have a bedGraph, use bedGraphToBigWig, else when having Wig, use WigToBigWig. Please clarify what format you have. All these tools are widely used and tested, so the error is your input format.

ADD REPLYlink written 10 months ago by ATpoint26k
1

The file that I started with is a wig file like this:

GSM2936611_BJ.c.a_merged_coverage_strand-_scaled_bin10_EXT0.copy2_lane2_rep1.wig.gz

track type=wiggle_0 name=BJ.c.a.- description=BJ.c.a.- maxHeightPixels=50:30:11 color=150,50,110 alwaysZero=on
        variableStep chrom=chr1 span=10
        13265   0.9
        13275   0.9
        13285   0.9

Then I used this command line

   `wigToBigWig GSM2936611_BJ.c.a_merged_coverage_strand-_scaled_bin10_EXT0.copy2_lane2_rep1.wig.gz -clip  http://hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/hg19.chrom.sizes BJ_lane2_rep1.bw

and I get as an output a bedgraph. So I dond't understand whats going on. PS. I downloaded the original files from here

ADD REPLYlink modified 10 months ago • written 10 months ago by Lila M 800
1

I get a binary file out of this command, indicating bigwig. I do not know what is wrong in your case.

ADD REPLYlink written 10 months ago by ATpoint26k
3

I find the silly problem, I forgot to transform the bedGraph after merging using bedGraphToBigWig

ADD REPLYlink written 10 months ago by Lila M 800
2

Good to hear :) For the future, in my experience when using standard tools, it is in like 99.9% always a user problem when things crash (happened to me many times before) so it is best to always script every step you do instead of just running things on the command line without documenting it. Doing so, you can reproduce all steps at any time.

ADD REPLYlink modified 10 months ago • written 10 months ago by ATpoint26k
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: 785 users visited in the last hour