As part of a pipeline, I am trying to create a rule which takes a file containing file paths to gVCF files and copies them to a compute node. I would like to have all output files defined in the output of the rule, so they will get delete when I mark them with temp()
. Currently I am doing the following:
rule CopyToNode:
input:
gVCF_list
output:
gVCFs_copy_node
threads:
2
shell:
"""
cat {input} | xargs -n1 -P{threads} -I% rsync -avh % {SCRATCH_DIR}
awk -F/ '{{print $NF}}' {input} | awk '{{printf "{SCRATCH_DIR}%s\\n", $0}}' > {output}
"""
This however doesn't actually have the file names in the rule output (the output is just a file containing the file path).
If I understand well, you wish to copy files on a node and flag the copied files as temp? Not sure you can do this, the desired output files would be remote there. Snakemake does not support this I think.