def other_end(end1):
    """
    Changes scaffold end name from 'fiveprime' to 'threeprime' and vice versa.
    """
    name_parts = end1.split("prime_")
    if name_parts[0] == "three":
        end2 = "fiveprime_" + name_parts[1]
    elif name_parts[0] == "five":
        end2 = "threeprime_" + name_parts[1]
    else:
        end2 = "other_end_error_" + end1       
    return end2