def trace_realign_result(row, realign_cigar):
    """
    The function is used to trace the cigar index of introns which are used to split the realign_cigar.
    Return a ci_list.
    realn_tx_pos means the position regardless of introns and relative to the realign_start. The position of
    bases on the tx_seq.
    """
    ci_list = []
    intron_start = row['tx_leftexon_end']
    realn_tx_pos = row['tx_leftexon_end'] - row['realign_start']
    realn_intron_pos = [realn_tx_pos]
    for exon_size in row['exon_sizes']:
        realn_tx_pos += exon_size
        realn_intron_pos.append(realn_tx_pos)
    for realn_tx_pos in realn_intron_pos:
        trace = realign_cigar.trace_ci_rdp(start_ci=(0, 0), start_pos=0,
            end_pos=realn_tx_pos, start_rdp=0)
        if not trace[2]:
            raise Exception(
                'Error:, cannot trace to the intron position in the realign cigar!'
                )
        ci_list.append(trace[0])
    return ci_list
