diff --git a/src/find_interaction_cluster/community_finder.py b/src/find_interaction_cluster/community_finder.py index d65d5a81cacaedc6dbe18b7885e4a89fc4568fa5..b7467fc4ad2995017f4ab99554df16662c016cb4 100644 --- a/src/find_interaction_cluster/community_finder.py +++ b/src/find_interaction_cluster/community_finder.py @@ -11,7 +11,7 @@ import networkx as nx import numpy as np from networkx.algorithms import community import sqlite3 -from .config import ConfigGraph, get_communities +from .config import ConfigGraph, get_communities_basefile from ..nt_composition.make_nt_correlation import get_project_colocalisation from ..logging_conf import logging_def import pandas as pd @@ -19,11 +19,9 @@ import logging import plotly.graph_objects as go import plotly from pathlib import Path -from typing import Tuple, Dict, List +from typing import Tuple, Dict import matplotlib.cm as cm from matplotlib.colors import to_rgba -from itertools import product -import multiprocessing as mp import json import subprocess as sp @@ -106,7 +104,7 @@ def find_communities(graph: nx.Graph, project: str, cmd = f"mpirun -np 1 {ConfigGraph.get_hipmcl_prog()} -M {outfile} " \ f"-I 1.5 -per-process-mem 50 -o {result_file}" sp.check_call(cmd, shell=True, stderr=sp.STDOUT) - communities = get_communities(result_file) + communities = get_communities_basefile(result_file) dic_community = {} cov = round(community.coverage(graph, communities), 2) modularity = community.modularity(graph, communities, weight='X')