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

Ruben Vorderman's avatar
Ruben Vorderman committed
task BaseCounter {
Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        String? preCommand
        File? toolJar
        File bam
        File bamIndex
        File refFlat
        String outputDir
        String prefix

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

    String toolCommand = if defined(toolJar)
Cats's avatar
Cats committed
        then "java -Xmx" + memory + "G -jar " +toolJar
        else "biopet-basecounter -Xmx" + memory + "G"
Pappas's avatar
Pappas committed

Ruben Vorderman's avatar
Ruben Vorderman committed
    command {
        set -e -o pipefail
        mkdir -p ~{outputDir}
        ~{preCommand}
        ~{toolCommand} \
        -b ~{bam} \
        -r ~{refFlat} \
        -o ~{outputDir} \
        -p ~{prefix}
Ruben Vorderman's avatar
Ruben Vorderman committed
    }

    output {
        File exonAntisense = outputDir + "/" + prefix + ".base.exon.antisense.counts"
        File exon = outputDir + "/" + prefix + ".base.exon.counts"
        File exonMergeAntisense = outputDir + "/" + prefix + ".base.exon.merge.antisense.counts"
        File exonMerge = outputDir + "/" + prefix + ".base.exon.merge.counts"
        File exonMergeSense = outputDir + "/" + prefix + ".base.exon.merge.sense.counts"
        File exonSense = outputDir + "/" + prefix + ".base.exon.sense.counts"
        File geneAntisense = outputDir + "/" + prefix + ".base.gene.antisense.counts"
        File gene = outputDir + "/" + prefix + ".base.gene.counts"
        File geneExonicAntisense = outputDir + "/" + prefix + ".base.gene.exonic.antisense.counts"
        File geneExonic = outputDir + "/" + prefix + ".base.gene.exonic.counts"
        File geneExonicSense = outputDir + "/" + prefix + ".base.gene.exonic.sense.counts"
        File geneIntronicAntisense = outputDir + "/" + prefix + ".base.gene.intronic.antisense.counts"
        File geneIntronic = outputDir + "/" + prefix + ".base.gene.intronic.counts"
        File geneIntronicSense = outputDir + "/" + prefix + ".base.gene.intronic.sense.counts"
        File geneSense = outputDir + "/" + prefix + ".base.gene.sense.counts"
        File intronAntisense = outputDir + "/" + prefix + ".base.intron.antisense.counts"
        File intron = outputDir + "/" + prefix + ".base.intron.counts"
        File intronMergeAntisense = outputDir + "/" + prefix + ".base.intron.merge.antisense.counts"
        File intronMerge = outputDir + "/" + prefix + ".base.intron.merge.counts"
        File intronMergeSense = outputDir + "/" + prefix + ".base.intron.merge.sense.counts"
        File intronSense = outputDir + "/" + prefix + ".base.intron.sense.counts"
        File metaExonsNonStranded = outputDir + "/" + prefix + ".base.metaexons.non_stranded.counts"
        File metaExonsStrandedAntisense = outputDir + "/" + prefix + ".base.metaexons.stranded.antisense.counts"
        File metaExonsStranded = outputDir + "/" + prefix + ".base.metaexons.stranded.counts"
        File metaExonsStrandedSense = outputDir + "/" + prefix + ".base.metaexons.stranded.sense.counts"
        File transcriptAntisense = outputDir + "/" + prefix + ".base.transcript.antisense.counts"
        File transcript = outputDir + "/" + prefix + ".base.transcript.counts"
        File transcriptExonicAntisense = outputDir + "/" + prefix + ".base.transcript.exonic.antisense.counts"
        File transcriptExonic = outputDir + "/" + prefix + ".base.transcript.exonic.counts"
        File transcriptExonicSense = outputDir + "/" + prefix + ".base.transcript.exonic.sense.counts"
        File transcriptIntronicAntisense = outputDir + "/" + prefix + ".base.transcript.intronic.antisense.counts"
        File transcriptIntronic = outputDir + "/" + prefix + ".base.transcript.intronic.counts"
        File transcriptIntronicSense = outputDir + "/" + prefix + ".base.transcript.intronic.sense.counts"
        File transcriptSense = outputDir + "/" + prefix + ".base.transcript.sense.counts"
    }

    runtime {
Cats's avatar
Cats committed
        memory: ceil(memory * memoryMultiplier)
task ExtractAdaptersFastqc {
Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        File? toolJar
        String? preCommand
        File inputFile
        String outputDir
Cats's avatar
Cats committed
        String adapterOutputFilePath = outputDir + "/adapter.list"
        String contamsOutputFilePath = outputDir + "/contaminations.list"
Ruben Vorderman's avatar
Ruben Vorderman committed
        Boolean? skipContams
        File? knownContamFile
        File? knownAdapterFile
        Float? adapterCutoff
        Boolean? outputAsFasta

Cats's avatar
Cats committed
        Int memory = 4
        Float memoryMultiplier = 2.5
Ruben Vorderman's avatar
Ruben Vorderman committed
    }
    String toolCommand = if defined(toolJar)
Cats's avatar
Cats committed
        then "java -Xmx" + memory + "G -jar " +toolJar
        else "biopet-extractadaptersfastqc -Xmx" + memory + "G"
Cats's avatar
Cats committed
        set -e
        ~{preCommand}
        mkdir -p ~{outputDir}
        ~{toolCommand} \
        --inputFile ~{inputFile} \
        ~{"--adapterOutputFile " + adapterOutputFilePath } \
        ~{"--contamsOutputFile " + contamsOutputFilePath } \
        ~{"--knownContamFile " + knownContamFile} \
        ~{"--knownAdapterFile " + knownAdapterFile} \
        ~{"--adapterCutoff " + adapterCutoff} \
        ~{true="--skipContams" false="" skipContams} \
        ~{true="--outputAsFasta" false="" outputAsFasta}
Cats's avatar
Cats committed
        File adapterOutputFile = adapterOutputFilePath
        File contamsOutputFile = contamsOutputFilePath
        Array[String] adapterList = read_lines(adapterOutputFilePath)
        Array[String] contamsList = read_lines(contamsOutputFilePath)
Cats's avatar
Cats committed
        memory: ceil(memory * memoryMultiplier)
Peter van 't Hof's avatar
Peter van 't Hof committed
task FastqSplitter {
Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        String? preCommand
        File inputFastq
Cats's avatar
Cats committed
        Array[String]+ outputPaths
Ruben Vorderman's avatar
Ruben Vorderman committed
        File? toolJar

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

    String toolCommand = if defined(toolJar)
Cats's avatar
Cats committed
        then "java -Xmx" + memory + "G -jar " +toolJar
        else "biopet-fastqsplitter -Xmx" + memory + "G"
Peter van 't Hof's avatar
Peter van 't Hof committed

    command {
Peter van 't Hof's avatar
Peter van 't Hof committed
        set -e -o pipefail
        ~{preCommand}
        mkdir -p $(dirname ~{sep=') $(dirname ' outputPaths})
        if [ ~{length(outputPaths)} -gt 1 ]; then
            ~{toolCommand} \
            -I ~{inputFastq} \
            -o ~{sep=' -o ' outputPaths}
Cats's avatar
Cats committed
          else
            ln -sf ~{inputFastq} ~{outputPaths[0]}
Cats's avatar
Cats committed
          fi
Peter van 't Hof's avatar
Peter van 't Hof committed
    }

    output {
Cats's avatar
Cats committed
        Array[File] chunks = outputPaths
Peter van 't Hof's avatar
Peter van 't Hof committed
    }
Cats's avatar
Cats committed
        memory: ceil(memory * memoryMultiplier, 2.5)
Peter van 't Hof's avatar
Peter van 't Hof committed
}

Ruben Vorderman's avatar
Ruben Vorderman committed
task FastqSync {
Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        String? preCommand
        File ref1
        File ref2
        File in1
        File in2
        String out1path
        String out2path
        File? toolJar

Cats's avatar
Cats committed
        Int memory = 4
        Float memoryMultiplier = 2.5
Ruben Vorderman's avatar
Ruben Vorderman committed
    }
    String toolCommand = if defined(toolJar)
Cats's avatar
Cats committed
        then "java -Xmx" + memory + "G -jar " +toolJar
        else "biopet-fastqsync -Xmx" + memory + "G"
Pappas's avatar
Pappas committed

Peter van 't Hof's avatar
Peter van 't Hof committed
    command {
Peter van 't Hof's avatar
Peter van 't Hof committed
        set -e -o pipefail
        ~{preCommand}
        mkdir -p $(dirname ~{out1path}) $(dirname ~{out2path})
        ~{toolCommand} \
        --in1 ~{in1} \
        --in2 ~{in2} \
        --ref1 ~{ref1} \
        --ref2 ~{ref2} \
        --out1 ~{out1path} \
        --out2 ~{out2path}
Peter van 't Hof's avatar
Peter van 't Hof committed
    }
Pappas's avatar
Pappas committed

Peter van 't Hof's avatar
Peter van 't Hof committed
    output {
Ruben Vorderman's avatar
Ruben Vorderman committed
        File out1 = out1path
        File out2 = out2path
Cats's avatar
Cats committed
    }
Cats's avatar
Cats committed
        memory: ceil(memory * memoryMultiplier)
Peter van 't Hof's avatar
Peter van 't Hof committed
}

task SampleConfig {
Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        File? toolJar
        String? preCommand
        Array[File]+ inputFiles
        String keyFilePath
        String? sample
        String? library
        String? readgroup
        String? jsonOutputPath
        String? tsvOutputPath
Cats's avatar
Cats committed
        Int memory = 4
        Float memoryMultiplier = 2.0
    String toolCommand = if defined(toolJar)
Cats's avatar
Cats committed
        then "java -Xmx" + memory + "G -jar " +toolJar
        else "biopet-sampleconfig -Xmx" + memory + "G"
Peter van 't Hof's avatar
Peter van 't Hof committed
    command {
Peter van 't Hof's avatar
Peter van 't Hof committed
        set -e -o pipefail
        ~{preCommand}
        mkdir -p . ~{"$(dirname " + jsonOutputPath + ")"} ~{"$(dirname " + tsvOutputPath + ")"}
        ~{toolCommand} \
        -i ~{sep="-i " inputFiles} \
        ~{"--sample " + sample} \
        ~{"--library " + library} \
        ~{"--readgroup " + readgroup} \
        ~{"--jsonOutput " + jsonOutputPath} \
        ~{"--tsvOutput " + tsvOutputPath} \
        > ~{keyFilePath}
Peter van 't Hof's avatar
Peter van 't Hof committed
    }

    output {
Cats's avatar
Cats committed
        File keysFile = keyFilePath
Peter van 't Hof's avatar
Peter van 't Hof committed
        File? jsonOutput = jsonOutputPath
        File? tsvOutput = tsvOutputPath
    }
Cats's avatar
Cats committed

    runtime {
Cats's avatar
Cats committed
        memory: ceil(memory * memoryMultiplier)
Cats's avatar
Cats committed
    }
Peter van 't Hof's avatar
Peter van 't Hof committed
}
Cats's avatar
Cats committed

Ruben Vorderman's avatar
Ruben Vorderman committed
task ScatterRegions {
Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        String? preCommand
        File refFasta
        File refDict
        String outputDirPath
        File? toolJar
        Int? scatterSize
        File? regions

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

    String toolCommand = if defined(toolJar)
Cats's avatar
Cats committed
        then "java -Xmx" + memory + "G -jar " +toolJar
        else "biopet-scatterregions -Xmx" + memory + "G"
Cats's avatar
Cats committed
    command {
        set -e -o pipefail
        ~{preCommand}
        mkdir -p ~{outputDirPath}
        ~{toolCommand} \
          -R ~{refFasta} \
          -o ~{outputDirPath} \
          ~{"-s " + scatterSize} \
          ~{"-L " + regions}
Cats's avatar
Cats committed
    }

    output {
Ruben Vorderman's avatar
Ruben Vorderman committed
        Array[File] scatters = glob(outputDirPath + "/scatter-*.bed")
Cats's avatar
Cats committed
    }
Cats's avatar
Cats committed

    runtime {
Cats's avatar
Cats committed
        memory: ceil(memory * memoryMultiplier)
Cats's avatar
Cats committed
    }
Cats's avatar
Cats committed
}
Ruben Vorderman's avatar
Ruben Vorderman committed
task Seqstat {
Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        String? preCommand
        File? toolJar
        File fastq
        String outputFile
Cats's avatar
Cats committed
        Int memory = 4
        Float memoryMultiplier = 2.0
    }
Ruben Vorderman's avatar
Ruben Vorderman committed

    String toolCommand = if defined(toolJar)
Cats's avatar
Cats committed
        then "java -Xmx" + memory + "G -jar " + toolJar
        else "biopet-seqstat -Xmx" + memory + "G"
Ruben Vorderman's avatar
Ruben Vorderman committed
    command {
        set -e -o pipefail
        ~{preCommand}
        mkdir -p $(dirname ~{outputFile})
        ~{toolCommand} \
        --fastq ~{fastq} \
        --output ~{outputFile}
Ruben Vorderman's avatar
Ruben Vorderman committed
    }
Ruben Vorderman's avatar
Ruben Vorderman committed
    output {
Ruben Vorderman's avatar
Ruben Vorderman committed
        File json = outputFile
Ruben Vorderman's avatar
Ruben Vorderman committed
    }
Cats's avatar
Cats committed
        memory: ceil(memory * memoryMultiplier)
    }
}

