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

src/find_interaction_cluster/__main__.py...

src/find_interaction_cluster/__main__.py src/find_interaction_cluster/community_finder.py: add the parameter use weight
parent 4a363356
Branches
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ def launcher(weight: int = 1,
global_weight: int = 0,
same_gene: bool = True,
inflation: float = 1.5,
use_weight: bool = False,
ps: int = ConfigGraph.cpu,
html_fig: bool = False, feature: str = 'exon', region: str = '',
component_type: str = 'nt',
......@@ -47,6 +48,7 @@ def launcher(weight: int = 1,
:param same_gene: Say if we consider as co-localised, exons within the \
same gene (True) or not (False) (default True)
:param inflation: The inflation parameter
:param use_weight: Say if we want to write the weight into the result file.
:param html_fig: True to display the html figure (default False).
:param feature: The feature we want to analyse (default 'exon')
:param region: The region of a gene to analyse (used only if feature \
......@@ -70,21 +72,23 @@ def launcher(weight: int = 1,
same_gene = True
if not ConfigGraph.get_hipmcl_prog().is_file():
install_hipmcl("INFO")
multiple_community_launcher(weight, global_weight, project, same_gene,
inflation, html_fig, feature, logging_level)
inflation, use_weight,
html_fig, feature, logging_level)
# multiple_stat_launcher(ps, weight, global_weight, project, same_gene,
# inflation, feature, logging_level)
multiple_nt_lm_launcher(ps, weight, global_weight, project,
same_gene, inflation, feature, region,
component_type, test_type, iteration, display_size,
logging_level=logging_level)
if feature == "gene":
# ppi_stat_launcher(weight, global_weight, project, same_gene,
# inflation,
# ConfigGraph.ppi_threshold, iteration,
# logging_level)
coloc_ppi_stat_main(weight, global_weight, project, same_gene,
inflation, iteration, logging_level)
# if feature == "gene":
# # ppi_stat_launcher(weight, global_weight, project, same_gene,
# # inflation,
# # ConfigGraph.ppi_threshold, iteration,
# # logging_level)
# coloc_ppi_stat_main(weight, global_weight, project, same_gene,
# inflation, iteration, logging_level)
......
......@@ -313,6 +313,7 @@ def write_interaction_file(arr_interaction: np.array, project: str,
def community_finder(weight: int, global_weight: int, project: str = "",
same_gene=True, html_fig: bool = False,
feature: str = "exon", inflation: float = 1.5,
use_weight: bool = True,
logging_level: str = "DISABLE"):
"""
Find communities inside co-localisation between exons found in \
......@@ -329,6 +330,7 @@ def community_finder(weight: int, global_weight: int, project: str = "",
:param logging_level: The level of data to display (default 'DISABLE')
:param html_fig: True to create an html figure, false else
:param inflation: The inflation parameter
:param use_weight: Say if we want to write the weight into the result file
:param feature: The feature we want to analyse (default 'exon')
"""
ConfigGraph.output_folder.mkdir(exist_ok=True, parents=True)
......@@ -340,7 +342,8 @@ def community_finder(weight: int, global_weight: int, project: str = "",
outfile, result_file = write_interaction_file(interaction, project,
weight, global_weight,
same_gene, feature=feature,
inflation=inflation)
inflation=inflation,
use_weight=use_weight)
graph = create_graph(interaction)
df, dic_community = find_communities(graph, project, outfile, result_file,
feature, inflation)
......@@ -380,6 +383,7 @@ def multiple_community_launcher(weight: int,
project: str,
same_gene: bool,
inflation: float = 1.5,
use_weight: bool = False,
html_fig: bool = False,
feature: str = 'exon',
logging_level: str = "DISABLE"):
......@@ -391,6 +395,7 @@ def multiple_community_launcher(weight: int,
:param same_gene: Say if we consider as co-localised exon within the \
same gene
:param inflation: The inflation parameter
:param use_weight: Say if we want to write the weight into the result file
:param html_fig: True to create an html figure, false else
:param feature: The feature we want to analyse (default 'exon')
:param project: The project name, used only if global_weight = 0
......@@ -402,4 +407,4 @@ def multiple_community_launcher(weight: int,
logging.info(f'Finding community for project : {project}, '
f'global_weight : {global_weight}, weight: {weight}')
community_finder(weight, global_weight, project, same_gene, html_fig,
feature, inflation)
feature, inflation, use_weight)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment