Test-drive the GATK tools and Best Practices pipelines on Terra


Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.

A USER ERROR has occurred: 'CalculateTargetCoverage' is not a valid command.

ekofmanekofman Member, Broadie
edited July 2018 in Ask the GATK team

I'm using GATK 4.0.4.0 and getting this error: A USER ERROR has occurred: 'CalculateTargetCoverage' is not a valid command. Is that command not compatible with this version, which I have been told on this forum is the best recent version to use?

To clarify, I'm trying to run the following WDL, and my main goal is to get the tangent normalization output files, for use in a downstream task (AllelicCNV). if you have suggestions for which tasks I might update with newer versions I in order to generate these tangent normalized files, I would love to hear from you on how to improve this:

workflow GATK4SomaticCnvToolchainCaptureForSamples {
    String sample_name
    File ref_fasta
    File ref_fasta_index
    File ref_fasta_dict
    File input_bam
    File input_bam_idx

    call gatk4CNVproportionalCoverageForCapture  {
        input: sampleName=sample_name,
        refFasta=ref_fasta,
        refFastaIndex=ref_fasta_index,
        refFastaDict=ref_fasta_dict,
        inputBam=input_bam
    }

    call gatk4CNVtangentNormalizationForCapture {
        input:sampleName=sample_name,
        pCovFile=gatk4CNVproportionalCoverageForCapture.pcov
    }

    call performSegmentation {
        input:sampleName=sample_name,
        tangentNormalizedFile=gatk4CNVtangentNormalizationForCapture.tangentNormalized
    }

    call callSegments {
        input:tangentNormalizedFile=gatk4CNVtangentNormalizationForCapture.tangentNormalized,
        segmentFile=performSegmentation.segFile,
        sampleName=sample_name
    }

    call plotSegmentedCopyRatio {
        input:tangentNormalizedFile=gatk4CNVtangentNormalizationForCapture.tangentNormalized,
        segmentFile=performSegmentation.segFile,
        refFastaDict=ref_fasta_dict,
        sampleName=sample_name,
        preTangentNormalizedFile=gatk4CNVtangentNormalizationForCapture.preTangentNormalized
    }
}

task gatk4CNVproportionalCoverageForCapture {
    File refFasta
    File refFastaIndex
    File refFastaDict
    File inputBam
    String sampleName
    Int memoryGb
    Int diskSpaceGb

    command <<<
        java -jar /gatk/gatk.jar CalculateTargetCoverage \
        --output ${sampleName}.pcov \
        --groupBy SAMPLE \
        --transform PCOV \
        --targetInformationColumns FULL \
        --input ${inputBam} \
        --reference ${refFasta} \
        --cohortName "<ALL>"
    >>>

    output {
        File pcov = "${sampleName}.pcov"
    }

    runtime {
        docker: "broadinstitute/gatk:4.0.4.0"
        memory: "${memoryGb} GB"
        cpu: "1"
        disks: "local-disk ${diskSpaceGb} HDD"
    }

}

task gatk4CNVtangentNormalizationForCapture {
    File pCovFile
    File ponFile
    String sampleName
    Int memoryGb
    Int diskSpaceGb

    command <<<
        java -Xmx4g -jar /gatk/gatk.jar NormalizeSomaticReadCounts \
        --input ${pCovFile} \
        --panelOfNormals ${ponFile} \
        --tangentNormalized ${sampleName}.tn.tsv \
        --factorNormalizedOutput ${sampleName}.fnt.tsv \
        --betaHatsOutput ${sampleName}.beta_hats.tsv \
        --preTangentNormalized ${sampleName}.pre_tn.tsv
    >>>

    output {
        File tangentNormalized = "${sampleName}.tn.tsv"
        File factorNormalized = "${sampleName}.fnt.tsv"
        File betaHats = "${sampleName}.beta_hats.tsv"
        File preTangentNormalized = "${sampleName}.pre_tn.tsv"
    }

    runtime {
        docker: "broadinstitute/gatk:4.0.4.0"
        memory: "${memoryGb} GB"
        cpu: "1"
        disks: "local-disk ${diskSpaceGb} HDD"
    }
}

task performSegmentation {
    File tangentNormalizedFile
    String sampleName
    Float alpha
    Float eta
    Float trim
    Float undoPrune
    Int nperm
    Int minWidth
    Int kmax
    Int nmin
    Int undoSD
    Boolean log2Input
    Int memoryGb
    Int diskSpaceGb

    command <<<
        java -Xmx4g -jar /gatk/gatk.jar PerformSegmentation \
        --tangentNormalized ${tangentNormalizedFile} \
        --output ${sampleName}.seg \
        --alpha ${alpha} \
        --nperm ${nperm} \
        --pmethod HYBRID \
        --minWidth ${minWidth} \
        --kmax ${kmax} \
        --nmin ${nmin} \
        --eta ${eta} \
        --trim  ${trim} \
        --undoSplits NONE \
        --undoPrune ${undoPrune} \
        --undoSD ${undoSD} \
        --log2Input ${log2Input}
    >>>

    output {
        File segFile = "${sampleName}.seg"
    }

    runtime {
        docker: "broadinstitute/gatk:4.0.4.0"
        memory: "${memoryGb} GB"
        cpu: "1"
        disks: "local-disk ${diskSpaceGb} HDD"
    }
}

task callSegments {
    File tangentNormalizedFile
    File segmentFile
    String sampleName
    Int memoryGb
    Int diskSpaceGb

    command <<<
        java -jar /gatk/gatk.jar CallSegments \
        --tangentNormalized ${tangentNormalizedFile} \
        --segments ${segmentFile} \
        --output ${sampleName}.called
    >>>


    output {
        File calledSegFile = "${sampleName}.called"
    }

    runtime {
        docker: "broadinstitute/gatk:4.0.4.0"
        memory: "${memoryGb} GB"
        cpu: "1"
        disks: "local-disk ${diskSpaceGb} HDD"
    }
}

task plotSegmentedCopyRatio {
    File tangentNormalizedFile
    File segmentFile
    File refFastaDict
    String sampleName
    File preTangentNormalizedFile
    Boolean log2Input
    Int memoryGb
    Int diskSpaceGb

    command <<<
        mkdir ${sampleName}

        java -jar /gatk/gatk.jar PlotSegmentedCopyRatio \
        --tangentNormalized ${tangentNormalizedFile} \
        --segments ${segmentFile} \
        --output ${sampleName} \
        --outputPrefix ${sampleName} \
        --preTangentNormalized ${preTangentNormalizedFile} \
        --sequenceDictionaryFile ${refFastaDict} \
        --log2Input ${log2Input}
    >>>

    output {
        File before_after_plot = "${sampleName}/${sampleName}_Before_After.png"
        File before_after_CR_lim_4_plot = "${sampleName}/${sampleName}_Before_After_CR_Lim_4.png"
        File FullGenome_plot = "${sampleName}/${sampleName}_FullGenome.png"
    }

    runtime {
        docker: "broadinstitute/gatk:4.0.4.0"
        memory: "${memoryGb} GB"
        cpu: "1"
        disks: "local-disk ${diskSpaceGb} HDD"
    }
}

Best Answer

Answers

Sign In or Register to comment.