task ValidateAnnotation {
Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        String? preCommand
        File? toolJar
        File? refRefflat
        File? gtfFile
        File refFasta
        File refFastaIndex
        File refDict

Cats's avatar
Cats committed
        Int memory = 4
        Float memoryMultiplier = 2.0
Ruben Vorderman's avatar
Ruben Vorderman committed
    }
    String toolCommand = if defined(toolJar)
Cats's avatar
Cats committed
        then "java -Xmx" + memory + "G -jar " + toolJar
        else "biopet-validateannotation -Xmx" + memory + "G"

    command {
        set -e -o pipefail
        ~{preCommand}
        ~{toolCommand} \
        ~{"-r " + refRefflat} \
        ~{"-g " + gtfFile} \
        -R ~{refFasta}
    }

    output {
        File stderr = stderr()
    }

Ruben Vorderman's avatar
Ruben Vorderman committed
    runtime {
Cats's avatar
Cats committed
        memory: ceil(memory * memoryMultiplier)
Ruben Vorderman's avatar
Ruben Vorderman committed
    }
Ruben Vorderman's avatar
Ruben Vorderman committed
task ValidateFastq {
Ruben Vorderman's avatar
Ruben Vorderman committed
    input {
        String? preCommand
        File? toolJar
        File fastq1
        File? fastq2

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

    String toolCommand = if defined(toolJar)
Cats's avatar
Cats committed
        then "java -Xmx" + memory + "G -jar " + toolJar
        else "biopet-validatefastq -Xmx" + memory + "G"
Ruben Vorderman's avatar
Ruben Vorderman committed

    command {
        set -e -o pipefail
        ~{preCommand}
        ~{toolCommand} \
        --fastq1 ~{fastq1} \
        ~{"--fastq2 " + fastq2}
Ruben Vorderman's avatar
Ruben Vorderman committed
    }
Ruben Vorderman's avatar
Ruben Vorderman committed
    output {
        File stderr = stderr()
    }
Cats's avatar
Cats committed
        memory: ceil(memory * memoryMultiplier)
Cats's avatar
Cats committed
task ValidateVcf {
Cats's avatar
Cats committed
    input {
Ruben Vorderman's avatar
Ruben Vorderman committed
        String? preCommand
        File? toolJar
        File vcfFile
        File vcfIndex
Ruben Vorderman's avatar
Ruben Vorderman committed
        File refFasta
        File refFastaIndex
        File refDict
Cats's avatar
Cats committed
        Int memory = 4
        Float memoryMultiplier = 2.0
Ruben Vorderman's avatar
Ruben Vorderman committed
    }
    String toolCommand = if defined(toolJar)
Cats's avatar
Cats committed
        then "java -Xmx" + memory + "G -jar " + toolJar
        else "biopet-validatevcf -Xmx" + memory + "G"

    command {
        set -e -o pipefail
        ~{preCommand}
        ~{toolCommand} \
        -i ~{vcfFile} \
        -R ~{refFasta}
    }

    output {
        File stderr = stderr()
    }

    runtime {
Cats's avatar
Cats committed
        memory: ceil(memory * memoryMultiplier)