def write_csv(csvfile, m, index, columns, sep="\t", index_label="SampleKey"):
    fw = open(csvfile, "w")
    print >> fw, "\t".join([index_label] + columns)
    for i, a in enumerate(m):
        print >> fw, index[i] + "\t" + "\t".join(str(x) for x in a)
    fw.close()
dataset/ETHPy150Open tanghaibao/jcvi/variation/str.py/write_csv/original