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

task VarDict {
    input {
        String? installDir

        String tumorSampleName
Cats's avatar
Cats committed
        File tumorBam
        File tumorIndex
        String? normalSampleName
        File? normalBam
        File? normalIndex
Cats's avatar
Cats committed
        File refFasta
        File bedFile
        String outputVcf

        Int chromosomeColumn = 1
        Int startColumn = 2
        Int endColumn = 3
        Int geneColumn = 4

        String? preCommand
    }

    String toolCommand = if defined(installDir)
        then installDir + "/VarDict"
        else "vardict"

    command {
        set -e -o pipefail
        ~{preCommand}
        ~{toolCommand} \
        -G ~{refFasta} \
        -N ~{tumorSampleName} \
        -b "~{tumorBam}~{"|" + normalBam}" \
Cats's avatar
Cats committed
        -c ~{chromosomeColumn} \
        -S ~{startColumn} \
        -E ~{endColumn} \
        -g ~{geneColumn} \
        ~{bedFile} | \
        ~{installDir + "/"}~{true="testsomatic.R" false="teststrandbias.R" defined(normalBam)} | \
        ~{installDir + "/"}~{true="var2vcf_paired.pl"
            false="var2vcf_valid.pl" defined(normalBam)} \
        -N "~{tumorSampleName}~{"|" + normalSampleName}" \
        ~{true="" false="-E" defined(normalBam)} | \
        bgzip -c > ~{outputVcf}
Cats's avatar
Cats committed
    }

    output {
        File vcfFile = outputVcf
    }