TypeError: ord() expected string of length 1, but int found
RNA editing detection by NGS data
Brought to you by:
ernestopicardi
Dear Ernesto,
I am using REDItools 1.2 (Pysam 0.10). Once I start REDItools, I run in the following error:
Pysam version used: 0.10.0
Script time --> START: 08/04/2019 17:46:50
Analysis ID: 502560955
Sorting GFF file.
Indexing GFF file.
Analysis on 1 regions.
Started analysis on region: 22:1-51304566
Loading known splice sites for region 22
Loaded 62525 positions for 22
Process Process-2:
Traceback (most recent call last):
File "/b06x/cluster/42.2/x86_64/easybuild/software/Python/2.7.12-foss-2017a/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/b06x/cluster/42.2/x86_64/easybuild/software/Python/2.7.12-foss-2017a/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/icgc/dkfzlsdf/analysis/B060/aichmueller_pan_cancer/software/REDItools-1.2/reditools/REDItoolDnaRna.py", line 1175, in do_work
exploreBAM(x)
File "/icgc/dkfzlsdf/analysis/B060/aichmueller_pan_cancer/software/REDItools-1.2/reditools/REDItoolDnaRna.py", line 1119, in exploreBAM
seq,qual,squal=normByStrand(seq,strand,squal,mystrand)
File "/icgc/dkfzlsdf/analysis/B060/aichmueller_pan_cancer/software/REDItools-1.2/reditools/REDItoolDnaRna.py", line 621, in normByStrand
**qual+=ord(squal_[i])-QVAL
TypeError: ord() expected string of length 1, but int found**
REDItools is called with:
python ${REDITOOL}/REDItoolDnaRna.py \
-i $OUT_PATH/rna.bam \
-j $OUT_PATH/dna.bam \
-f hs37d5_chr_22.fa \
-t 1 \
-o $OUT_PATH \
-c 10,10 \
-q 30,30 \
-m 30,255 \
-s 2 \
-X \
-S \
-u \
-U \
-C 10000000 \
-T $OUT_PATH/gff_chr22_sorted.gff3 \
-v 5 \
-V \
-r 5 \
-w gencode.v28lift37_chr22_splice_sites.ss 2> $OUT_PATH/${CHROM}_log.txt
I checked the source code for REDItoolDnaRna.py, but from the documentation and code, the occurrence of the error does not make sense to me.
Could you please have a look at my problem?
Thanks for the tool and your help!!!!!
Best wishes,
Chris
Dear Chris,
thank you for reporting this issue. The bug due to the use of an old pysam function has been fixed.
A novel version is now available, 1.2.1
Best,
Ernesto
Related
Tickets: #12
Dear Ernesto,
I am using REDItools 1.2.1 (Pysam 0.15.2). Once I start REDItoolDnaRna.py, I also have the above problem, described as follows. I want to know what caused this error and how to fix it. Could you please have a look at this problem and help me out.
Thank you very much!
Best wishes,
Sijia
python /home/binfo/RNAediting/software/installpath/bin/REDItoolDnaRna.py -i rna.bam -j dna.bam -f reference.fa -o /home/binfo/RNAediting/sampledata/output/ -c 10,1 -q 25,25 -m 20,20 -s 2 -g 1 -u -a 6-0 -v 2 -n0.0 -N0.0 -V
Pysam version used: 0.15.2
Script time --> START: 30/07/2019 09:57:30
Analysis ID: 267705323
Analysis on 1 regions.
Started analysis on region: chr21:1-48129895
Process Process-1:
Traceback (most recent call last):
File "/home/binfo/anaconda3/envs/py27/lib/python2.7/multiprocessing/process.py", line 267, in bootstrap
self.run()
File "/home/binfo/anaconda3/envs/py27/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(self._args, *self._kwargs)
File "/home/binfo/RNAediting/software/installpath/bin/REDItoolDnaRna.py", line 1179, in do_work
exploreBAM(x)
File "/home/binfo/RNAediting/software/installpath/bin/REDItoolDnaRna.py", line 1123, in exploreBAM
seq,qual,squal=normByStrand(seq,strand,squal,mystrand)
File "/home/binfo/RNAediting/software/installpath/bin/REDItoolDnaRna.py", line 623, in normByStrand
if type(i)==int: qual+=ord(squal[str(i)])-QVAL
TypeError: list indices must be integers, not str
Merging Tables.
Results saved on /home/binfo/RNAediting/sampledata/output/DnaRna_267705323/outTable_267705323
Script time --> END: 30/07/2019 09:57:37