Commit 5ff927fa authored by Yoann Dufresne's avatar Yoann Dufresne
Browse files

d2 generation Snakefile

parent 396f4d19
......@@ -3,3 +3,4 @@ art/
**/__pycache__/
.pytest_cache/
.idea/
.snakemake/
WORKDIR = "snake_tests"
DATA = "data"
rule all:
input:
f"{WORKDIR}/small_bar.tar.gz"
rule compress_data:
input:
barcode_graph=f"{WORKDIR}/{{barcode_file}}.gexf",
d2_raw=f"{WORKDIR}/{{barcode_file}}_d2_raw.gexf",
simplified_d2=f"{WORKDIR}/{{barcode_file}}_d2_simplified.gexf"
output:
zip=f"{WORKDIR}/{{barcode_file}}.tar.gz"
shell:
f"mkdir {WORKDIR}/{{wildcards.barcode_file}};"
f"mv {WORKDIR}/*.gexf {WORKDIR}/{{wildcards.barcode_file}}/ ;"
f"tar czf {{output.zip}} {WORKDIR}/{{wildcards.barcode_file}}/ ;"
f"rm -rf {WORKDIR}/{{wildcards.barcode_file}}/ ;"
rule d2_simplification:
input:
barcode_graph="{barcode_path}.gexf",
d2_raw="{barcode_path}_d2_raw.gexf"
output:
simplified_d2="{barcode_path}_d2_simplified.gexf"
shell:
"python3 deconvolution/d2_reduction.py -o {output.simplified_d2} {input.barcode_graph} {input.d2_raw}"
rule d2_generation:
input:
barcode_graph=f"{WORKDIR}/{{file}}.gexf"
output:
d2_file=f"{WORKDIR}/{{file}}_d2_raw.gexf"
shell:
f"python3 deconvolution/to_d2_graph.py {{input.barcode_graph}} -o {WORKDIR}/{{wildcards.file}}_d2_raw"
rule setup_workdir:
input:
barcode_graph=f"{DATA}/{{file}}.gexf"
output:
f"{WORKDIR}/{{file}}.gexf"
shell:
f"if [ ! -d {WORKDIR} ]; then mkdir {WORKDIR}; fi;"
f"cp {{input.barcode_graph}} {WORKDIR}"
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