Skip to content
Snippets Groups Projects
seqtk.wdl 654 B
Newer Older
Ruben Vorderman's avatar
Ruben Vorderman committed
version 1.0

Ruben Vorderman's avatar
Ruben Vorderman committed
task sample {
Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        File sequenceFile
        String? outFilePath = "subsampledReads.fq.gz"
        String? preCommand
        Int? seed
        Boolean? twoPassMode
        Float? fraction
        Int? number
        Boolean? zip = true
    }
Ruben Vorderman's avatar
Ruben Vorderman committed

    command {
    set -e -o pipefail
Ruben Vorderman's avatar
Ruben Vorderman committed
    ~{'mkdir -p $(dirname ' + outFilePath + ')'}
    ~{preCommand}
Ruben Vorderman's avatar
Ruben Vorderman committed
    seqtk sample \
Ruben Vorderman's avatar
Ruben Vorderman committed
    ~{"-s " + seed} \
    ~{true="-2 " false="" twoPassMode} \
    ~{sequenceFile} \
    ~{number} ~{fraction} \
    ~{true="| gzip" false="" zip} \
    ~{"> " + outFilePath}
Ruben Vorderman's avatar
Ruben Vorderman committed
    }
    output {
Ruben Vorderman's avatar
Ruben Vorderman committed
        File subsampledReads= select_first([outFilePath])