def dict_g2go(file_g2go):
    """Creates a dictionary of type {gene1:[(GO_ID, Evidence, GO_name, category),
    (GO_ID, Evidence, GO_name, category), ...], }
    :param file_g2go: file with relations gene to GO
    :return: dict of type {gene1:[(GO_ID, Evidence, GO_name, category),
             (GO_ID, Evidence, GO_name, category), ...], }
    """
    gene2go = open(file_g2go, 'r', encoding = 'utf-8')
    gene2go.readline()  # skip header
    relations_g2go = gene2go.readlines()
    gene2go.close()
    relations_g2go.pop()
    dict_gene_go = {}

    for line in relations_g2go:
        line = line.split('\t')
        gene_id = line[1]
        go = line[2]
        evidence = line[3]
        name = line[5]
        category = line[7][:-1]

        if gene_id not in dict_gene_go and category == 'Process':
            dict_gene_go[gene_id] = []
            dict_gene_go[gene_id].append((go, evidence, name, category))
        else:
            if category == 'Process':
                dict_gene_go[gene_id].append((go, evidence, name, category))

    return dict_gene_go