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

Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        File seqFile
        String outdirPath
        String? preCommand
        Boolean? casava
        Boolean? nano
        Boolean? noFilter
        Boolean extract = true
Ruben Vorderman's avatar
Ruben Vorderman committed
        Boolean? nogroup
        Int? minLength
        String? format
Ruben Vorderman's avatar
Ruben Vorderman committed
        File? contaminants
        File? adapters
        File? limits
        Int? kmers
        String? dir
    }
    # Chops of the .gz extension if present.
    String name = basename(sub(seqFile, "\.gz$","")) # The Basename needs to be taken here. Otherwise paths might differ between similar jobs.
    # This regex chops of the extension and replaces it with _fastqc for the reportdir.
    # Just as fastqc does it.
    String reportDir = outdirPath + "/" + sub(name, "\.[^\.]*$", "_fastqc")
Ruben Vorderman's avatar
Ruben Vorderman committed
    command {
        set -e -o pipefail
        ~{preCommand}
        mkdir -p ~{outdirPath}
        fastqc \
        ~{"--outdir " + outdirPath} \
        ~{true="--casava" false="" casava} \
        ~{true="--nano" false="" nano} \
        ~{true="--nofilter" false="" noFilter} \
        ~{true="--extract" false="" extract} \
        ~{true="--nogroup" false="" nogroup} \
        ~{"--min_length " + minLength } \
        ~{"--format " + format} \
        ~{"--threads " + threads} \
        ~{"--contaminants " + contaminants} \
        ~{"--adapters " + adapters} \
        ~{"--limits " + limits} \
        ~{"--kmers " + kmers} \
        ~{"--dir " + dir} \
        ~{seqFile}
Ruben Vorderman's avatar
Ruben Vorderman committed
    }

    output {
        File rawReport = reportDir + "/fastqc_data.txt"
Ruben Vorderman's avatar
Ruben Vorderman committed
        File htmlReport = reportDir + "/fastqc_report.html"
Ruben Vorderman's avatar
Ruben Vorderman committed
        File summary = reportDir + "/summary.txt"
Ruben Vorderman's avatar
Ruben Vorderman committed
        Array[File] images = glob(reportDir + "/Images/*.png")
Ruben Vorderman's avatar
Ruben Vorderman committed
    }

    runtime {
task GetConfiguration {
Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        String? preCommand
        String fastqcDirFile = "fastqcDir.txt"
Ruben Vorderman's avatar
Ruben Vorderman committed
    }
Ruben Vorderman's avatar
Ruben Vorderman committed
    command {
        set -e -o pipefail
Ruben Vorderman's avatar
Ruben Vorderman committed
        ~{preCommand}
        echo $(dirname $(readlink -f $(which fastqc))) > ~{fastqcDirFile}
Cats's avatar
Cats committed

Ruben Vorderman's avatar
Ruben Vorderman committed
    output {
        String fastqcDir = read_string(fastqcDirFile)
        File adapterList = fastqcDir + "/Configuration/adapter_list.txt"
        File contaminantList = fastqcDir + "/Configuration/contaminant_list.txt"
        File limits = fastqcDir + "/Configuration/limits.txt"
    }
Cats's avatar
Cats committed

    runtime {
        memory: 1
    }