Turn the "run the workflow again" instructions into exercises.
authorPeter Amstutz <peter.amstutz@curii.com>
Fri, 29 Jan 2021 15:45:38 +0000 (10:45 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Fri, 29 Jan 2021 15:45:38 +0000 (10:45 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

_episodes/02-workflow.md
_episodes/03-running.md
_episodes/04-commandlinetool.md
_episodes/05-scatter.md
_episodes/06-expressions.md
_episodes/07-resources.md

index 3271ba8e984ed8aaae5177181c0cba37886a6d53..8ef18cd31a2930acd6fbcb7fbb29d203efa98d47 100644 (file)
@@ -1,6 +1,6 @@
 ---
 title: "Create a Workflow by Composing Tools"
 ---
 title: "Create a Workflow by Composing Tools"
-teaching: 20
+teaching: 30
 exercises: 10
 questions:
 - "What is the syntax of CWL?"
 exercises: 10
 questions:
 - "What is the syntax of CWL?"
index f3c9779dae1f1ce5c072d9ab97edf6f3e29aa52d..ba37ad3f00e4cec9102a3bb1cff8f55d83dd6398 100644 (file)
@@ -1,6 +1,6 @@
 ---
 title: "Running and Debugging a Workflow"
 ---
 title: "Running and Debugging a Workflow"
-teaching: 10
+teaching: 15
 exercises: 20
 questions:
 - "How do I provide input to run a workflow?"
 exercises: 20
 questions:
 - "How do I provide input to run a workflow?"
@@ -121,7 +121,11 @@ Resource requirements you can set include:
 * tmpdirMin: temporary directory available space
 * outdirMin: output directory available space
 
 * tmpdirMin: temporary directory available space
 * outdirMin: output directory available space
 
-After setting the RAM requirements, re-run the workflow.
+> ## Running the workflow
+>
+> Now that you've fixed the workflow, run it again.
+>
+{: .challenge }
 
 # Workflow results
 
 
 # Workflow results
 
index 22110fad4e51af48ea772a381d082535c311b160..07378aaaa79c6e7c35dc263af04311eb3aa1e1b5 100644 (file)
@@ -1,7 +1,7 @@
 ---
 title: "Writing a Tool Wrapper"
 ---
 title: "Writing a Tool Wrapper"
-teaching: 15
-exercises: 20
+teaching: 20
+exercises: 30
 questions:
 - "What are the key components of a tool wrapper?"
 - "How do I use software containers to supply the software I want to run?"
 questions:
 - "What are the key components of a tool wrapper?"
 - "How do I use software containers to supply the software I want to run?"
@@ -29,6 +29,11 @@ This will use the "featureCounts" tool from the "subread" package.
 
 # File header
 
 
 # File header
 
+A CommandLineTool describes a single invocation of a command line
+program.  It consumes some input parameters, runs a program, and
+captures output, mainly in in the form of files produced by the
+program.
+
 Create a new file "featureCounts.cwl"
 
 Let's start with the header.  This is very similar to the workflow, except that we use `class: CommandLineTool`.
 Create a new file "featureCounts.cwl"
 
 Let's start with the header.  This is very similar to the workflow, except that we use `class: CommandLineTool`.
@@ -42,21 +47,29 @@ label: featureCounts tool
 
 # Command line tool inputs
 
 
 # Command line tool inputs
 
-A CommandLineTool describes a single invocation of a command line program.
-
-It consumes some input parameters, runs a program, and captures
-output, mainly in in the form of files produced by the program.
-
-The variables used in the bash script are `$cores`, `$gtf`, `$counts` and `$counts_input_bam`.
-
-This gives us two file inputs, `gtf` and `counts_input_bam` which we can declare in our `inputs` section:
+The `inputs` section describes input parameters with the same form as
+the Workflow `inputs` section.
 
 
-```
-inputs:
-  gtf: File
-  counts_input_bam: File
-```
-{: .language-yaml }
+> ## Exercise
+>
+> The variables used in the bash script are `$cores`, `$gtf`, `$counts` and `$counts_input_bam`.
+>
+> * $cores is the number of CPU cores to use.
+> * $gtf is the input .gtf file
+> * $counts is the name we will give to the output file
+> * $counts_input_bam is the input .bam file
+>
+> Write the `inputs` section for the File inputs `gtf` and `counts_input_bam`.
+>
+> > ## Solution
+> > ```
+> > inputs:
+> >   gtf: File
+> >   counts_input_bam: File
+> > ```
+> > {: .language-yaml }
+> {: .solution}
+{: .challenge}
 
 # Specifying the program to run
 
 
 # Specifying the program to run
 
@@ -188,7 +201,7 @@ When creating a tool wrapper, it is helpful to run it on its own to test it.
 The input to a single tool is the same kind of input parameters file
 that we used as input to a workflow in the previous lesson.
 
 The input to a single tool is the same kind of input parameters file
 that we used as input to a workflow in the previous lesson.
 
-featureCounts.yaml:
+`featureCounts.yaml`
 
 ```
 counts_input_bam:
 
 ```
 counts_input_bam:
@@ -200,20 +213,23 @@ gtf:
 ```
 {: .language-yaml }
 
 ```
 {: .language-yaml }
 
-The invocation is also the same:
-
-```
-cwl-runner featureCounts.cwl featureCounts.yaml
-```
-{: .language-bash }
+> ## Running the tool
+>
+> Run the tool on its own to confirm it has correct behavior:
+>
+> ```
+> cwl-runner featureCounts.cwl featureCounts.yaml
+> ```
+> {: .language-bash }
+{: .challenge }
 
 # Adding it to the workflow
 
 
 # Adding it to the workflow
 
+Now that we have confirmed that the tool wrapper works, it is time to
+add it to our workflow.
+
 > ## Exercise
 >
 > ## Exercise
 >
-> Now that we have confirmed that the tool wrapper works, it is time
-> to add it to our workflow.
->
 >   1. Add a new step called `featureCounts` that runs our tool
 >      wrapper.  The new step should take input from
 >      `samtools/bam_sorted_indexed`, and should be allocated a
 >   1. Add a new step called `featureCounts` that runs our tool
 >      wrapper.  The new step should take input from
 >      `samtools/bam_sorted_indexed`, and should be allocated a
index 29039526c6432828ae0e7421ee3cf26784f9cce8..0881326756d6fbb596baf1764292fc96c5dc7ac8 100644 (file)
@@ -1,7 +1,7 @@
 ---
 title: "Analyzing Multiple Samples"
 ---
 title: "Analyzing Multiple Samples"
-teaching: 20
-exercises: 0
+teaching: 30
+exercises: 30
 questions:
 - "How can you run the same workflow over multiple samples?"
 objectives:
 questions:
 - "How can you run the same workflow over multiple samples?"
 objectives:
@@ -66,9 +66,13 @@ requirements:
 ```
 {: .language-yaml }
 
 ```
 {: .language-yaml }
 
-If you run this workflow, you will get exactly the same results as
-before, as all we have done so far is to wrap the inner workflow with
-an outer workflow.
+> ## Running the workflow
+>
+> Run this workflow.  You should get exactly the same results as
+> before, as all we have done so far is to wrap the inner workflow with
+> an outer workflow.
+>
+{: .challenge }
 
 # Scattering
 
 
 # Scattering
 
@@ -165,8 +169,12 @@ gtf:
 ```
 {: .language-yaml }
 
 ```
 {: .language-yaml }
 
-If you run the workflow, you will get results for each one of the
-input fastq files.
+> ## Running the workflow
+>
+> Run this workflow.  You will now get results for each one of the
+> input fastq files.
+>
+{: .challenge }
 
 # Combining results
 
 
 # Combining results
 
@@ -231,5 +239,10 @@ outputs:
 ```
 {: .language-yaml }
 
 ```
 {: .language-yaml }
 
-Run this workflow to get a single `featurecounts.tsv` file with a
-column for each bam file.
+> ## Running the workflow
+>
+> Run this workflow.  You will still have separate results from fastq
+> and and STAR, but now you will only have a single
+> `featurecounts.tsv` file with a column for each bam file.
+>
+{: .challenge }
index cf26be425496654fd02c45aea3707e1a65f31066..9c79ad550cc7cf82f1ab41ecab6f5408c070ec6f 100644 (file)
@@ -1,13 +1,15 @@
 ---
 title: "Dynamic Workflow Behavior"
 teaching: 20
 ---
 title: "Dynamic Workflow Behavior"
 teaching: 20
-exercises: 0
+exercises: 10
 questions:
 questions:
-- "How can I adjust workflow behavior at runtime?"
+- "What kind of custom logic can happen between steps?"
 objectives:
 objectives:
-- "Set "
+- "Customize the STAR output filename to use the input filename."
+- "Organize files into directories."
 keypoints:
 keypoints:
-- "First key point. Brief Answer to questions. (FIXME)"
+- "CWL expressions allow you to use custom logic to determine input parameter values."
+- "CWL ExpressionTool can be used to reshape data, such as declaring directories that should contain output files."
 ---
 
 # Expressions on step inputs
 ---
 
 # Expressions on step inputs
@@ -154,3 +156,11 @@ outputs:
     outputSource: featureCounts/featurecounts
 ```
 {: .language-yaml }
     outputSource: featureCounts/featurecounts
 ```
 {: .language-yaml }
+
+> ## Running the workflow
+>
+> Run the workflow.  Look at the output.  The BAM and fastqc files
+> should now be organized into directories, with better naming of the
+> bam files.
+>
+{: .challenge }
index c68b5acbc80e2dcb05cf6d7ef10a0fc212191b29..6b1277120806d76ce5ef64bb90decb4a015fdb44 100644 (file)
@@ -3,11 +3,11 @@ title: " Resources for further learning"
 teaching: 10
 exercises: 0
 questions:
 teaching: 10
 exercises: 0
 questions:
-- "Key question (FIXME)"
+- "Where should I go to learn more?"
 objectives:
 objectives:
-- "First learning objective. (FIXME)"
+- "Become a part of the CWL community."
 keypoints:
 keypoints:
-- "First key point. Brief Answer to questions. (FIXME)"
+- "Learn more advanced techniques from CWL user guide, by asking questions on the CWL forum and chat channel, and reading the specification."
 ---
 
 Hopefully you now have a basic grasp of the steps involved in
 ---
 
 Hopefully you now have a basic grasp of the steps involved in