Skip to content
Snippets Groups Projects
somaticseq.wdl 8.72 KiB
Newer Older
version 1.0

import "common.wdl" as common

Cats's avatar
Cats committed
task SomaticSeqParallelPaired {
    input {
        String? preCommand
        String? installDir

Cats's avatar
Cats committed
        File? classifierSNV
        File? classifierIndel
        Reference reference
        File? inclusionRegion
        File? exclusionRegion
        IndexedBamFile tumorBam
        IndexedBamFile normalBam
        File? mutect2VCF
        File? varscanSNV
        File? varscanIndel
        File? jsmVCF
        File? somaticsniperVCF
        File? vardictVCF
        File? museVCF
        File? lofreqSNV
        File? lofreqIndel
        File? scalpelVCF
        File? strelkaSNV
        File? strelkaIndel
Cats's avatar
Cats committed

        Int threads = 1
    }

    String toolCommand = if defined(installDir)
        then installDir + "/somaticseq_parallel.py"
        else "/opt/somaticseq/somaticseq_parallel.py"
        # else here points to the location in the docker image

    command {
        set -e -o pipefail
        ~{preCommand}
        ~{toolCommand} \
        ~{"--classifier-snv " + classifierSNV} \
        ~{"--classifier-indel " + classifierIndel} \
        --output-directory ~{outputDir} \
        --genome-reference ~{reference.fasta} \
        ~{"--inclusion-region " + inclusionRegion} \
        ~{"--exclusion-region " + exclusionRegion} \
        --threads ~{threads} \
        paired \
        --tumor-bam-file ~{tumorBam.file} \
        --normal-bam-file ~{normalBam.file} \
        ~{"--mutect2-vcf " + mutect2VCF} \
        ~{"--varscan-snv " + varscanSNV} \
        ~{"--varscan-indel " + varscanIndel} \
        ~{"--jsm-vcf " + jsmVCF} \
        ~{"--somaticsniper-vcf " + somaticsniperVCF} \
        ~{"--vardict-vcf " + vardictVCF} \
        ~{"--muse-vcf " + museVCF} \
        ~{"--lofreq-snv " + lofreqSNV} \
        ~{"--lofreq-indel " + lofreqIndel} \
        ~{"--scalpel-vcf " + scalpelVCF} \
        ~{"--strelka-snv " + strelkaSNV} \
        ~{"--strelka-indel " + strelkaIndel}
    }

    output {
        File indels = outputDir + if defined(classifierIndel)
            then "/SSeq.Classified.sINDEL.vcf"
            else "/Consensus.sINDEL.vcf"
        File snvs = outputDir + if defined(classifierSNV)
            then "/SSeq.Classified.sSNV.vcf"
            else "/Consensus.sSNV.vcf"
        File ensembleIndels = outputDir + "/Ensemble.sINDEL.tsv"
        File ensembleSNV = outputDir + "/Ensemble.sSNV.tsv"
    }

    runtime {
        cpu: threads
        docker: "lethalfang/somaticseq:3.1.0"
    }
}

task SomaticSeqParallelPairedTrain {
    input {
        String? preCommand
        String? installDir

        File truthSNV
        File truthIndel
        String outputDir
        Reference reference
        File? inclusionRegion
        File? exclusionRegion
        IndexedBamFile tumorBam
        IndexedBamFile normalBam
        File? mutect2VCF
        File? varscanSNV
        File? varscanIndel
        File? jsmVCF
        File? somaticsniperVCF
        File? vardictVCF
        File? museVCF
        File? lofreqSNV
        File? lofreqIndel
        File? scalpelVCF
        File? strelkaSNV
        File? strelkaIndel

        Int threads = 1
    }

    String toolCommand = if defined(installDir)
Cats's avatar
Cats committed
        then installDir + "/somaticseq_parallel.py"
        else "/opt/somaticseq/somaticseq_parallel.py"
        # else here points to the location in the docker image

    command {
        set -e -o pipefail
        ~{preCommand}
        ~{toolCommand} \
Cats's avatar
Cats committed
        --somaticseq-train \
        --truth-snv ~{truthSNV} \
        --truth-indel ~{truthIndel} \
        --output-directory ~{outputDir} \
        --genome-reference ~{reference.fasta} \
Cats's avatar
Cats committed
        ~{"--inclusion-region " + inclusionRegion} \
        ~{"--exclusion-region " + exclusionRegion} \
Cats's avatar
Cats committed
        --threads ~{threads} \
        paired \
        --tumor-bam-file ~{tumorBam.file} \
        --normal-bam-file ~{normalBam.file} \
        ~{"--mutect2-vcf " + mutect2VCF} \
        ~{"--varscan-snv " + varscanSNV} \
        ~{"--varscan-indel " + varscanIndel} \
Cats's avatar
Cats committed
        ~{"--jsm-vcf " + jsmVCF} \
        ~{"--somaticsniper-vcf " + somaticsniperVCF} \
        ~{"--vardict-vcf " + vardictVCF} \
        ~{"--muse-vcf " + museVCF} \
        ~{"--lofreq-snv " + lofreqSNV} \
        ~{"--lofreq-indel " + lofreqIndel} \
Cats's avatar
Cats committed
        ~{"--scalpel-vcf " + scalpelVCF} \
        ~{"--strelka-snv " + strelkaSNV} \
        ~{"--strelka-indel " + strelkaIndel}
    }

    output {
        File consensusIndels = outputDir + "/Consensus.sINDEL.vcf"
        File consensusSNV = outputDir + "/Consensus.sSNV.vcf"
Cats's avatar
Cats committed
        File ensembleIndels = outputDir + "/Ensemble.sINDEL.tsv"
        File ensembleSNV = outputDir + "/Ensemble.sSNV.tsv"
Cats's avatar
Cats committed
        File ensembleIndelsClassifier = outputDir + "/Ensemble.sINDEL.tsv.ntChange.Classifier.RData"
        File ensembleSNVClassifier = outputDir + "/Ensemble.sSNV.tsv.ntChange.Classifier.RData"
    }

    runtime {
        cpu: threads
        docker: "lethalfang/somaticseq:3.1.0"
    }
}

