Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# quickly fix mapping qualities in samfiles generated by SSAHA2
# mapq 255 is undefined according to spec, but SSAHA2 is not
# following this convention
import pysam
infile = pysam.Samfile( "-", "rb" )
outfile = pysam.Samfile( "-", "wb", template = infile )
for s in infile:
if s.mapq == 255:
s.mapq = 244
outfile.write(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment