diff --git a/src/find_interaction_cluster/clip_figures/__main__.py b/src/find_interaction_cluster/clip_figures/__main__.py index 17a63fa0e72b83d24663dcbca2be2caf7d32c62a..122674490a4d8228fb6ebb7341088b946c6710f7 100644 --- a/src/find_interaction_cluster/clip_figures/__main__.py +++ b/src/find_interaction_cluster/clip_figures/__main__.py @@ -13,14 +13,18 @@ from .clip_analyser import clip_folder_analysis @lp.parse(test_type=["permutation", "lm"], feature=["gene", "exon"]) -def clip_analysis(clip_folder: str, weight: int, - global_weight: int, same_gene: bool = True, +def clip_analysis(clip_folder: str, weight: int = -1, + global_weight: int = -1, same_gene: bool = True, feature: str = "exon", project: str = "GSM1018963_GSM1018964", test_type: str = "permutation", iteration: int = 10000, + display_size: bool=False, + community_file: str = "", + ps: int = 1, logging_level: str = "DEBUG") -> None: """ - Create the final figure + Create the final figure. + :param project: The name of the project of interest :param weight: The minimum weight of interaction to consider :param global_weight: The global weight to consider. if \ @@ -34,9 +38,18 @@ def clip_analysis(clip_folder: str, weight: int, :param test_type: The kind of test to perform for frequency analysis. \ (default 'lm') (choose from 'lm', 'permutation') :param iteration: The number of iteration + :param display_size: True to display the size of the community. \ + False to display nothing. (default False) + :param community_file: A file containing custom communities. If \ + it equals to '' then weight, global weight and same genes parameter are \ + used to find the community files computed with ChIA-PET data. + :param ps: The number of processes to create (default 1) :param logging_level: The level of data to display (default 'DISABLE') :return: The final dataframe that can be used to create clip figures """ + if (weight == -1 or global_weight == -1) and community_file == "": + raise ValueError(f"Global weight or weight can't be equal to one if " + f"community_file is not defined !") clip_folder = Path(clip_folder) if test_type == "lm": raise NotImplementedError("test_type for lm is not implemented !") @@ -44,7 +57,7 @@ def clip_analysis(clip_folder: str, weight: int, raise NotADirectoryError(f"{clip_folder} is not an existing directory") clip_folder_analysis(clip_folder, project, weight, global_weight, same_gene, feature, test_type, iteration, - logging_level) + display_size, community_file, ps, logging_level) clip_analysis() \ No newline at end of file