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

src/nt_composition/config.py: Creation of a config file that stores every...

src/nt_composition/config.py: Creation of a config file that stores every variable used in submodule ,t_composition
parent cfc8fe49
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Description: This file contains the location of every input and result \
file that will be produced by this module.
"""
from ..db_utils.config import Config
def get_density_file(project: str, ft_type: str, ft: str,
fig: bool = False):
"""
Get the filename that will contain the density data or figure.
:param project: A project name
:param ft_type: A feature type
:param ft: A feature
:param fig: Say if the result file is a figure or not
:return: The filename that will contain the density data or figure.
"""
if fig:
ext = "pdf"
else:
ext = "txt"
res_folder = ConfigNt.density_folder / project
res_folder.mkdir(exist_ok=True, parents=True)
return res_folder / f"{project}_{ft_type}_{ft}_density.{ext}"
def get_density_recap(ft_type: str, ft: str, fig: bool = False):
"""
Get the density correlation recap file.
:param ft_type: A feature type
:param ft: A feature
:return:
"""
if fig:
ext = "pdf"
else:
ext = "txt"
ConfigNt.density_folder.mkdir(exist_ok=True, parents=True)
return ConfigNt.density_folder / f"{ft_type}_{ft}_density_recap.{ext}"
class ConfigNt:
"""
A class containing every parameters used in the submodule nt_composition
"""
data = Config.data
result = Config.results
db_file = Config.db_file
output_folder = result / "nt_composition"
interaction = output_folder / 'interaction_number'
interaction_file = interaction / "interaction_number_by_project.txt"
density_folder = output_folder / 'density_fig'
get_density_recap = get_density_recap
selected_project = interaction / "selected_sample.txt"
get_density_file = get_density_file
\ No newline at end of file
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