Skip to content
Snippets Groups Projects
strelka.wdl 2.6 KiB
Newer Older
Cats's avatar
Cats committed
version 1.0

task Germline {
    input {
        String? preCommand
        String? installDir
        String runDir
        Array[File]+ bams
        Array[File]+ indexes
        File refFasta
Cats's avatar
Cats committed
        File refFastaIndex
        File? callRegions
        File? callRegionsIndex
        Boolean exome = false
        Boolean rna = false

        Int cores = 1
        Int memory = 4
    }

    String toolCommand = if defined(installDir)
        then installDir + "bin/configureStrelkaGermlineWorkflow.py"
        else "configureStrelkaGermlineWorkflow.py"

    command {
        set -e -o pipefail
        ~{preCommand}
        ~{toolCommand} \
        --bam ~{sep=" --bam " bams} \
        --ref ~{refFasta} \
        --runDir ~{runDir} \
Cats's avatar
Cats committed
        ~{"--callRegions " + callRegions} \
        ~{true="--exome" false="" exome} \
        ~{true="--rna" false="" rna}

        ~{runDir}/runWorkflow.py \
        -m local \
Cats's avatar
Cats committed
        -j ~{cores} \
        -g ~{memory}
    }

    output {
Cats's avatar
Cats committed
        File variants = runDir + "/results/variants/variants.vcf.gz"
        File variantsIndex = runDir + "/results/variants/variants.vcf.gz.tbi"
    }

    runtime {
        cpu: cores
        memory: memory
    }
}


Cats's avatar
Cats committed
task Somatic {
    input {
        String? preCommand
        String? installDir
        String runDir
        File normalBam
        File normalIndex
Cats's avatar
Cats committed
        File tumorBam
        File tumorIndex
Cats's avatar
Cats committed
        File refFasta
Cats's avatar
Cats committed
        File refFastaIndex
        File? callRegions
        File? callRegionsIndex
Cats's avatar
Cats committed
        File? indelCandidates
        File? indelCandidatesIndex
        Boolean exome = false
Cats's avatar
Cats committed

        Int cores = 1
        Int memory = 4
    }

    String toolCommand = if defined(installDir)
        then installDir + "bin/configureStrelkaSomaticWorkflow.py"
        else "configureStrelkaSomaticWorkflow.py"

    command {
        set -e -o pipefail
        ~{preCommand}
        ~{toolCommand} \
        --normalBam ~{normalBam} \
        --tumorBam ~{tumorBam} \
        --ref ~{refFasta} \
        --runDir ~{runDir} \
Cats's avatar
Cats committed
        ~{"--callRegions " + callRegions} \
        ~{"--indelCandidates " + indelCandidates} \
        ~{true="--exome" false="" exome} \
Cats's avatar
Cats committed

        ~{runDir}/runWorkflow.py \
        -m local \
Cats's avatar
Cats committed
        -j ~{cores} \
Cats's avatar
Cats committed
        -g ~{memory}
    }

    output {
        File indelsVcf = runDir + "/results/variants/somatic.indels.vcf.gz"
        File indelsIndex = runDir + "/results/variants/somatic.indels.vcf.gz.tbi"
        File snvVcf = runDir + "/results/variants/somatic.snvs.vcf.gz"
        File snvIndex = runDir + "/results/variants/somatic.snvs.vcf.gz.tbi"
    }

    runtime {
        cpu: cores
        memory: memory
    }
}