diff --git a/definitions/tools/varscan_somatic.wdl b/definitions/tools/varscan_somatic.wdl index 9bf0ece..a89a0bc 100644 --- a/definitions/tools/varscan_somatic.wdl +++ b/definitions/tools/varscan_somatic.wdl @@ -25,6 +25,7 @@ task varscanSomatic { runtime { preemptible: 1 maxRetries: 2 + memory: "12GB" cpu: 2 docker: "mgibio/varscan-cwl:v2.4.2-samtools1.16.1" @@ -32,10 +33,7 @@ task varscanSomatic { } command <<< - set -o errexit - set -o nounset - set -o pipefail - + ACCESS_TOKEN=$(wget -O - --header "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token?alt=text 2> /dev/null | grep access_token) if [[ "$ACCESS_TOKEN" == "access_token"* ]]; then # When the BAMs aren't localized in GCP, samtools needs this token to access them via gs:// URLs. @@ -43,6 +41,11 @@ task varscanSomatic { echo "got token" ${GCS_OAUTH_TOKEN:0:5} fi + set -o errexit + set -o nounset + set -o pipefail + + /opt/samtools/bin/samtools mpileup --no-baq ~{if defined(roi_bed) then "-l ~{roi_bed}" else ""} -f "~{reference}" "~{normal_bam}" "~{tumor_bam}" | \ java -jar /opt/varscan/VarScan.jar somatic /dev/stdin \ "output" \