diff --git a/src/find_interaction_cluster/clip_figures/clip_analyser.py b/src/find_interaction_cluster/clip_figures/clip_analyser.py index 491f4799b4cb76b999081ff51247c6b6c692bf83..b30447e4a4151f26a398e7386e2db55aa578e06c 100644 --- a/src/find_interaction_cluster/clip_figures/clip_analyser.py +++ b/src/find_interaction_cluster/clip_figures/clip_analyser.py @@ -199,7 +199,8 @@ def create_table(feature: str, clip_file: Path, def create_figure(project: str, weight: int, global_weight: int, same_gene: bool, feature: str, clip_file: Path, - feature_bed: Path, test_type: str = "permutation") -> None: + feature_bed: Path, test_type: str = "permutation", + iteration: int = 10000) -> None: """ Create the final figure :param project: The name of the project of interest @@ -216,20 +217,22 @@ def create_figure(project: str, weight: int, global_weight: int, feature parameter. :param test_type: The king of test to perform for frequency analysis. \ (default 'lm') (choose from 'lm', 'permutation') + :param iteration: The number of iteration to make """ com_file = find_or_create_community(project, weight, global_weight, same_gene, feature) - output = com_file.parent / "CLIP_community_figures" + output = com_file.parent / f"CLIP_community_figures_{feature}" output.mkdir(exist_ok=True) outfile = output / f"{clip_file.name.split('.')[0]}.pdf" final_table = create_table(feature, clip_file, feature_bed, com_file) create_community_fig(final_table, feature, "peak_density", outfile, - test_type) + test_type, iteration=iteration) def clip_folder_analysis(clip_folder: Path, project: str, weight: int, global_weight: int, same_gene: bool, feature: str, test_type: str = "permutation", + iteration: int = 10000, logging_level: str = "DEBUG") -> None: """ Create the final figure @@ -245,6 +248,7 @@ def clip_folder_analysis(clip_folder: Path, project: str, weight: int, :param clip_folder: A folder containing clip file :param test_type: The king of test to perform for frequency analysis. \ (default 'lm') (choose from 'lm', 'permutation') + :param iteration: The number of iteration to make :param logging_level: The level of data to display (default 'DISABLE') """ logging_def(ConfigGraph.community_folder, __file__, logging_level) @@ -255,4 +259,4 @@ def clip_folder_analysis(clip_folder: Path, project: str, weight: int, for mfile in files: logging.info(f"Working on {mfile}") create_figure(project, weight, global_weight, same_gene, feature, - mfile, feature_bed, test_type) + mfile, feature_bed, test_type, iteration)