def mutindex2pos(x, start, end, mut_pos):
    """
    Convert mutation indices back to genome positions
    """

    if x == -.5:
        return start
    elif x == len(mut_pos) - .5:
        return end
    else:
        i = int(x - .5)
        j = int(x + .5)
        return (mut_pos[i] + mut_pos[j]) / 2.0