task SomaticSeqParallelSingle {
    input {
        String? preCommand
        String? installDir

        File? classifierSNV
        File? classifierIndel
        String outputDir
        Reference reference
        File? inclusionRegion
        File? exclusionRegion
        IndexedBamFile bam
        File? mutect2VCF
        File? varscanVCF
        File? vardictVCF
        File? lofreqVCF
        File? scalpelVCF
        File? strelkaVCF

        Int threads = 1
    }

    String toolCommand = if defined(installDir)
        then installDir + "/somaticseq_parallel.py"
        else "/opt/somaticseq/somaticseq_parallel.py"
        # else here points to the location in the docker image

    command {
        set -e -o pipefail
        ~{preCommand}
        ~{toolCommand} \
        ~{"--classifier-snv " + classifierSNV} \
        ~{"--classifier-indel " + classifierIndel} \
        --output-directory ~{outputDir} \
        --genome-reference ~{reference.fasta} \
        ~{"--inclusion-region " + inclusionRegion} \
        ~{"--exclusion-region " + exclusionRegion} \
        --threads ~{threads} \
        single \
        --bam-file ~{bam.file} \
        ~{"--mutect2-vcf " + mutect2VCF} \
        ~{"--varscan-vcf " + varscanVCF} \
        ~{"--vardict-vcf " + vardictVCF} \
        ~{"--lofreq-vcf " + lofreqVCF} \
        ~{"--scalpel-vcf " + scalpelVCF} \
        ~{"--strelka-vcf " + strelkaVCF}
    }

    output {
        File indels = outputDir + if defined(classifierIndel)
            then "/SSeq.Classified.sINDEL.vcf"
            else "/Consensus.sINDEL.vcf"
        File snvs = outputDir + if defined(classifierSNV)
            then "/SSeq.Classified.sSNV.vcf"
            else "/Consensus.sSNV.vcf"
        File ensembleIndels = outputDir + "/Ensemble.sINDEL.tsv"
        File ensembleSNV = outputDir + "/Ensemble.sSNV.tsv"
    }

    runtime {
        cpu: threads
        docker: "lethalfang/somaticseq:3.1.0"
Cats's avatar
Cats committed
task SomaticSeqParallelSingleTrain {
    input {
        String? preCommand
        String? installDir

Cats's avatar
Cats committed
        File truthSNV
        File truthIndel
        Reference reference
        File? inclusionRegion
        File? exclusionRegion
        IndexedBamFile bam
        File? mutect2VCF
        File? varscanVCF
        File? vardictVCF
        File? lofreqVCF
        File? scalpelVCF
        File? strelkaVCF
Cats's avatar
Cats committed

        Int threads = 1
    }

    String toolCommand = if defined(installDir)
Cats's avatar
Cats committed
        then installDir + "/somaticseq_parallel.py"
        else "/opt/somaticseq/somaticseq_parallel.py"
        # else here points to the location in the docker image

    command {
        set -e -o pipefail
        ~{preCommand}
        ~{toolCommand} \
Cats's avatar
Cats committed
        --somaticseq-train \
        --truth-snv ~{truthSNV} \
        --truth-indel ~{truthIndel} \
        --output-directory ~{outputDir} \
        --genome-reference ~{reference.fasta} \
Cats's avatar
Cats committed
        ~{"--inclusion-region " + inclusionRegion} \
        ~{"--exclusion-region " + exclusionRegion} \
Cats's avatar
Cats committed
        --threads ~{threads} \
        single \
        --bam-file ~{bam.file} \
        ~{"--mutect2-vcf " + mutect2VCF} \
        ~{"--varscan-vcf " + varscanVCF} \
        ~{"--vardict-vcf " + vardictVCF} \
        ~{"--lofreq-vcf " + lofreqVCF} \
        ~{"--scalpel-vcf " + scalpelVCF} \
        ~{"--strelka-vcf " + strelkaVCF}
Cats's avatar
Cats committed

    output {
Cats's avatar
Cats committed
        File consensusIndels = outputDir + "/Consensus.sINDEL.vcf"
        File consensusSNV = outputDir + "/Consensus.sSNV.vcf"
        File ensembleIndels = outputDir + "/Ensemble.sINDEL.tsv"
        File ensembleSNV = outputDir + "/Ensemble.sSNV.tsv"
        File ensembleIndelsClassifier = outputDir + "/Ensemble.sINDEL.tsv.ntChange.Classifier.RData"
        File ensembleSNVClassifier = outputDir + "/Ensemble.sSNV.tsv.ntChange.Classifier.RData"
Cats's avatar
Cats committed
    }
Cats's avatar
Cats committed

    runtime {
        cpu: threads
        docker: "lethalfang/somaticseq:3.1.0"
    }
}