def readList(infile, column=0, map_function=str, map_category={},
    with_title=False):
    """read a list of values from infile.

    Use map_function to convert values.
    Use map_category, to map read values directory 
    If with_title, first line is assumed to be a title
    """
    m = []
    errors = []
    title = None
    for l in infile:
        if l[0] == '#':
            continue
        if with_title and not title:
            title = l[:-1].split('\t')[column]
            continue
        try:
            d = map_function(l[:-1].split('\t')[column])
        except ValueError:
            continue
        if map_category:
            d = map_category[d]
        m.append(d)
    if with_title:
        return title, m
    else:
        return m
