-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Nice example - I came here from the SO answer.
Unlike the other rule that uses a script: key, the use of shell: key shown below means that Snakemake will not track the dependency between this rule and the scr/test-script.R file:
Lines 18 to 22 in a18f782
| shell: | |
| "Rscript scr/test-script.R \ | |
| --input {input.data} \ | |
| --output {output.out} \ | |
| --myFactor {params.myFactor}" |
I would recommend it as better practice to
- declare the script in the
input:input: script='scr/test-script.R', data='data/testData.rds'
- use that Jinja variable in the
shell:command, e.g.,RScript {input.script} ...
This way, if the script has changes made to it, Snakemake can use them to invalidate any downstream objects that may have used an older version.
At least, that's what I picked up from using that style of integration (custom arguments to the scripts) for a couple years. Personally, I moved on to favor the script: style (using the snakemake object), and find it clearer to maintain.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels