deepTools icon indicating copy to clipboard operation
deepTools copied to clipboard

plotting error with computeGCBias function

Open AlcaArctica opened this issue 5 years ago • 4 comments

Hi, I have a problem with the computeGCBias function. I installed deeptools with conda create -n deeptools_env -c bioconda deeptools and I successfully ran computeGCBias for a number of datasets. However, I consistently get an error message when running the function on other data sets.

deeptools --version deeptools 3.4.1

python --version Python 3.7.6

command that produces the error

conda activate deeptools
computeGCBias -p 16 -b sample_runB.bam --effectiveGenomeSize 5052870 -o sample_runB.txt -g sample_pacbio.2bit  --biasPlot sample_runB.png

output

biasPlot sample_runB.png
2bit: sample_pacbio.2bit
bam: sample_runB.bam
filter_out: None
extra_sampling_file: None
genome_size: 5052870
total_reads: 2313404
reads_per_bp: 0.4578396040270183
max_reads: 638.0
min_reads: 6.0
computing frequencies
stepSize: 1
Traceback (most recent call last):
  File "/home/.conda/envs/deeptools/bin/computeGCBias", line 12, in <module>
    main(args)
  File "/home/.conda/envs/deeptools/lib/python3.7/site-packages/deeptools/computeGCBias.py", line 726, in main
    plotGCbias(args.biasPlot, data, reads_per_gc, args.regionSize, image_format=args.plotFileFormat)
  File "/home/.conda/envs/deeptools/lib/python3.7/site-packages/deeptools/computeGCBias.py", line 608, in plotGCbias
    ax1.set_ylim(0 - (y_max * 0.05), y_max * 1.05)
  File "/home/.local/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 3457, in set_ylim
    bottom = self._validate_converted_limits(bottom, self.convert_yunits)
  File "/home/.local/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 3068, in _validate_converted_limits
    raise ValueError("Axis limits cannot be NaN or Inf")
ValueError: Axis limits cannot be NaN or Inf

command that produces no error

conda activate deeptools
computeGCBias -p 16 -b sample_runA.bam --effectiveGenomeSize 5052870 -o sample_runA.txt -g sample_pacbio.2bit  --biasPlot sample_runA.png

output

biasPlot sample_runA.png
2bit: sample_pacbio.2bit
bam: sample_runA.bam 
filter_out: None
extra_sampling_file: None
genome_size: 5052870
total_reads: 1790635
reads_per_bp: 0.3543797881204147
max_reads: 479.0
min_reads: 2.0
computing frequencies
stepSize: 1

Interpretation Interestingly, the same command works just fine for a very similar dataset sample_runA.bam (a bam file for the same isolate sequenced in an independent sequencing run). As far as I can tell there is nothing wrong with the sample_runB.bam file in question, and the computeGCBias command even calculates the frequency file (-o sample_runB.txt) alright, which looks just like the one for the parallel dataset (-o sample_runA.txt). Instead the problem seems to be with the plotting. Any ideas as to how I could coax deeptools into also outputting the sample_runB.png file? Thank you

AlcaArctica avatar Apr 03 '20 08:04 AlcaArctica

computeGCBias is deprecated and rarely needed anymore, are you sure you actually even need to run it?

dpryan79 avatar Apr 04 '20 07:04 dpryan79

I did not know that the computeGCBias function has been deprecated. Can you point me to an alternative?

AlcaArctica avatar Apr 04 '20 09:04 AlcaArctica

Since there has been little need for such a tool in the past ~7 years I'm not aware of a good alternative. Why do you think you need this? Library prep has improved enough that this is usually only used on very old datasets.

dpryan79 avatar Apr 04 '20 10:04 dpryan79

Just to follow up (and on the off chance anyone is ever faced with a similar problem), our group has developed a little python script to calculate the GC bias, which can be found on GitLab.

AlcaArctica avatar Jul 06 '20 15:07 AlcaArctica