SnapTools
SnapTools copied to clipboard
Cyclic dependency for make bmat
Hi, I think it makes sense to put the binary matrix in the same snap file as input. However, this can create a "cyclic dependency" when using tools like snakemake, because the input name and the output name are the same.
Is there any way to circumvent this?
Many thanks
Hi Zepeng,
Thanks for trying! I don't use snalemake myself but one of my labmate does and he has figured this out, i will ask him tomorrow and get you back tomorrow.
R
Hi Zepeng,
I get back from my lab mate, he just create another file as output {dissection}/{dataset}/{dataset}.snap.add_bmat.ok
rule snap_add_bmat:
input:
snap="{dissection}/{dataset}/{dataset}.snap"
output:
"{dissection}/{dataset}/{dataset}.snap.add_bmat.ok"
params:
jobname = "{dataset}.snap_add_bmat"
benchmark:
"benchmarks/{dissection}/{dataset}.snap_add_bmat.benchmark"
log:
"log/{dissection}/{dataset}.snap_add_bmat.log"
shell:
"""
/home/yangli1/apps/anaconda2/bin/snaptools snap-add-bmat \
--snap-file={input.snap} \
--bin-size-list 1000 5000 10000 \
--verbose=True &> {log}
echo "Done" > {output}
"""
Let me know if this does not solve your question
Yeah, I actually also thought about this, this seems to be the only way. Thanks!