From cf1f8a3b6983d6877227b08340455d97feaa7ceb Mon Sep 17 00:00:00 2001
From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr>
Date: Mon, 6 Jul 2020 16:00:25 +0200
Subject: [PATCH] src/find_interaction_cluster/config.py: creation of three new
 variables get_hip_folder, get_hipmcl_prog and hip_zip

---
 src/find_interaction_cluster/config.py | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/src/find_interaction_cluster/config.py b/src/find_interaction_cluster/config.py
index 2106604a..58ed8283 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
+
-- 
GitLab