Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shell quote user-provided subsampling options
Many (most?) of the subsampling config a user can specify takes the form of command-line options to `augur filter`. Previously the values were passed through unmodified, leaving shell features like variable interpolation and command substitution as tripping hazards for the user, who would have to know to escape those in their YAML build config. This change preserves the shell-like semantics of single and double quotes and backslashes in subsampling values, but renders the tripping hazards inert by re-quoting each word in the value. This assumes that we don't need to support those shell features within subsampling config values (e.g. a user subsampling config doesn't need to refer to an environment variable), or at least that their cost in complexity for all users outweighs their benefit to a few users. There are many other places in the workflow which blindly interpolate, without quoting, user-provided values into shell commands. This change demonstrates a pattern we can use to handle them more robustly if we choose. Relatedly, we should consider a) explicitly using Snakemake's built in {foo:q} interpolation syntax by default for single-word values, or b) coercing Snakemake to always apply quoting unless asked otherwise with {foo:u} (currently requires a monkeypatch).
- Loading branch information