def iterate(infile):

    n = 0
    for line in infile:
        if line.startswith("#"):
            continue
        n += 1
        if n == 1:
            # replace non-alphanumeric characters with _
            header = re.sub("[^a-zA-Z0-9_\s]", "_", line[:-1]).split()
            DATA = collections.namedtuple("DATA", header)
            continue

        result = DATA(*line[:-1].split())

        yield result
iterate over infile and return a :py:class:`collections.namedtuple`
dataset/ETHPy150Open CGATOxford/cgat/CGAT/IOTools.py/iterate