<s> import pysam <EOL> import sys <EOL> def markreads ( bamfn , outfn ) : <EOL> bam = pysam . AlignmentFile ( bamfn , '<STR_LIT:rb>' ) <EOL> out = pysam . AlignmentFile ( outfn , '<STR_LIT:wb>' , template = bam ) <EOL> for read in bam . fetch ( until_eof = True ) : <EOL> tags = read . tags <EOL> tags . append ( ( '<STR_LIT>' , <NUM_LIT:1> ) ) <EOL> read . tags = tags <EOL> out . write ( read ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> if len ( sys . argv ) == <NUM_LIT:3> : <EOL> markreads ( * sys . argv [ <NUM_LIT:1> : ] ) <EOL> else : <EOL> print '<STR_LIT>' , sys . argv [ <NUM_LIT:0> ] , '<STR_LIT>' </s>
