def unmapped(sam, mates):
for read in sam:<EOL><INDENT>if read.startswith('<STR_LIT:@>') is True:<EOL><INDENT>continue<EOL><DEDENT>read = read.strip().split()<EOL>if read[<NUM_LIT:2>] == '<STR_LIT:*>' and read[<NUM_LIT:6>] == '<STR_LIT:*>':<EOL><INDENT>yield read<EOL><DEDENT>elif mates is True:<EOL><INDENT>if read[<NUM_LIT:2>] == '<STR_LIT:*>' or read[<NUM_LIT:6>] == '<STR_LIT:*>':<EOL><INDENT>yield read<EOL><DEDENT>for i in read:<EOL><INDENT>if i == '<STR_LIT>':<EOL><INDENT>yield read<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
get unmapped reads