Skip to content
Snippets Groups Projects
Commit cf1f8a3b authored by nfontrod's avatar nfontrod
Browse files

src/find_interaction_cluster/config.py: creation of three new variables...

src/find_interaction_cluster/config.py: creation of three new variables get_hip_folder, get_hipmcl_prog and hip_zip
parent 65af81dd
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ Description: Configuration folder ...@@ -7,6 +7,7 @@ Description: Configuration folder
""" """
from ..db_utils.config import Config from ..db_utils.config import Config
from pathlib import Path
def get_community_file(project: str, weight: int, global_weight: int, 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, ...@@ -27,21 +28,40 @@ def get_community_file(project: str, weight: int, global_weight: int,
""" """
folder = ConfigGraph.community_folder folder = ConfigGraph.community_folder
folder.mkdir(exist_ok=True, parents=True) folder.mkdir(exist_ok=True, parents=True)
if ext[0] != '.':
ext = "." + ext
if global_weight != 0: if global_weight != 0:
project = f"global-weight-{global_weight}" project = f"global-weight-{global_weight}"
return folder / f"{project}_weight-{weight}_same_gene-{same_gene}{ext}" 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 ConfigGraph:
""" """
Class containing all the variables that will be used in this submodule Class containing all the variables that will be used in this submodule
""" """
data = Config.data data = Config.data
cpu = Config.cpu cpu = 1 # Config.cpu
db_file = Config.db_file db_file = Config.db_file
results = Config.results results = Config.results
output_folder = results / 'community_of_co-localized-exons' output_folder = results / 'community_of_co-localized-exons'
community_folder = output_folder / 'communities' community_folder = output_folder / 'communities'
get_community_file = get_community_file get_community_file = get_community_file
hip_zip = data / 'hipMCL.zip'
get_hip_folder = get_hipmcl_folder
get_hipmcl_prog = get_hipmcl_prog
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment