Skip to content

Commit

Permalink
Added requester pays option to Mutect2 tasks that access bams (#6879)
Browse files Browse the repository at this point in the history
* Added requester pays option to Mutect2 tasks that access bams

* gnomAD isn't going to be requester pays, so we don't need that arg in
the CreatePanel task
  • Loading branch information
ldgauthier authored Oct 9, 2020
1 parent 7891b69 commit 1621724
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
32 changes: 23 additions & 9 deletions scripts/mutect2_wdl/mutect2.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ workflow Mutect2 {
Boolean? compress_vcfs
File? gga_vcf
File? gga_vcf_idx
String? gcs_project_for_requester_pays

# Funcotator inputs
Boolean? run_funcotator
Expand Down Expand Up @@ -271,7 +272,8 @@ workflow Mutect2 {
gga_vcf_idx = gga_vcf_idx,
gatk_override = gatk_override,
gatk_docker = gatk_docker,
disk_space = m2_per_scatter_size
disk_space = m2_per_scatter_size,
gcs_project_for_requester_pays = gcs_project_for_requester_pays
}
}

Expand Down Expand Up @@ -372,7 +374,8 @@ workflow Mutect2 {
input_vcf = Filter.filtered_vcf,
input_vcf_idx = Filter.filtered_vcf_idx,
runtime_params = standard_runtime,
mem = filter_alignment_artifacts_mem
mem = filter_alignment_artifacts_mem,
gcs_project_for_requester_pays = gcs_project_for_requester_pays
}
}
Expand Down Expand Up @@ -531,6 +534,8 @@ task M2 {

File? gatk_override

String? gcs_project_for_requester_pays

# runtime
String gatk_docker
Int? mem
Expand Down Expand Up @@ -579,11 +584,13 @@ task M2 {
touch f1r2.tar.gz
echo "" > normal_name.txt

gatk --java-options "-Xmx~{command_mem}m" GetSampleName -R ~{ref_fasta} -I ~{tumor_bam} -O tumor_name.txt -encode
gatk --java-options "-Xmx~{command_mem}m" GetSampleName -R ~{ref_fasta} -I ~{tumor_bam} -O tumor_name.txt -encode \
~{"--gcs-project-for-requester-pays " + gcs_project_for_requester_pays}
tumor_command_line="-I ~{tumor_bam} -tumor `cat tumor_name.txt`"

if [[ ! -z "~{normal_bam}" ]]; then
gatk --java-options "-Xmx~{command_mem}m" GetSampleName -R ~{ref_fasta} -I ~{normal_bam} -O normal_name.txt -encode
gatk --java-options "-Xmx~{command_mem}m" GetSampleName -R ~{ref_fasta} -I ~{normal_bam} -O normal_name.txt -encode \
~{"--gcs-project-for-requester-pays " + gcs_project_for_requester_pays}
normal_command_line="-I ~{normal_bam} -normal `cat normal_name.txt`"
fi

Expand All @@ -598,7 +605,8 @@ task M2 {
-O "~{output_vcf}" \
~{true='--bam-output bamout.bam' false='' make_bamout} \
~{true='--f1r2-tar-gz f1r2.tar.gz' false='' run_ob_filter} \
~{m2_extra_args}
~{m2_extra_args} \
~{"--gcs-project-for-requester-pays " + gcs_project_for_requester_pays}

m2_exit_code=$?

Expand All @@ -612,12 +620,14 @@ task M2 {

if [[ ! -z "~{variants_for_contamination}" ]]; then
gatk --java-options "-Xmx~{command_mem}m" GetPileupSummaries -R ~{ref_fasta} -I ~{tumor_bam} ~{"--interval-set-rule INTERSECTION -L " + intervals} \
-V ~{variants_for_contamination} -L ~{variants_for_contamination} -O tumor-pileups.table ~{getpileupsummaries_extra_args}
-V ~{variants_for_contamination} -L ~{variants_for_contamination} -O tumor-pileups.table ~{getpileupsummaries_extra_args} \
~{"--gcs-project-for-requester-pays " + gcs_project_for_requester_pays}


if [[ ! -z "~{normal_bam}" ]]; then
gatk --java-options "-Xmx~{command_mem}m" GetPileupSummaries -R ~{ref_fasta} -I ~{normal_bam} ~{"--interval-set-rule INTERSECTION -L " + intervals} \
-V ~{variants_for_contamination} -L ~{variants_for_contamination} -O normal-pileups.table ~{getpileupsummaries_extra_args}
-V ~{variants_for_contamination} -L ~{variants_for_contamination} -O normal-pileups.table ~{getpileupsummaries_extra_args} \
~{"--gcs-project-for-requester-pays " + gcs_project_for_requester_pays}
fi
fi

Expand Down Expand Up @@ -936,6 +946,7 @@ task FilterAlignmentArtifacts {
Boolean compress
File realignment_index_bundle
String? realignment_extra_args
String? gcs_project_for_requester_pays
Runtime runtime_params
Int mem
}
Expand Down Expand Up @@ -967,7 +978,8 @@ task FilterAlignmentArtifacts {
-I ~{bam} \
--bwa-mem-index-image ~{realignment_index_bundle} \
~{realignment_extra_args} \
-O ~{output_vcf}
-O ~{output_vcf} \
~{"--gcs-project-for-requester-pays " + gcs_project_for_requester_pays}
}

runtime {
Expand Down Expand Up @@ -1014,6 +1026,7 @@ task Funcotate {
File? interval_list

String? extra_args
String? gcs_project_for_requester_pays

# ==============
Runtime runtime_params
Expand Down Expand Up @@ -1095,7 +1108,8 @@ task Funcotate {
~{annotation_over_arg}~{default="" sep=" --annotation-override " annotation_overrides} \
~{excluded_fields_args}~{default="" sep=" --exclude-field " funcotator_excluded_fields} \
~{filter_funcotations_args} \
~{extra_args_arg}
~{extra_args_arg} \
~{"--gcs-project-for-requester-pays " + gcs_project_for_requester_pays}
# Make sure we have a placeholder index for MAF files so this workflow doesn't fail:
if [[ "~{output_format}" == "MAF" ]] ; then
touch ~{output_maf_index}
Expand Down
5 changes: 4 additions & 1 deletion scripts/mutect2_wdl/mutect2_multi_sample.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ workflow Mutect2_Multi {
Boolean? compress_vcfs
Boolean? make_bamout

String? gcs_project_for_requester_pays

# Oncotator inputs
String? sequencing_center
String? sequence_source
Expand Down Expand Up @@ -106,7 +108,8 @@ workflow Mutect2_Multi {
compress_vcfs = compress_vcfs,
gatk_override = gatk_override,
gatk_docker = gatk_docker,
preemptible = preemptible_attempts
preemptible = preemptible_attempts,
gcs_project_for_requester_pays = gcs_project_for_requester_pays
}
}

Expand Down
7 changes: 5 additions & 2 deletions scripts/mutect2_wdl/mutect2_pon.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version 1.0
# scatter_count: number of parallel jobs when scattering over intervals
# pon_name: the resulting panel of normals is {pon_name}.vcf
# m2_extra_args: additional command line parameters for Mutect2. This should not involve --max-mnp-distance,
# which the wdl hard-codes to 0 because GenpmicsDBImport can't handle MNPs
# which the wdl hard-codes to 0 because GenomicsDBImport can't handle MNPs
import "mutect2.wdl" as m2
workflow Mutect2_Panel {
Expand All @@ -31,6 +31,8 @@ workflow Mutect2_Panel {
Int? min_contig_size
Int? create_panel_scatter_count

String? gcs_project_for_requester_pays

# runtime
String gatk_docker
File? gatk_override
Expand Down Expand Up @@ -70,7 +72,8 @@ workflow Mutect2_Panel {
gatk_override = gatk_override,
gatk_docker = gatk_docker,
preemptible = preemptible,
max_retries = max_retries
max_retries = max_retries,
gcs_project_for_requester_pays = gcs_project_for_requester_pays
}
}

Expand Down

0 comments on commit 1621724

Please sign in to comment.