def parse_module(fastqc_module):
    """
    Parse a fastqc module from the table format to a line format (list).
    Input is list containing the module. One list-item per line. E.g.:

    fastqc_module= [
        '>>Per base sequence quality    pass',
        '#Base  Mean    Median  Lower Quartile  Upper Quartile  10th Percentile 90th Percentile',
        '1  36.34   38.0    35.0    39.0    31.0    40.0',
        '2  35.64   38.0    35.0    39.0    28.0    40.0',
        '3  35.50   38.0    34.0    39.0    28.0    40.0',
        ...
        ]

    Return a list like this where each sublist after 1st is a column:
    ['pass', ['1', '2', '3', ...], ['36,34', '35.64', '35.50', ...], ['40.0', '40.0', '40.0', ...]]
    """
    row_list = []
    module_header = fastqc_module[0]
    module_name = module_header.split('\t')[0]
    # Line with module name >>Per base ...    pass/warn/fail
    row_list.append(module_header.split('\t')[1])

    # Handle odd cases:
    # Where no table is returned:
    if len(fastqc_module) == 1 and module_name == '>>Overrepresented sequences':
        return row_list + [[]] * 4
    if len(fastqc_module) == 1 and module_name == '>>Kmer Content':
        return row_list + [[]] * 5
    # Table is not the secod row:
    if module_name == '>>Sequence Duplication Levels':
        tot_dupl = fastqc_module[1].split('\t')[1]
        row_list.append(tot_dupl)
        del fastqc_module[1]

    # Conevrt table to list of lists:
    tbl = []
    for line in fastqc_module[2:]:
        tbl.append(line.split('\t'))
    # Put each column in a list:
    nrows = len(tbl)
    ncols = len(tbl[0])
    for i in range(0, ncols):
        col = []
        for j in range(0, nrows):
            col.append(tbl[j][i])
        row_list.append(col)
    return row_list