2 title: "Running and debugging a workflow"
6 - "Key question (FIXME)"
8 - "First learning objective. (FIXME)"
10 - "First key point. Brief Answer to questions. (FIXME)"
13 # 1. The input parameter file
15 CWL input values are provided in the form of a YAML or JSON file.
16 Create one by right clicking on the explorer, select "New File" and
17 create a called file "main-input.yaml".
19 This file gives the values for parameters declared in the `inputs`
20 section of our workflow. Our workflow takes `fq`, `genome` and `gtf`
23 When setting inputs, Files and Directories are given as an object with
24 `class: File` or `class: Directory`. This distinguishes them from
25 plain strings that may or may not be file paths.
27 Note: if you don't have example sequence data or the STAR index files, see [setup](/setup.html).
32 location: rnaseq/raw_fastq/Mov10_oe_1.subset.fq
33 format: http://edamontology.org/format_1930
36 location: hg19-chr1-STAR-index
39 location: rnaseq/reference_data/chr1-hg19_genes.gtf
47 location: keep:9178fe1b80a08a422dbe02adfd439764+925/raw_fastq/Mov10_oe_1.subset.fq
48 format: http://edamontology.org/format_1930
51 location: keep:02a12ce9e2707610991bd29d38796b57+2912
54 location: keep:9178fe1b80a08a422dbe02adfd439764+925/reference_data/chr1-hg19_genes.gtf
57 # 2. Running the workflow
59 Type this into the terminal:
62 cwl-runner main.cwl main-input.yaml
65 # 3. Debugging the workflow
67 A workflow can fail for many reasons: some possible reasons include
68 bad input, bugs in the code, or running out memory. In this case, the
69 STAR workflow might fail with an out of memory error.
71 To help diagnose these errors, the workflow runner produces logs that
72 record what happened, either in the terminal or the web interface.
74 Some errors you might see in the logs that would indicate an out of
78 EXITING: fatal error trying to allocate genome arrays, exception thrown: std::bad_alloc
79 Possible cause 1: not enough RAM. Check if you have enough RAM 5711762337 bytes
80 Possible cause 2: not enough virtual memory allowed with ulimit. SOLUTION: run ulimit -v 5711762337
86 Container exited with code: 137
89 (Exit code 137 most commonly occurs when a container goes "out of memory" and is terminated by the operating system).
91 If this happens, you will need to request more RAM.
93 # 4. Setting runtime RAM requirements
95 By default, a step is allocated 256 MB of RAM. From the STAR error message:
97 > Check if you have enough RAM 5711762337 bytes
99 We can see that STAR requires quite a bit more RAM than that. To
100 request more RAM, add a "requirements" section with
101 "ResourceRequirement" to the "STAR" step:
108 run: bio-cwl-tools/STAR/STAR-Align.cwl
111 Resource requirements you can set include:
113 * coresMin: CPU cores
114 * ramMin: RAM (in megabytes)
115 * tmpdirMin: temporary directory available space
116 * outdirMin: output directory available space
118 After setting the RAM requirements, re-run the workflow.
120 # 5. Workflow results
122 The CWL runner will print a results JSON object to standard output. It will look something like this (it may include additional fields).
127 "bam_sorted_indexed": {
128 "location": "file:///home/username/rnaseq-cwl-training-exercises/Aligned.sortedByCoord.out.bam",
129 "basename": "Aligned.sortedByCoord.out.bam",
134 "basename": "Aligned.sortedByCoord.out.bam.bai",
135 "location": "file:///home/username/rnaseq-cwl-training-exercises/Aligned.sortedByCoord.out.bam.bai",
142 "location": "file:///home/username/rnaseq-cwl-training-exercises/Mov10_oe_1.subset_fastqc.html",
143 "basename": "Mov10_oe_1.subset_fastqc.html",
150 This has the same structure as `main-input.yaml`. The each output
151 parameter is listed, with the `location` field of each `File` object
152 indicating where the output file can be found.