diff --git a/src/find_interaction_cluster/config.py b/src/find_interaction_cluster/config.py index 2106604a767a8006c0a3770ca48b8a76d7a46f69..58ed82831ab6a70bd576f43f29a2bfa9ec52cfee 100644 --- a/src/find_interaction_cluster/config.py +++ b/src/find_interaction_cluster/config.py @@ -7,6 +7,7 @@ Description: Configuration folder """ from ..db_utils.config import Config +from pathlib import Path def get_community_file(project: str, weight: int, global_weight: int, @@ -27,21 +28,40 @@ def get_community_file(project: str, weight: int, global_weight: int, """ folder = ConfigGraph.community_folder folder.mkdir(exist_ok=True, parents=True) - if ext[0] != '.': - ext = "." + ext if global_weight != 0: project = f"global-weight-{global_weight}" return folder / f"{project}_weight-{weight}_same_gene-{same_gene}{ext}" +def get_hipmcl_folder() -> Path: + """ + Return the name of the hipmlc folder + :return: The hipmlc folder + """ + return list(Config.data.glob('*hipmcl*'))[0] + + +def get_hipmcl_prog() -> Path: + """ + Get the hipmcl program. + + :return: The file corresponding to hipmcl program + """ + return get_hipmcl_folder() / "bin" / "hipmcl" + + class ConfigGraph: """ Class containing all the variables that will be used in this submodule """ data = Config.data - cpu = Config.cpu + cpu = 1 #Â Config.cpu db_file = Config.db_file results = Config.results output_folder = results / 'community_of_co-localized-exons' community_folder = output_folder / 'communities' get_community_file = get_community_file + hip_zip = data / 'hipMCL.zip' + get_hip_folder = get_hipmcl_folder + get_hipmcl_prog = get_hipmcl_prog +