Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Commit

Permalink
Wdlupdate (#8)
Browse files Browse the repository at this point in the history
* updated wdl to gatk4.0.5.0 release
* realignment_index_bundle variable to json
  • Loading branch information
bshifaw committed Jun 15, 2018
1 parent ebb6dde commit 0ab43b7
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 25 deletions.
2 changes: 1 addition & 1 deletion mutect2-normal-normal.inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"Mutect2NormalNormal.scatter_count": "10",

"##_COMMENT4": "Docker",
"Mutect2NormalNormal.gatk_docker": "broadinstitute/gatk:4.0.4.0"
"Mutect2NormalNormal.gatk_docker": "broadinstitute/gatk:4.0.5.0"
}

11 changes: 5 additions & 6 deletions mutect2-normal-normal.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ workflow Mutect2NormalNormal {
Array[File] bams
Array[File] bais
File? pon
File? pon_index
File? gnomad
File? gnomad_index
File? variants_for_contamination
File? variants_for_contamination_index
Boolean? run_orientation_bias_filter
Array[String]? artifact_modes
File? realignment_index_bundle
String? realignment_extra_args
String? m2_extra_args
String? m2_extra_filtering_args
Boolean? make_bamout
Expand Down Expand Up @@ -68,15 +67,14 @@ workflow Mutect2NormalNormal {
normal_bam = normal_bam,
normal_bai = normal_bai,
pon = pon,
pon_index = pon_index,
scatter_count = scatter_count,
gnomad = gnomad,
gnomad_index = gnomad_index,
variants_for_contamination = variants_for_contamination,
variants_for_contamination_index = variants_for_contamination_index,
run_orientation_bias_filter = run_orientation_bias_filter,
preemptible_attempts = preemptible_attempts,
artifact_modes = artifact_modes,
realignment_index_bundle = realignment_index_bundle,
realignment_extra_args = realignment_extra_args,
m2_extra_args = m2_extra_args,
m2_extra_filtering_args = m2_extra_filtering_args,
gatk_override = gatk_override,
Expand Down Expand Up @@ -155,6 +153,7 @@ task CountFalsePositives {

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
memory: "5 GB"
disks: "local-disk " + 500 + " HDD"
}
Expand Down
3 changes: 2 additions & 1 deletion mutect2.exome.inputs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"##_COMMENT1": "Runtime",
"##Mutect2.oncotator_docker": "(optional) String?",
"Mutect2.gatk_docker": "broadinstitute/gatk:4.0.4.0",
"Mutect2.gatk_docker": "broadinstitute/gatk:4.0.5.0",

"##_COMMENT2": "Workflow options",
"Mutect2.intervals": "gs://gatk-best-practices/somatic-b37/whole_exome_agilent_1.1_refseq_plus_3_boosters.Homo_sapiens_assembly19.baits.interval_list",
Expand All @@ -28,6 +28,7 @@
"Mutect2.gnomad_index": "gs://gatk-best-practices/somatic-b37/af-only-gnomad.raw.sites.vcf.idx",
"Mutect2.variants_for_contamination": "gs://gatk-best-practices/somatic-b37/small_exac_common_3.vcf",
"Mutect2.variants_for_contamination_index": "gs://gatk-best-practices/somatic-b37/small_exac_common_3.vcf.idx",
"##Mutect2.realignment_index_bundle": "File? (optional)",

"##_COMMENT5": "Secondary resources",
"Mutect2.onco_ds_tar_gz": "gs://gatk-best-practices/somatic-b37/oncotator_v1_ds_April052016.tar.gz",
Expand Down
111 changes: 101 additions & 10 deletions mutect2.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
## onco_ds_tar_gz, default_config_file: Oncotator datasources and config file
## sequencing_center, sequence_source: metadata for Oncotator
## filter_oncotator_maf: Whether the MAF generated by oncotator should have the filtered variants removed. Default: true
## realignment_index_bundle: resource for FilterAlignmentArtifacts, which runs if and only if it is specified. Generated by BwaMemIndexImageCreator.
##
## Outputs :
## - One VCF file and its index with primary filtering applied; secondary filtering and functional annotation if requested; a bamout.bam
Expand Down Expand Up @@ -73,6 +74,8 @@ workflow Mutect2 {
File? gnomad_index
File? variants_for_contamination
File? variants_for_contamination_index
File? realignment_index_bundle
String? realignment_extra_args
Boolean? run_orientation_bias_filter
Boolean run_ob_filter = select_first([run_orientation_bias_filter, false])
Array[String]? artifact_modes
Expand Down Expand Up @@ -115,6 +118,8 @@ workflow Mutect2 {
String oncotator_docker_or_default = select_first([oncotator_docker, "broadinstitute/oncotator:1.9.9.0"])
Boolean? filter_oncotator_maf
Boolean filter_oncotator_maf_or_default = select_first([filter_oncotator_maf, true])
Boolean? filter_funcotations
Boolean filter_funcotations_or_default = select_first([filter_funcotations, true])
String? oncotator_extra_args

Int? preemptible_attempts
Expand Down Expand Up @@ -302,8 +307,26 @@ workflow Mutect2 {
}
}

if (defined(realignment_index_bundle)) {
File realignment_filter_input = select_first([FilterByOrientationBias.filtered_vcf, Filter.filtered_vcf])
File realignment_filter_input_idx = select_first([FilterByOrientationBias.filtered_vcf_index, Filter.filtered_vcf_index])
call FilterAlignmentArtifacts {
input:
gatk_override = gatk_override,
bam = tumor_bam,
bai = tumor_bai,
realignment_index_bundle = select_first([realignment_index_bundle]),
realignment_extra_args = realignment_extra_args,
gatk_docker = gatk_docker,
compress = compress,
output_name = filtered_name,
input_vcf = realignment_filter_input,
input_vcf_idx = realignment_filter_input_idx
}
}

if (run_oncotator_or_default) {
File oncotate_vcf_input = select_first([FilterByOrientationBias.filtered_vcf, Filter.filtered_vcf])
File oncotate_vcf_input = select_first([FilterAlignmentArtifacts.filtered_vcf, FilterByOrientationBias.filtered_vcf, Filter.filtered_vcf])
call oncotate_m2 {
input:
m2_vcf = oncotate_vcf_input,
Expand All @@ -323,8 +346,8 @@ workflow Mutect2 {
}

if (run_funcotator_or_default) {
File funcotate_vcf_input = select_first([FilterByOrientationBias.filtered_vcf, Filter.filtered_vcf])
File funcotate_vcf_input_index = select_first([FilterByOrientationBias.filtered_vcf_index, Filter.filtered_vcf_index])
File funcotate_vcf_input = select_first([FilterAlignmentArtifacts.filtered_vcf, FilterByOrientationBias.filtered_vcf, Filter.filtered_vcf])
File funcotate_vcf_input_index = select_first([FilterAlignmentArtifacts.filtered_vcf_index, FilterByOrientationBias.filtered_vcf_index, Filter.filtered_vcf_index])
call Funcotate {
input:
m2_vcf = funcotate_vcf_input,
Expand All @@ -341,15 +364,16 @@ workflow Mutect2 {
annotation_defaults = annotation_defaults,
annotation_overrides = annotation_overrides,
gatk_docker = gatk_docker,
gatk_override = gatk_override
gatk_override = gatk_override,
filter_funcotations = filter_funcotations_or_default
}
}

output {
File unfiltered_vcf = MergeVCFs.merged_vcf
File unfiltered_vcf_index = MergeVCFs.merged_vcf_index
File filtered_vcf = select_first([FilterByOrientationBias.filtered_vcf, Filter.filtered_vcf])
File filtered_vcf_index = select_first([FilterByOrientationBias.filtered_vcf_index, Filter.filtered_vcf_index])
File filtered_vcf = select_first([FilterAlignmentArtifacts.filtered_vcf, FilterByOrientationBias.filtered_vcf, Filter.filtered_vcf])
File filtered_vcf_index = select_first([FilterAlignmentArtifacts.filtered_vcf_index, FilterByOrientationBias.filtered_vcf_index, Filter.filtered_vcf_index])
File? contamination_table = CalculateContamination.contamination_table

File? oncotated_m2_maf = oncotate_m2.oncotated_m2_maf
Expand All @@ -358,6 +382,7 @@ workflow Mutect2 {
File? preadapter_detail_metrics = CollectSequencingArtifactMetrics.pre_adapter_metrics
File? bamout = MergeBamOuts.merged_bam_out
File? bamout_index = MergeBamOuts.merged_bam_out_index
File? maf_segments = CalculateContamination.maf_segments
}
}

Expand Down Expand Up @@ -400,6 +425,7 @@ task SplitIntervals {

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
memory: machine_mem + " MB"
disks: "local-disk " + select_first([disk_space, 100]) + if use_ssd then " SSD" else " HDD"
preemptible: select_first([preemptible_attempts, 10])
Expand Down Expand Up @@ -481,6 +507,7 @@ task M2 {

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
memory: machine_mem + " MB"
disks: "local-disk " + select_first([disk_space, 100]) + if use_ssd then " SSD" else " HDD"
preemptible: select_first([preemptible_attempts, 10])
Expand Down Expand Up @@ -529,6 +556,7 @@ task MergeVCFs {

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
memory: machine_mem + " MB"
disks: "local-disk " + select_first([disk_space, 100]) + if use_ssd then " SSD" else " HDD"
preemptible: select_first([preemptible_attempts, 10])
Expand Down Expand Up @@ -576,12 +604,13 @@ task MergeBamOuts {

gatk --java-options "-Xmx${command_mem}m" SortSam -I unsorted.out.bam \
-O ${output_vcf_name}.out.bam \
--SORT_ORDER coordinate
gatk --java-options "-Xmx${command_mem}m" BuildBamIndex -I ${output_vcf_name}.out.bam
--SORT_ORDER coordinate -VALIDATION_STRINGENCY LENIENT
gatk --java-options "-Xmx${command_mem}m" BuildBamIndex -I ${output_vcf_name}.out.bam -VALIDATION_STRINGENCY LENIENT
>>>

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
memory: machine_mem + " MB"
disks: "local-disk " + select_first([disk_space, 100]) + if use_ssd then " SSD" else " HDD"
preemptible: select_first([preemptible_attempts, 10])
Expand Down Expand Up @@ -624,6 +653,7 @@ task CollectSequencingArtifactMetrics {

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
memory: machine_mem + " MB"
disks: "local-disk " + select_first([disk_space, 100]) + if use_ssd then " SSD" else " HDD"
preemptible: select_first([preemptible_attempts, 10])
Expand Down Expand Up @@ -676,6 +706,7 @@ task CalculateContamination {

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
memory: command_mem + " MB"
disks: "local-disk " + select_first([disk_space, 100]) + " HDD"
preemptible: select_first([preemptible_attempts, 10])
Expand Down Expand Up @@ -729,6 +760,7 @@ task Filter {

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
memory: machine_mem + " MB"
disks: "local-disk " + select_first([disk_space, 100]) + if use_ssd then " SSD" else " HDD"
preemptible: select_first([preemptible_attempts, 10])
Expand Down Expand Up @@ -779,6 +811,61 @@ task FilterByOrientationBias {

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
memory: command_mem + " MB"
disks: "local-disk " + select_first([disk_space, 100]) + if use_ssd then " SSD" else " HDD"
preemptible: select_first([preemptible_attempts, 10])
cpu: select_first([cpu, 1])
}

output {
File filtered_vcf = "${output_vcf}"
File filtered_vcf_index = "${output_vcf_index}"
}
}

task FilterAlignmentArtifacts {
#input
File? gatk_override
File input_vcf
File input_vcf_idx
File bam
File bai
String output_name
Boolean compress
String output_vcf = output_name + if compress then ".vcf.gz" else ".vcf"
String output_vcf_index = output_vcf + if compress then ".tbi" else ".idx"
File realignment_index_bundle
String? realignment_extra_args

# runtime
String gatk_docker
Int? mem
Int? preemptible_attempts
Int? disk_space
Int? cpu
Boolean use_ssd = false

# Mem is in units of GB but our command and memory runtime values are in MB
Int machine_mem = if defined(mem) then mem * 1000 else 9000
Int command_mem = machine_mem - 500

command {
set -e

export GATK_LOCAL_JAR=${default="/root/gatk.jar" gatk_override}

gatk --java-options "-Xmx${command_mem}m" FilterAlignmentArtifacts \
-V ${input_vcf} \
-I ${bam} \
--bwa-mem-index-image ${realignment_index_bundle} \
${realignment_extra_args} \
-O ${output_vcf}
}

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
memory: command_mem + " MB"
disks: "local-disk " + select_first([disk_space, 100]) + if use_ssd then " SSD" else " HDD"
preemptible: select_first([preemptible_attempts, 10])
Expand Down Expand Up @@ -842,7 +929,7 @@ task oncotate_m2 {
fi

${default="/root/oncotator_venv/bin/oncotator" oncotator_exe} --db-dir onco_dbdir/ -c $HOME/tx_exact_uniprot_matches.AKT1_CRLF2_FGFR1.txt \
-v ${m2_vcf} ${case_id}.maf.annotated hg19 -i VCF -o TCGAMAF --skip-no-alt --infer-onps --collapse-number-annotations --log_name oncotator.log \
-v ${m2_vcf} ${case_id}.maf.annotated hg19 -i VCF -o TCGAMAF --skip-no-alt --collapse-number-annotations --log_name oncotator.log \
-a Center:${default="Unknown" sequencing_center} \
-a source:${default="Unknown" sequence_source} \
-a normal_barcode:${control_id} \
Expand Down Expand Up @@ -906,12 +993,14 @@ task Funcotate {
Array[String]? transcript_selection_list
Array[String]? annotation_defaults
Array[String]? annotation_overrides
Boolean filter_funcotations

# ==============
# Process input args:
String transcript_selection_arg = if defined(transcript_selection_list) then " --transcript-list " else ""
String annotation_def_arg = if defined(annotation_defaults) then " --annotation-default " else ""
String annotation_over_arg = if defined(annotation_overrides) then " --annotation-override " else ""
String filter_funcotations_args = if (filter_funcotations) then " --remove-filtered-variants " else ""
# ==============

# runtime
Expand Down Expand Up @@ -962,11 +1051,13 @@ task Funcotate {
${"--transcript-selection-mode " + transcript_selection_mode} \
${transcript_selection_arg}${default="" sep=" --transcript-list " transcript_selection_list} \
${annotation_def_arg}${default="" sep=" --annotation-default " annotation_defaults} \
${annotation_over_arg}${default="" sep=" --annotation-override " annotation_overrides}
${annotation_over_arg}${default="" sep=" --annotation-override " annotation_overrides} \
${filter_funcotations_args}
>>>

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
memory: machine_mem + " MB"
disks: "local-disk " + select_first([disk_space_gb, default_disk_space_gb]) + if use_ssd then " SSD" else " HDD"
preemptible: select_first([preemptible_attempts, 3])
Expand Down
Loading

0 comments on commit 0ab43b7

Please sign in to comment.