def get_deletion_offset(alt_pos, trans_queue, changes):
    """Helper function to calculate original position in reference genome"""
    offset = 0
    for struct_var in changes:
        if struct_var[2] > alt_pos and struct_var[0] != 'TRANS':
            break
        elif struct_var[0] == 'DEL':
            offset += struct_var[3]
    for trans in trans_queue:
        if trans[2] > alt_pos:
            return offset
        offset += len(trans[1])
    return offset
