Created
September 21, 2011 10:18
-
-
Save jamescasbon/1231739 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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