Skip to content
Snippets Groups Projects
poretools.wdl 1 KiB
Newer Older
task fastq {
Ruben Vorderman's avatar
Ruben Vorderman committed
    Array[File]+ files # Files should exist! Also accepts multiple directories (unlike poretools).
    String outputFile
    String? preCommand
    String? type
    String? start
    String? end
    Int? minLength
    Int? maxLength
    Boolean? highQuality
    Boolean? normalQuality
    String? group
Ruben Vorderman's avatar
Ruben Vorderman committed
    Boolean? gzip = true
    command {
    set -e -o pipefail
    mkdir -p $(dirname ${outputFile})
    ${preCommand}

Ruben Vorderman's avatar
Ruben Vorderman committed
    (
    # Allow for multiple directory input by looping over files
    for file in ${sep=" " files}
    do
        poretools fastq \
        ${"--type " + type} \
        ${"--start " + start } \
        ${"--end " + end } \
        ${"--min-length " + minLength } \
        ${"--max-length " + maxLength } \
        ${true="--high-quality" false="" highQuality} \
        ${true="--normal-quality" false="" normalQuality} \
        ${"--group " + group} \
        $file
    done
    ) ${true="| gzip " false="" gzip}> ${outputFile}
    }

    output {
    File fastq = outputFile
    }
}