Solutions
These answers refer to the introductory exercises. Compare the dependencies and reasoning with your own answer; the exact placement of boxes in a diagram is not important.
Exercise 1 — Find the dependencies
run A ─┐
run B ─┼→ collect → plot
run C ─┘
Each arrow represents a result file required by the next task. The three runs can proceed concurrently because none needs another run's output and they write separate files. Collection needs all three outputs, so it must wait for the slowest run. Plotting must then wait for collection to produce the table.
More available cores cannot remove either dependency. They allow independent work to overlap, but they cannot supply an input that has not yet been produced.
Exercise 2 — Describe one task
For the fitting example, one possible answer is:
| Element | Description |
|---|---|
| Inputs | Measured data and a fit-configuration file |
| Operation | Run the fitting program with those inputs |
| Output | A file containing fitted parameters |
| Consumer | A plotting task that reads those parameters |
The filenames and program invocation would need to be made concrete before implementing the workflow. Listing the command alone would not explicitly say which previous task must supply its inputs or which subsequent task may use its output. The program itself is also part of the information needed to reproduce the calculation.
Answers based on your own calculation may differ. Check that the described output is a file another task can actually read, and that all required input files are named.
Exercise 3 — Explain the installation check
- The output is
hello.txt, containing the lineSnakemake is ready. - The dry run shows the planned
hellojob without executing its shell command. The real run executes that command and creates the file. - The output already exists and nothing relevant has changed in this small example, so Snakemake has no reason to rerun the job. If you did change or remove something, compare your situation with the stated assumptions before expecting the same behavior.
- No. The check establishes that this environment can plan and execute one simple rule. It has not run the scientific example or tested its data, models, statistical treatment or conclusions.
If the installation check failed, return to the first unsuccessful step in the installation instructions. Preserve the exact command and error message so you can discuss them with the instructor.
Continue with the first workflow.