SnapTools icon indicating copy to clipboard operation
SnapTools copied to clipboard

Cyclic dependency for make bmat

Open Zepeng-Mu opened this issue 6 years ago • 3 comments

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

Zepeng-Mu avatar Apr 28 '19 16:04 Zepeng-Mu

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

r3fang avatar Apr 28 '19 21:04 r3fang

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

r3fang avatar Apr 29 '19 16:04 r3fang

Yeah, I actually also thought about this, this seems to be the only way. Thanks!

Zepeng-Mu avatar Apr 29 '19 18:04 Zepeng-Mu