diff --git a/src/nt_composition/config.py b/src/nt_composition/config.py index ae790526c0a2abe6ee98aeb816f542c1e222b8cc..c4a674bf948fc5ff7f6a55f5279b8702896baaa9 100644 --- a/src/nt_composition/config.py +++ b/src/nt_composition/config.py @@ -11,7 +11,7 @@ from ..db_utils.config import Config from typing import List -def get_weight_folder(weight: int, global_weight: int): +def get_weight_folder(weight: int, global_weight: int, ft_type: str): """ Get the weight folder. @@ -20,14 +20,17 @@ def get_weight_folder(weight: int, global_weight: int): the global weight is equal to 0 then then density figure are calculated \ by project, else all projet are merge together and the interaction \ seen in `global_weight` project are taken into account + :parma ft_type: The type fo featrue of interst :return: The folder that will contains the interaction with a weight \ greater or equal to `weigh` in ChIA-PET projects """ if global_weight == 0: - weight_folder = ConfigNt.density_folder / f"project_weight:{weight}" + weight_folder = ConfigNt.density_folder / \ + f"{ft_type}_project_weight-{weight}" else: weight_folder = ConfigNt.density_folder / \ - f"weight:{weight}-global_weight:{global_weight}" + f"{ft_type}_weight-{weight}_" \ + f"global_weight-{global_weight}" weight_folder.mkdir(parents=True, exist_ok=True) return weight_folder @@ -52,7 +55,7 @@ def get_density_file(weight: int, global_weight: int, project: str, ext = "pdf" else: ext = "txt" - res_folder = get_weight_folder(weight, global_weight) / project + res_folder = get_weight_folder(weight, global_weight, ft_type) / project res_folder.mkdir(exist_ok=True, parents=True) return res_folder / f"{project}_{ft_type}_{ft}_density.{ext}" @@ -76,7 +79,7 @@ def get_density_recap(weight: int, global_weight: int, ext = "pdf" else: ext = "txt" - outfolder = get_weight_folder(weight, global_weight) + outfolder = get_weight_folder(weight, global_weight, ft_type) outfolder.mkdir(exist_ok=True, parents=True) return outfolder / f"{ft_type}_{ft}_density_recap.{ext}" @@ -132,7 +135,7 @@ class ConfigNt: """ A class containing every parameters used in the submodule nt_composition """ - cpu = Config.cpu + cpu = 7 # Config.cpu data = Config.data result = Config.results db_file = Config.db_file