diff --git a/Snakefile_d2 b/Snakefile_d2 index dd3ad73a932b28ffaac0f176abd91ed0a5f2284f..14c096a22701b995d836ec40ca20ce4a71b20f0c 100644 --- a/Snakefile_d2 +++ b/Snakefile_d2 @@ -1,7 +1,7 @@ import glob WORKDIR = "snake_exec" if "workdir" not in config else config["workdir"] -INPUT = ["snake_tests/simu_bar_n1000_d5_m2-dev0.gexf"] if "input" not in config else config["input"] +INPUT = ["snake_tests/simu_bar_n10000_d5_m2-dev0.gexf"] if "input" not in config else config["input"] if "," in INPUT: if INPUT[0] == "[": INPUT = INPUT[1:-1] diff --git a/Snakefile_data_simu b/Snakefile_data_simu index 5a4638dd8c81ba481248b87aca73e01fa8bb271f..318918e5e041ec6f2fbddcf39c88c4ef87b91a40 100644 --- a/Snakefile_data_simu +++ b/Snakefile_data_simu @@ -1,6 +1,6 @@ OUTDIR="snake_exec" if "outdir" not in config else config["outdir"] -N=[1000] if "n" not in config else config["n"] # Number of molecule to simulate +N=[10000] if "n" not in config else config["n"] # Number of molecule to simulate D=[5] if "d" not in config else config["d"] # Average coverage of each molecule M=[2] if "m" not in config else config["m"] # Average number of molecule per barcode M_DEV=[0] if "m_dev" not in config else config["m_dev"] # Std deviation for merging number diff --git a/deconvolution/d_graph.py b/deconvolution/d_graph.py index de03bc0f2d5ebdb783bf9dc5a96b71d965d0ad54..c5eebf5efe02224b831d92185605d996a81b1493 100644 --- a/deconvolution/d_graph.py +++ b/deconvolution/d_graph.py @@ -258,7 +258,7 @@ def compute_all_max_d_graphs(graph, debug=False, clique_mode=None): # further decompose! into necessarily 2 communities community_as_graph = nx.Graph(graph.subgraph(comm)) if len(community_as_graph.nodes()) <= 2: - cliques += [community_as_graph.nodes()] + cliques += [list(community_as_graph.nodes())] else: cliques += map(list,nx.community.asyn_fluidc(community_as_graph,2)) diff --git a/deconvolution/to_d2_graph.py b/deconvolution/to_d2_graph.py index b233393e4b46e8c2c1c4218853aa633326b6419b..59ed95162d89a8ab92d7961b37f3e27938307938 100755 --- a/deconvolution/to_d2_graph.py +++ b/deconvolution/to_d2_graph.py @@ -53,7 +53,7 @@ def main(): d2g = d2.D2Graph(G) dprint("D2 graph object created") dprint("constructing d2 graph from barcode graph") - index_size = 8 #if clique_mode is None else 3 + index_size = 12 #if clique_mode is None else 3 d2g.construct_from_barcodes(index_size=index_size, debug=debug, clique_mode=clique_mode) dprint("[debug] d2 graph constructed") diff --git a/test_louvain.sh b/test_louvain.sh index 813d1cc455734e05a19260f44713297bee12dc32..ee79f24d42bd5ee425f1ec7d02a36284c825d424 100755 --- a/test_louvain.sh +++ b/test_louvain.sh @@ -1,12 +1,14 @@ -rm -Rf snake_tests/simu_bar_n1000_d5_m2* +prefix=simu_bar_n1000_d6_m2 + +rm -Rf snake_tests/$prefix* snakemake -s Snakefile_data_simu snakemake -s Snakefile_d2 -mv snake_exec/simu_bar_n1000_d5_m2.tar.gz snake_tests/simu_bar_n1000_d5_m2.tar.gz +mv snake_exec/$prefix.tar.gz snake_tests/$prefix.tar.gz cd snake_tests -tar xf simu_bar_n1000_d5_m2.tar.gz +tar xf $prefix.tar.gz cd .. do_max_cliques=1 @@ -15,11 +17,11 @@ then echo "max-cliques" - python deconvolution/evaluate.py --type d2 --barcode_graph snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2.gexf snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2_d2_simplified.gexf + python deconvolution/evaluate.py --type d2 --barcode_graph snake_tests/"$prefix"/"$prefix".gexf snake_tests/"$prefix"/"$prefix"_d2_simplified.gexf - python deconvolution/d2_to_path.py snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2.gexf snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2_d2_simplified.gexf + python deconvolution/d2_to_path.py snake_tests/"$prefix"/"$prefix".gexf snake_tests/"$prefix"/"$prefix"_d2_simplified.gexf - python deconvolution/evaluate.py --type path --barcode_graph snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2.gexf _path.gexf + python deconvolution/evaluate.py --type path --barcode_graph snake_tests/"$prefix"/"$prefix".gexf _path.gexf fi @@ -29,11 +31,11 @@ then echo "louvain" - python deconvolution/evaluate.py --type d2 --barcode_graph snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2.gexf snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2_d2_simplified_louvain.gexf + python deconvolution/evaluate.py --type d2 --barcode_graph snake_tests/"$prefix"/"$prefix".gexf snake_tests/"$prefix"/"$prefix"_d2_simplified_louvain.gexf - python deconvolution/d2_to_path.py snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2.gexf snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2_d2_simplified_louvain.gexf + python deconvolution/d2_to_path.py snake_tests/"$prefix"/"$prefix".gexf snake_tests/"$prefix"/"$prefix"_d2_simplified_louvain.gexf - python deconvolution/evaluate.py --type path --barcode_graph snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2.gexf _path.gexf + python deconvolution/evaluate.py --type path --barcode_graph snake_tests/"$prefix"/"$prefix".gexf _path.gexf fi do_comtest=0 @@ -43,10 +45,10 @@ then echo "******************************* Testing algorithm" - python deconvolution/evaluate.py --type d2 --barcode_graph snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2.gexf snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2_d2_simplified_comtest.gexf + python deconvolution/evaluate.py --type d2 --barcode_graph snake_tests/"$prefix"/"$prefix".gexf snake_tests/"$prefix"/"$prefix"_d2_simplified_comtest.gexf - python deconvolution/d2_to_path.py snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2.gexf snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2_d2_simplified_comtest.gexf + python deconvolution/d2_to_path.py snake_tests/"$prefix"/"$prefix".gexf snake_tests/"$prefix"/"$prefix"_d2_simplified_comtest.gexf - python deconvolution/evaluate.py --type path --barcode_graph snake_tests/simu_bar_n1000_d5_m2/simu_bar_n1000_d5_m2.gexf _path.gexf + python deconvolution/evaluate.py --type path --barcode_graph snake_tests/"$prefix"/"$prefix".gexf _path.gexf fi