def readAndTransposeTable(infile, options):
    rows = []
    if options.transpose_format == "default":

        for line in infile:
            if line[0] == "#":
                continue
            rows.append(line[:-1].split("\t"))

    elif options.transpose_format == "separated":
        for line in infile:
            if line[0] == "#":
                continue
            key, vals = line[:-1].split("\t")
            row = [key] + vals.split(options.separator)
            rows.append(row)

    ncols = max(map(lambda x: len(x), rows))
    nrows = len(rows)

    new_rows = [[""] * nrows for x in range(ncols)]

    for r in range(0, len(rows)):
        for c in range(0, len(rows[r])):
            new_rows[c][r] = rows[r][c]

    if options.set_transpose_field:
        new_rows[0][0] = options.set_transpose_field

    for row in new_rows:
        options.stdout.write("\t".join(row) + "\n")

##########################################################
##########################################################
##########################################################
Keep track of which test cases have executed.
dataset/ETHPy150Open CGATOxford/cgat/scripts/table2table.py/readAndTransposeTable--crossover with--dataset/ETHPy150Open mblayman/tappy/tap/tracker.py/Tracker._track