From fd031d72de9dd72cc38347803bae05bd27d2bb77 Mon Sep 17 00:00:00 2001 From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr> Date: Tue, 17 Nov 2020 15:12:48 +0100 Subject: [PATCH] src/find_interaction_cluster/create_ppi_files.py: modification to call the new functions created in src/find_interaction_cluster/radomization_test_ppi.py --- src/find_interaction_cluster/create_ppi_files.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/find_interaction_cluster/create_ppi_files.py b/src/find_interaction_cluster/create_ppi_files.py index 6be04f38..2e96d8e2 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], -- GitLab