diff --git a/src/find_interaction_cluster/nt_and_community.py b/src/find_interaction_cluster/nt_and_community.py index a2faad830499dc70645614d2673712ab90f0376f..45babcb9e6f4a6a01711a99d97e901d185dc23ac 100644 --- a/src/find_interaction_cluster/nt_and_community.py +++ b/src/find_interaction_cluster/nt_and_community.py @@ -512,9 +512,9 @@ def expand_results_perm(df: pd.DataFrame, rdf: pd.DataFrame, cpnt: str, def create_and_save_ctrl_dataframe(df: pd.DataFrame, feature: str, region: str, cpnt_type: str, cpnt: str, - outfile: Path, test_type: str, + outfile_ctrl: Path, test_type: str, df_ctrl: pd.DataFrame, dic_com: Dict, - iteration: int, outfile_ctrl: Path) -> None: + iteration: int) -> None: """ Create a dataframe with a control community, save it as a table and \ as a barplot figure. @@ -526,19 +526,19 @@ def create_and_save_ctrl_dataframe(df: pd.DataFrame, feature: str, :param cpnt_type: The type of component to analyse; It \ can be 'nt', 'dnt' or 'aa'. :param cpnt: The component (nt, aa, dnt) of interest - :param outfile: File used to store diagnotics + :param outfile_ctrl: file used to stored the table and the figure \ + containing the test communities and the control community :param test_type: The type of test to make (permutation or lmm) :param df_ctrl: A dataframe containing the frequency of each nucleotide \ in each exons/gene in fasterdb. :param dic_com: A dictionary linking each community to the exons \ it contains. :param iteration: The number of sub samples to create - :param outfile_ctrl: file used to stored the table and the figure \ - containing the test communities and the control community """ if test_type == "lmm": ndf, rdf = lmm_with_ctrl(df, feature, region, cpnt, - outfile.parents[1] / outfile.name, cpnt_type) + outfile_ctrl.parents[1] / outfile_ctrl.name, + cpnt_type) df_bar = expand_results_lmm(ndf, rdf, cpnt, feature) else: rdf = perm_with_ctrl(df, feature, cpnt, df_ctrl, dic_com, iteration) @@ -646,8 +646,8 @@ def get_stat_cpnt_communities(df: pd.DataFrame, project: str, weight: int, res = {"project": project, "cpnt": cpnt, 'pval': lmm_maker(df, outfile, cpnt)} create_and_save_ctrl_dataframe(df, feature, region, cpnt_type, - cpnt, outfile, test_type, df_ctrl, dic_com, - iteration, outfile_ctrl) + cpnt, outfile_ctrl, test_type, df_ctrl, + dic_com, iteration) return pd.Series(res)