def check_mismatches(read, pair, mismatches, mm_option, req_map):
<EOL>if pair is False:<EOL><INDENT>mm = count_mismatches(read)<EOL>if mm is False:<EOL><INDENT>return False<EOL><DEDENT>if mismatches is False:<EOL><INDENT>return True<EOL><DEDENT>if mm <= mismatches:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>r_mm = count_mismatches(read)<EOL>p_mm = count_mismatches(pair)<EOL>if r_mm is False and p_mm is False:<EOL><INDENT>return False<EOL><DEDENT>if mismatches is False:<EOL><INDENT>return True<EOL><DEDENT>if req_map is True:<EOL><INDENT>if r_mm is False or p_mm is False:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>if mm_option == '<STR_LIT>':<EOL><INDENT>if (r_mm is not False and r_mm <= mismatches) or (p_mm is not False and p_mm <= mismatches):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>if mm_option == '<STR_LIT>':<EOL><INDENT>if r_mm is False:<EOL><INDENT>if p_mm <= mismatches:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>elif p_mm is False:<EOL><INDENT>if r_mm <= mismatches:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>elif (r_mm is not False and r_mm <= mismatches) and (p_mm is not False and p_mm <= mismatches):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>return False<EOL>
- check to see if the read maps with <= threshold number of mismatches
- mm_option = 'one' or 'both' depending on whether or not one or both reads
   in a pair need to pass the mismatch threshold
- pair can be False if read does not have a pair
- make sure alignment score is not 0, which would indicate that the read was not aligned to the reference