Lets have a simple snakefile like
rule targets:
input:
"plots/dataset1.pdf",
"plots/dataset2.pdf"
rule plot:
input:
"raw/{dataset}.csv"
output:
"plots/{dataset}.pdf"
shell:
"somecommand {input} {output}"
I want to generalize the plot rule so that it can be run inside a docker container, whit somethig like
rule targets:
input:
"plots/dataset1.pdf",
"plots/dataset2.pdf"
rule plot:
input:
"raw/{dataset}.csv"
output:
"plots/{dataset}.pdf"
singularity:
"docker://joseespinosa/docker-r-ggplot2"
shell:
"somecommand {input} {output}"
If I understood well, when I run snakemake --use-singularity
I obtain that somecommand
run inside the docker container, where the input csv files cannot be found without some volume configuration of the container.
Can you please provide a small working example describing how volumes can be configured in the Snakefile or other Snakemake files?