gxiaolab / scAllele

Other
29 stars 1 forks source link

TypeError: 'NoneType' object is not subscriptable #9

Open Tianran1 opened 1 year ago

Tianran1 commented 1 year ago

Error message:

Traceback (most recent call last): File "/opt/conda/bin/scAllele", line 8, in sys.exit(main()) File "/opt/conda/lib/python3.9/site-packages/scAllele/scAllele.py", line 388, in main RCs = gqv_bam_utils.find_read_clusters(bam_file, options, chrom, fetch_start, fetch_end) File "/opt/conda/lib/python3.9/site-packages/scAllele/gqv_bam_utils.py", line 196, in find_read_clusters new_read = remove_homopolymer_ends(read, r_blocks) File "/opt/conda/lib/python3.9/site-packages/scAllele/gqv_bam_utils.py", line 397, in remove_homopolymer_ends aligned_qual = read.query_alignment_qualities[prefix : sufix] TypeError: 'NoneType' object is not subscriptable

giovanniquinones commented 1 year ago

It seems some reads in your bam file don't have a base quality string. You will need to remove such reads as scAllele needs the base quality information to score variants.

Tianran1 commented 1 year ago

Thanks. But I think all of my reads are without the quality score since they are converted from the bam file. Are there any solutions?

giovanniquinones commented 1 year ago

You can try adding a dummy string i.e. "JJJJJJ..." using pysam

Tianran1 commented 1 year ago

Thanks. I also noticed that there are some without sequence in the bam file, do I need to remove them?