Reading a BAM with a "*" in the quality causes SequenceWithQualities to throw an exception: object of type 'NoneType' has no len() in init() on the line:
:::python
if len( seq ) != len( qualstr ):
According to pysam:
http://www.cgat.org/~andreas/documentation/pysam/api.html#pysam.AlignedRead
The "qual" field can be None if not present (ie a "*" in the SAM)
Thus the fix should be (I think) from:
:::python
if read.qual != "*":
seq = SequenceWithQualities( read.seq, read.qname, read.qual )
to:
:::python
if read.qual is not None and read.qual != "*":
seq = SequenceWithQualities( read.seq, read.qname, read.qual )