def calculate_identity(sequenceA, sequenceB):
    """
    Returns the percentage of identical characters between two sequences.
    Assumes the sequences are aligned.
    """

    sa, sb, sl = sequenceA, sequenceB, len(sequenceA)
    matches = [sa[i] == sb[i] for i in range(sl)]
    seq_id = (100 * sum(matches)) / sl

    gapless_sl = sum([1 for i in range(sl) if (sa[i] != '-' and sb[i] != '-')])
    gap_num = sum([1 for i in range(sl) if (sa[i] == '-' or sb[i] == '-')])
    if gapless_sl > 0:
        gap_id = (100 * sum(matches)) / gapless_sl
    else:
        gap_id = 0
    return (seq_id, gap_id, gap_num)