Pysam is a Python package for reading, manipulating, and writing genomics data such as SAM/BAM/CRAM and VCF/BCF files. It's a lightweight wrapper of the HTSlib API, the same one that powers samtools, bcftools, and tabix.
I got an error that seems to be related to pysam (version 0.20.0 with python 3.10.9):
Traceback (most recent call last):
File "/usr/share/NanoMethPhase/nanomethphase.py", line 2242, in <module>
main()
File "/usr/share/NanoMethPhase/nanomethphase.py", line 2236, in main
args.func(args)
File "/usr/share/NanoMethPhase/nanomethphase.py", line 1194, in main_phase
alignmentwriter(result, outHP22BisSam)
File "/usr/share/NanoMethPhase/nanomethphase.py", line 411, in alignmentwriter
out_samRead.set_tags(all_tags)
File "pysam/libcalignedsegment.pyx", line 2656, in pysam.libcalignedsegment.AlignedSegment.set_tags
File "pysam/libcalignedsegment.pyx", line 385, in pysam.libcalignedsegment.pack_tags
AttributeError: module 'array' has no attribute 'typecode'
I got an error that seems to be related to pysam (version 0.20.0 with python 3.10.9):
One line in my BAM:
My guess is that some tags in my BAM are not compatible with pysam. Any help? Thanks.