Commit 268fcbf6 authored by rchikhi's avatar rchikhi
Browse files

merge

parent a8692cf4
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]
......
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
......
......@@ -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))
......
......@@ -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")
......
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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment