def extract_pair(read_id, previous_left_pair=None):
    """
    Parse the read_id and find pair information and shorten it.
    :param read_id: str - read id with pair info
    :param previous_left_pair: bool/None - is this left pair? for consistency checking
    :return: tuple(str, bool/None) - read_id without pair info, extracted pair info
    """
    split = read_id.split()
    left_pair = None
    if split[-1][0] == '1':
        left_pair = True
    elif split[-1][0] == '2':
        left_pair = False

    if left_pair is not None:
        if previous_left_pair is not None:
            assert previous_left_pair == left_pair, 'previous_left_pair is %s but left_pair is %s (%s)' % (previous_left_pair, left_pair, read_id)

    return read_id, left_pair