zyndagj / BSMAPz

Updated and optimized fork of BSMAP
Other
18 stars 6 forks source link

methratio.py OverflowError #22

Closed rmvpaeme closed 4 years ago

rmvpaeme commented 4 years ago

I get this error when running methratio.py, samples was mapped to GRCh37. It seems that the error usually occurs when chr2 is being read.

methratio.py -d GRCh37.fa -o output.txt -x CG -N 18 sample.bam

Things I've tried:

[methratio] @Thu May 14 14:22:53 2020   Using 90% of available memory (38621 MB) as limit
[methratio] @Thu May 14 14:22:53 2020   Presorting inputs
[methratio] @Thu May 14 14:22:53 2020   Calling samtools sort on mapped_reads/GRCh37.CFD1900266-NBL_R1_trimmed_BSMAP.bam and using 38621 MB of memory
[methratio] @Thu May 14 14:23:06 2020   Processing 1 chromosomes at a time
[part of log cut]
[methratio] @Thu May 14 14:27:48 2020   Reading 2 from mapped_reads/GRCh37.CFD1900266-NBL_R1_trimmed_BSMAP.tmpSrt.bam with samtools
Traceback (most recent call last):
  File "/apps/gent/CO7/skylake-ib/software/BSMAPz/1.1.1-intel-2019b-Python-2.7.16/bin/methratio.py", line 571, in <module>
    main()
  File "/apps/gent/CO7/skylake-ib/software/BSMAPz/1.1.1-intel-2019b-Python-2.7.16/bin/methratio.py", line 138, in main
    ret = map(chromWorker, argList)
  File "/apps/gent/CO7/skylake-ib/software/BSMAPz/1.1.1-intel-2019b-Python-2.7.16/bin/methratio.py", line 287, in chromWorker
    searchFunc(refseq, seq, depth, meth, convert, match, pos)
  File "/apps/gent/CO7/skylake-ib/software/BSMAPz/1.1.1-intel-2019b-Python-2.7.16/bin/methratio.py", line 529, in searchFunc
    depth[ip] += 1
OverflowError: unsigned short is greater than maximum
zyndagj commented 4 years ago

It looks like you're aligning a huge sample with very deep coverage. I'll get a fix in for you.

rmvpaeme commented 4 years ago

Is that commit 244ca43? If so, then I'm still getting the same error with methratio.py (on the same bamfiles, havent done realignment).

zyndagj commented 4 years ago

I added the -I flag to use unsigned integers instead of shorts for counting read depth in version 1.1.2. Try pulling it from conda or github and let me know if it solves your error.

rmvpaeme commented 4 years ago

problem is fixed, thanks

zyndagj commented 4 years ago

No problem, thanks for being patient!