diff --git a/CHANGELOG.md b/CHANGELOG.md index 475927c220f48637ea16600fed88a5beceb2c5c3..0265940d63f3b6d68c5b9e470a4215c63966e074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ that users understand how the changes affect the new version. version 1.1.0-dev --------------------------- ++ Use the biowdl-input-converter container for JsonToYaml, to reduce the amount of containers needed. ++ Add biowdl-input-converter and remove SampleConfigToSampleReadgroupLists which it replaces. + GATK.GenotypeGVCFs: Increased memoryMultiplier from 2.0 to 3.0 + Minimap2: Add -k option to minimap2 mapping + Added bwakit task diff --git a/biowdl.wdl b/biowdl.wdl new file mode 100644 index 0000000000000000000000000000000000000000..153e56fe0673e2be0336ce6f4b31444ff2a4d23f --- /dev/null +++ b/biowdl.wdl @@ -0,0 +1,53 @@ +version 1.0 + +# Copyright (c) 2018 Leiden University Medical Center +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +task InputConverter { + input { + File samplesheet + String outputFile = "samplesheet.json" + # File checking only works when: + # 1. Paths are absolute + # 2. When containers have the directory with the files mounted. + # Therefore this functionality does not work well with cromwell. + Boolean skipFileCheck=true + Boolean checkFileMd5sums=false + Boolean old=false + String dockerImage = "quay.io/biocontainers/biowdl-input-converter:0.1.0--py_0" + } + + command <<< + biowdl-input-converter \ + -o ~{outputFile} \ + ~{true="--skip-file-check" false="" skipFileCheck} \ + ~{true="--check-file-md5sums" false="" checkFileMd5sums} \ + ~{true="--old" false="" old} \ + ~{samplesheet} + >>> + + output { + File json = outputFile + } + + runtime { + docker: dockerImage + } +} diff --git a/common.wdl b/common.wdl index 79b549a7d70a9e1902f05870f4e4c56fb5e9c017..8fca2c7fd91485c3a00d0e0d6564df4a0f3e242a 100644 --- a/common.wdl +++ b/common.wdl @@ -134,47 +134,6 @@ task MapMd5 { } } -task SampleConfigToSampleReadgroupLists { - input { - File yaml - String outputJson = "samples.json" - - String dockerImage = "biowdl/pyyaml:3.13-py37-slim" - } - - command <<< - set -e - mkdir -p $(dirname ~{outputJson}) - python <<CODE - import json - import yaml - with open("~{yaml}", "r") as input_yaml: - sample_config = yaml.load(input_yaml) - - sample_rg_lists = [] - for sample in sample_config["samples"]: - new_sample = {"readgroups": [], "id": sample['id']} - for library in sample["libraries"]: - for readgroup in library["readgroups"]: - new_readgroup = {'lib_id': library['id'], 'id': readgroup['id']} - # Having a nested "reads" struct does not make any sense. - new_readgroup.update(readgroup["reads"]) - new_sample['readgroups'].append(new_readgroup) - sample_rg_lists.append(new_sample) - sample_mod_config = {"samples": sample_rg_lists} - with open("~{outputJson}", "w") as output_json: - json.dump(sample_mod_config, output_json) - CODE - >>> - - output { - File json = outputJson - } - - runtime { - docker: dockerImage - } -} task StringArrayMd5 { input { @@ -202,7 +161,8 @@ task YamlToJson { input { File yaml String outputJson = basename(yaml, "\.ya?ml$") + ".json" - String dockerImage = "biowdl/pyyaml:3.13-py37-slim" + # biowdl-input-converter has python and pyyaml. + String dockerImage = "quay.io/biocontainers/biowdl-input-converter:0.1.0--py_0" } command { set -e