Exercises
You can solve exercises 1 and 2 on paper; exercise 3 uses the installation check. Compare your reasoning with the solutions after trying each task.
Exercise 1 — Find the dependencies
Three invocations of a program each produce a separate result file. A collection task reads all three files and writes a table. A plotting task reads that table and writes a figure. Assume that the invocations have no dependencies on one another and do not share output files.
- Draw the tasks and the arrows between them.
- Which tasks could run at the same time if enough resources are available?
- One invocation finishes much later than the other two. Which tasks must wait?
Success criterion: your diagram identifies every input needed by collection and plotting, and your explanation follows those data dependencies.
Hint
Draw an arrow whenever one task produces a file another task must read. Having an available core does not make a missing input file available.
Exercise 2 — Describe one task
Choose one stage of a calculation you use, or use this example: a program reads a measured data file and a fit-configuration file, then writes fitted parameters to a results file.
Write down its inputs, its operation and its output. Name one task that could use that output. Explain why describing only the command, without its files, would leave the workflow incomplete.
Success criterion: another person can tell what must be present before your task starts and which artifact it promises to produce. No Snakemake syntax is required.
Exercise 3 — Explain the installation check
Complete the installation page, then answer:
- What file is the requested result of the
hellorule? - How does the dry run differ from the real run in this example?
- Why does an unchanged second run have no work to do?
- Does this check establish that the scientific workflow in
SnakeMake.mainis correct?
Success criterion: you have observed the expected output line and unchanged rerun, and can distinguish an installation check from scientific validation.