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

src/find_interaction_cluster/config.py: creation of a config file that store...

src/find_interaction_cluster/config.py: creation of a config file that store every variable used in the submodule src/find_interaction_cluster
parent 9c0d3e61
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Description: Configuration folder
"""
from ..db_utils.config import Config
def get_community_file(project: str, weight: int, global_weight: int,
same_gene: bool, is_fig: bool = False):
"""
Get the output file of interest.
:param project: Name of the project of interest
:param weight: The minimum weight of interaction to consider
:param global_weight: The global weight to consider. if \
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
:param same_gene: Say if we consider as co-localised exon within the \
same gene
:return: The filename of interest
"""
folder = ConfigGraph.output_folder
folder.mkdir(exist_ok=True, parents=True)
if is_fig:
ext = '.html'
else:
ext = '.txt'
if global_weight != 0:
project = f"global-weight-{global_weight}"
return folder / f"{project}_weight-{weight}_same_gene-{same_gene}{ext}"
class ConfigGraph:
"""
Class containing all the variables that will be used in this submodule
"""
data = Config.data
db_file = Config.db_file
results = Config.results
output_folder = results / 'community_of_co-localized-exons'
get_community_file = get_community_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