import csv


def get_tsv_header(input):
    """Get a header of a tsv file.
    
    Column counts of the first (header) and second (content) line are compared. If the header has 
    one column less than the content, then a new column is added to the beginning of the returned list
    (convention in Chipster to handle R files).    
    """
    with open(input) as file:
        reader = csv.reader(file, delimiter='\t')
        header = next(reader)
        row = next(reader);     
     
    if len(header) + 1 == len(row):
        header = [' '] + header;
        
    return header