Skip to content

Commit

Permalink
Merge pull request #133 from wustl-oncology/varscan-somatic-compute
Browse files Browse the repository at this point in the history
moved the set -o lines under the ACCESS_TOKEN block
  • Loading branch information
malachig authored Nov 14, 2023
2 parents 339efda + beb37fd commit 8695921
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions definitions/tools/varscan_somatic.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,27 @@ task varscanSomatic {
runtime {
preemptible: 1
maxRetries: 2

memory: "12GB"
cpu: 2
docker: "mgibio/varscan-cwl:v2.4.2-samtools1.16.1"
disks: "local-disk ~{space_needed_gb} HDD"
}

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.
export GCS_OAUTH_TOKEN=$(echo "$ACCESS_TOKEN" | cut -d ' ' -f 2 )
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" \
Expand Down

0 comments on commit 8695921

Please sign in to comment.