diff --git a/src/find_interaction_cluster/create_ppi_files.py b/src/find_interaction_cluster/create_ppi_files.py index 6be04f38e3463ad839134681b83af7b17522bcfc..2e96d8e2882a920c7670ef7de50d62b0a8a4b9ab 100644 --- a/src/find_interaction_cluster/create_ppi_files.py +++ b/src/find_interaction_cluster/create_ppi_files.py @@ -22,7 +22,7 @@ from .community_finder import create_graph, find_communities, \ write_cytoscape_graph from doctest import testmod from .radomization_test_ppi import get_ppi_community_gene, \ - get_dna_community_gene, update_overlap_df + get_dna_community_gene, update_overlap_df,summary_randomisation_test def get_community_dic_fom_community_file(mfile: Union[Path, pd.DataFrame], @@ -310,13 +310,23 @@ def ppi_stats_analysis(community_file: Path, fasterdb_ppi: Path, ppi_gene = get_ppi_community_gene(pd.read_csv(ppi_outfile, sep="\t")) dic_dna_gene = get_dna_community_gene(pd.read_csv(community_file, sep="\t")) - df = update_overlap_df(df_overlap, dic_dna_gene, ppi_gene, iteration) + df, dic_values = update_overlap_df(df_overlap, dic_dna_gene, ppi_gene, + iteration) outstat = ConfigGraph.get_community_file(project, weight, global_weight, same_gene, "gene", f"ppi_gene_table_{iteration}_" f"stat.txt", "community_gene_vs_protein") df.to_csv(outstat, sep="\t", index=False) + final_df = summary_randomisation_test(df, dic_dna_gene, ppi_gene, + iteration, dic_values, + use_seed = False) + outstat = ConfigGraph.get_community_file(project, weight, global_weight, + same_gene, "gene", + f"ppi_gene_table_{iteration}_" + f"stat_recap.txt", + "community_gene_vs_protein") + final_df.to_csv(outstat, sep="\t", index=False) def ppi_stat_launcher(ps: int, weights: List[int],