Skip to content
Snippets Groups Projects
seqstat.wdl 1 KiB
Newer Older
Ruben Vorderman's avatar
Ruben Vorderman committed
version 1.0

# Copyright Sequencing Analysis Support Core - Leiden University Medical Center 2018

Peter van 't Hof's avatar
Peter van 't Hof committed
import "../common.wdl" as common

Ruben Vorderman's avatar
Ruben Vorderman committed
task Generate {
    input {
        String? preCommand
        File? toolJar
ffinfo's avatar
ffinfo committed
        FastqPair fastq
Ruben Vorderman's avatar
Ruben Vorderman committed
        String outputFile
        String sample
        String library
        String readgroup
Ruben Vorderman's avatar
Ruben Vorderman committed

        Int memory = 4
Cats's avatar
Cats committed
        Float memoryMultiplier = 2.5
Ruben Vorderman's avatar
Ruben Vorderman committed
    }

    String toolCommand = if defined(toolJar)
        then "java -Xmx" + memory + "G -jar " + toolJar
        else "biopet-seqstat -Xmx" + memory + "G"

    command {
        set -e -o pipefail
        ~{preCommand}
        mkdir -p $(dirname ~{outputFile})
Ruben Vorderman's avatar
Ruben Vorderman committed
        ~{toolCommand} Generate \
ffinfo's avatar
ffinfo committed
        --fastqR1 ~{fastq.R1} \
        ~{"--fastqR2 " + fastq.R2} \
Ruben Vorderman's avatar
Ruben Vorderman committed
        --output ~{outputFile} \
        ~{"--sample " + sample} \
        ~{"--library " + library } \
        ~{"--readgroup " + readgroup }
    }

    output {
        File json = outputFile
    }

    runtime {
        memory: ceil(memory * memoryMultiplier)
    }
}