Append the flanking markers extracted in the process of
    generating the MapChart to the QTL list file.

def append_flanking_markers(qtls_mk_file, flanking_markers):
    """ Append the flanking markers extracted in the process of
    generating the MapChart to the QTL list file.
    """
    matrix = read_input_file(qtls_mk_file, sep=',')
    output = []
    cnt = 0
    for row in matrix:
        if cnt == 0:
            markers = ['LOD2 interval start', 'LOD2 interval end']
        elif row[3] in flanking_markers:
            markers = flanking_markers[row[3]]
        else:
            markers = ['NA', 'NA']
        cnt += 1
        row.extend(markers)
        output.append(row)
    write_matrix(qtls_mk_file, output)