def _evalues_score_gap_tuple(ranked_scores):
    """
    ranked list of 3-part tuples, returns a 2-part tuple with max score and gap to next best socre

    :param ranked_scores:  ranked list of 3-part tuples [(id,score,evalue),...,(id,score,evalue)]
    :return: tuple (float, float) 0: ranked alignment score, 1: the gap between best and next best
    """
    if len(ranked_scores) > 1:  # if there was more than one hit
        # ranked_scores of form [(id, score, evalue),(id, score, evalue)]
        score_gap = ranked_scores[0][1] - ranked_scores[1][1]
        r = (ranked_scores[0][2], score_gap)
    elif len(ranked_scores) == 1:  # for the case where there was only one hit
        r = (ranked_scores[0][2], -99)
    else:
        r = (-99, -99)
    return(r)