humann/tests/utils.py
def read_table_rows(file):
    """ Read in the table from a file, storing by rows """
    
    # The first line of the file is the header of column ids
    data=[]
    rows=[]
    with open(file) as file_handle:
        columns=file_handle.readline().rstrip()
        for line in file_handle:
            line_info=line.rstrip().split("\t")
            rows.append(line_info[0])
            data.append(line_info[1:])
    
    # reduce rows to string so it will be the same format as columns
    rows="\t".join(rows)   
      
    return columns, rows, data
 Read in the table from a file, storing by rows 
Read in the table from a file, storing by rows
Read in the table from a file storing by rows
def read_table_rows(file):
    data=[]
    rows=[]
    with open(file) as file_handle:
        columns=file_handle.readline().rstrip()
        for line in file_handle:
            line_info=line.rstrip().split("\t")
            rows.append(line_info[0])
            data.append(line_info[1:])
    rows="\t".join(rows)   
    return columns, rows, data
def read_table_rows ( file ) : data = [ ] rows = [ ] with open ( file ) as file_handle : columns = file_handle . readline ( ) . rstrip ( ) for line in file_handle : line_info = line . rstrip ( ) . split ( "\t" ) rows . append ( line_info [ 0 ] ) data . append ( line_info [ 1 : ] ) rows = "\t" . join ( rows ) return columns , rows , data
Read in the table from a file, storing by rows
Read in the table from a file storing by rows
""" Read in the table from a file, storing by rows """ # The first line of the file is the header of column ids # reduce rows to string so it will be the same format as columns
file