3 # Copyright (c) 2017 Leiden University Medical Center
5 # Permission is hereby granted, free of charge, to any person obtaining a copy
6 # of this software and associated documentation files (the "Software"), to deal
7 # in the Software without restriction, including without limitation the rights
8 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 # copies of the Software, and to permit persons to whom the Software is
10 # furnished to do so, subject to the following conditions:
12 # The above copyright notice and this permission notice shall be included in
13 # all copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 task AppendToStringArray {
30 echo "~{sep='\n' array}
35 Array[String] outArray = read_lines(stdout())
43 # This task will fail if the MD5sum doesn't match the file.
48 # By default cromwell expects /bin/bash to be present in the container
49 # The 'bash' container does not fill this requirement. (It is in /usr/local/bin/bash)
50 # Use a stable version of debian:stretch-slim for this. (Smaller than ubuntu)
51 String dockerImage = "debian@sha256:f05c05a218b7a4a5fe979045b1c8e2a9ec3524e5611ebfdd0ef5b8040f9008fa"
57 echo "~{md5} ~{file}" | md5sum -c
66 task ConcatenateTextFiles {
69 String combinedFilePath
74 # When input and output is both compressed decompression is not needed
75 String cmdPrefix = if (unzip && !zip) then "zcat " else "cat "
76 String cmdSuffix = if (!unzip && zip) then " | gzip -c " else ""
80 mkdir -p "$(dirname ~{combinedFilePath})"
81 ~{cmdPrefix} ~{sep=" " fileList} ~{cmdSuffix} > ~{combinedFilePath}
85 File combinedFile = combinedFilePath
97 Boolean recursive = false
99 # Version not that important as long as it is stable.
100 String dockerImage = "debian@sha256:f05c05a218b7a4a5fe979045b1c8e2a9ec3524e5611ebfdd0ef5b8040f9008fa"
105 mkdir -p "$(dirname ~{outputPath})"
106 cp ~{true="-r" false="" recursive} ~{inputFile} ~{outputPath}
110 File outputFile = outputPath
119 # Making this of type File will create a link to the copy of the file in the execution
120 # folder, instead of the actual file.
121 # This cannot be propperly call-cached or used within a container.
128 ln -sf ~{inputFile} ~{outputPath}
132 File link = outputPath
138 Map[String,String] map
140 String dockerImage = "debian@sha256:f05c05a218b7a4a5fe979045b1c8e2a9ec3524e5611ebfdd0ef5b8040f9008fa"
145 md5sum "~{write_map(map)}" | cut -f 1 -d ' '
149 String md5sum = read_string(stdout())
159 task StringArrayMd5 {
161 Array[String] stringArray
163 String dockerImage = "debian@sha256:f05c05a218b7a4a5fe979045b1c8e2a9ec3524e5611ebfdd0ef5b8040f9008fa"
168 echo ~{sep=',' stringArray} | md5sum - | sed -e 's/ -//'
172 String md5sum = read_string(stdout())
184 String outputFile = "out.txt"
186 String dockerImage = "debian@sha256:f05c05a218b7a4a5fe979045b1c8e2a9ec3524e5611ebfdd0ef5b8040f9008fa"
190 echo ~{text} > ~{outputFile}
194 File out = outputFile
198 text: {description: "The text to print", category: "required"}
199 outputFile: {description: "The name of the output file", category: "common"}
200 timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"}
201 dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.",
202 category: "advanced"}
206 time_minutes: timeMinutes
214 String outputJson = basename(yaml, "\.ya?ml$") + ".json"
217 String memory = "128M"
218 # biowdl-input-converter has python and pyyaml.
219 String dockerImage = "quay.io/biocontainers/biowdl-input-converter:0.2.1--py_0"
223 mkdir -p "$(dirname ~{outputJson})"
227 with open("~{yaml}", "r") as input_yaml:
228 content = yaml.load(input_yaml)
229 with open("~{outputJson}", "w") as output_json:
230 json.dump(content, output_json)
234 File json = outputJson
239 time_minutes: timeMinutes
244 yaml: {description: "The YAML file to convert.", category: "required"}
245 outputJson: {description: "The location the output JSON file should be written to.", category: "advanced"}
246 memory: {description: "The maximum amount of memory the job will need.", category: "advanced"}
247 timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"}
248 dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.",
249 category: "advanced"}
259 struct IndexedVcfFile {
265 struct IndexedBamFile {
280 IndexedBamFile inputFile
282 IndexedBamFile controlFile
285 struct CaseControls {
286 Array[CaseControl] caseControls