'MEX3A' ] target_gene_prot_ids = get_prot_ids_of_genes(target_gene) gene_prot_id_dict = get_prot_ids_of_genes(gene_names) target_study = list(target_gene_prot_ids.values()) target_study = [x for inside_list in target_study for x in inside_list] study = list(gene_prot_id_dict.values()) study = [x for inside_list in study for x in inside_list] g = GOEnrichmentStudy(pop, assoc, go, propagate_counts=True, alpha=0.05, methods=methods) g_res_target = g.run_study(target_study) pathways_of_target = [x.GO for x in g_res_target if x.study_count > 0] target_assoc = {} for key, entry in assoc.items(): for go_id in pathways_of_target: if go_id in entry: target_assoc[key] = entry g = GOEnrichmentStudy(pop, assoc, go, propagate_counts=True, alpha=0.05, methods=methods) g_res = g.run_study(study) g.prt_txt(sys.stdout, g_res) x = 0