Hello,
I'm trying to correct the GC bias with deepTools. I successfully used computeGCBias
computeGCBias -b file.bam --effectiveGenomeSize 2150570000 -g mm9.2bit -l 200 --GCbiasFrequenciesFile freq.txt -v
But the next step, correctGCBias, return an error I don't understand.
correctGCBias -b file.bam --effectiveGenomeSize 2150570000 -g mm9.2bit --GCbiasFrequenciesFile freq.txt -o gc_file.bam -v
applying correction
genome partition size for multiprocessing: 56882182
using region None
({'chrY': 'chrY', 'chrX': 'chrX', 'chr13': 'chr13', 'chr12': 'chr12', 'chr11': 'chr11', 'chr10': 'chr10', 'chr17': 'chr17', 'chr16': 'chr16', 'chr15': 'chr15', 'chr14': 'chr14', 'chr19': 'chr19', 'chr18': 'chr18', 'chrM': 'chrM', 'chr7': 'chr7', 'chr6': 'chr6', 'chr5': 'chr5', 'chr4': 'chr4', 'chr3': 'chr3', 'chr2': 'chr2', 'chr1': 'chr1', 'chr9': 'chr9', 'chr8': 'chr8'}, {'chrY': 'chrY', 'chrX': 'chrX', 'chr13': 'chr13', 'chr12': 'chr12', 'chr11': 'chr11', 'chr10': 'chr10', 'chr17': 'chr17', 'chr16': 'chr16', 'chr15': 'chr15', 'chr14': 'chr14', 'chr19': 'chr19', 'chr18': 'chr18', 'chrM': 'chrM', 'chr7': 'chr7', 'chr6': 'chr6', 'chr5': 'chr5', 'chr4': 'chr4', 'chr3': 'chr3', 'chr2': 'chr2', 'chr1': 'chr1', 'chr9': 'chr9', 'chr8': 'chr8'})
using 4 processors for 59 number of tasks
Sam for chr10 0 56882182
Sam for chr11 56882182 113764364
Sam for chr12 113764364 121257530
Sam for chr14 0 56882182
Sam for chr15 56882182 103494974
Traceback (most recent call last):
File "/usr/local/bin/correctGCBias", line 11, in <module>
main(args)
File "/usr/local/lib/python2.7/dist-packages/deeptools/correctGCBias.py", line 628, in main
writeCorrectedSam_wrapper, mp_args).get(9999999)
File "/usr/lib/python2.7/multiprocessing/pool.py", line 567, in get
raise self._value
ValueError: invalid value type 'B' (<type 'str'="">)
Could anyone help me?
1 answer
Log in to answer this question.
My guess is that this is an issue with the version of pysam that you're using. Can you post the following:
pip freeze | grep pysammay tell you this).I know it's a pain, but it might also help to run this single threaded. The error messages are more informative then.
I think that's all newest version:
deeptools 2.4.2-4-999ec5d
pysam==0.10.0
OK, please run this with one thread then and post the resulting error message. To properly fix this I might need a copy of the relevant portion of the BAM file (at least the region with the first alignment that's causing this behavior).
I'm not sure I understand, my first post was one thread and the resulting error message. For the relevant part of the bam, I don't know what that it, sorry.
You were using 4 threads, even though you didn't specify it (it wasn't my idea, but deepTools will use 1/2 of the cores on a server unless you tell it explicitly how many it should use). Just rerun it with
-p 1.It seems the same:
OK, it's in the
set_tags()function, which is the part I needed to know. Can you extractchr10:1-23672257into a BAM file and post that and yourfreq.txtfile somewhere? Then I can figure out a patch.BAM file: https://e-nautia.com/share/45076-x8zr2q6p
Freqence file: https://e-nautia.com/share/45077-yzmr244h
Thanks, this turns out to be a bug in pysam. I'm trying to find out now if an earlier version handled this correctly. Whatever aligner you're using producing auxiliary tags that pysam is having problems with.