def prot_domains(ips_result):
    """
    Reads the tsv output of an InterProScan run and
    returns a dict with gene name and minimal E-value found
    for any domain for any application for the protein.
    """
    res = {}
    with open(ips_result) as f:
        for line in f:
            fields = line.split('\t')
            gene, e_value = fields[0], fields[8]
            e_value = float(e_value)
            if gene not in res:
                res[gene] = e_value
            else:
                res[gene] = min(res[gene], e_value)
        return res