Commit 9fde8e34 authored by Yoann Dufresne's avatar Yoann Dufresne
Browse files

Add a Snakemake for data simulation

parent e059dd4b
......@@ -16,7 +16,7 @@ rule compress_data:
zip=f"{WORKDIR}/{{barcode_file}}.tar.gz"
shell:
f"cd {WORKDIR}/ ;"
"if [ ! -d {wildcards.barcode_file} ] then; mkdir {wildcards.barcode_file} ; fi;"
"if [ ! -d {wildcards.barcode_file} ]; then mkdir {wildcards.barcode_file} ; fi;"
"mv *.gexf {wildcards.barcode_file}/ ;"
"tar czf {wildcards.barcode_file}.tar.gz {wildcards.barcode_file}/ ;"
"rm -rf {wildcards.barcode_file}/ ;"
......@@ -39,6 +39,7 @@ rule d2_generation:
output:
d2_file=f"{WORKDIR}/{{file}}_d2_raw.gexf"
shell:
f"python3 --version;"
f"python3 deconvolution/to_d2_graph.py {{input.barcode_graph}} -o {WORKDIR}/{{wildcards.file}}_d2_raw"
......
WORKDIR="snake_tests"
N=1000
D=5
M=2
rule all:
input:
f"{WORKDIR}/simu_bar_n{N}_d{D}_m{M}.gexf"
rule generate_barcodes:
input:
"{path}/simu_mol_{params}.gexf"
output:
"{path}/simu_bar_{params}_m{m}.gexf"
shell:
"python3 deconvolution/generate_fake_barcode_graph.py --merging_depth {wildcards.m} --input_graph {input} --output {output}"
rule generate_molecules:
output:
"{path}/simu_mol_n{n}_d{d}.gexf"
shell:
"python3 deconvolution/generate_fake_molecule_graph.py --num_molecule {wildcards.n} --avg_depth {wildcards.d} --output {output}"
......@@ -24,7 +24,7 @@ def main():
if not filename.endswith('.gexf'):
print("Input file must be gexf formatted", file=sys.stderr)
exit(1)
G = nx.read_gexf(filename)
# Index size must be changed for general purpose. 8 is good for d=5
d2g = d2.D2Graph(G)
......
Markdown is supported
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