def trim_trailing(scores, threshold):
    """
    Trim low quality bases from the 3'-end of the sequence.
    """
    threshold = abs(threshold)
    position = 0
    for position, basescore in enumerate(scores[::-1]):
        if basescore >= threshold:
            break
    return 0, position
