Created
March 10, 2016 17:22
-
-
Save mdshw5/5f4ca2ae627c8aea1786 to your computer and use it in GitHub Desktop.
biostars 75693
This file contains hidden or 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
import simplesam | |
with simplesam.Reader(open('input.sam')) as sam: | |
with simplesam.Writer(open('output.sam', 'w'), sam.header) as fixed: | |
for read in sam: | |
if bool(read.flag & 0x800): | |
read.flag -= 0x800 | |
if not read.secondary: | |
read.flag += 0x100 | |
fixed.write(read) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment