After playing around with singularity and snakemake for awhile, I think it would be nice to have the option to pass specific singularity arguments to individual containers which might be used in separate rules under snakemake. Ideally, this would involve an optional field for each rule in the Snakefile.
The specific use case that comes to mind is setting filesystem bindings for singularity using the "-B" flag. For example, if I am running an aligner out of a container, I might like to give the container access to a locally-stored genome index so that the container (or project directory from which snakemake is run) need not have its own index (which is inefficient in terms of both time and space).
Currently, bindings can be passed to singularity through snakemake by setting the --singularity-args at runtime. i.e.
snakemake --use-singularity --singularity-args "-B <path_to_shared_directory>"
However, this necessitates that all containers deployed in a given Snakefile share the same bindings. I think this should be relatively easy to implement, and would also allow for additional options to be passed to specific containers for diverse future use cases.
Thank you for your consideration!