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

Commit

Permalink
Wdlupdate (#6)
Browse files Browse the repository at this point in the history
* updated wdl/json to gatk4.0.1.1 release

* add info for Readme

* Update wdl to gatk4.0.1.2 Release

* Update docker to gatk4.0.1.2

* added mutect2_pon.wdl, added Parameter descriptions to readme

* Update mutect2_pon.inputs.json

* Update mutect2.exome.inputs.json

* updated mutect2.wdl to gatk4.0.2.0

* Update to gatk4.0.4.0 ,  Addtion of NIO supported mutect2 version
  • Loading branch information
bshifaw authored May 1, 2018
1 parent d9e4008 commit 1c458a9
Show file tree
Hide file tree
Showing 5 changed files with 996 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Workflows for somatic short variant analysis with GATK4.

### mutect2 :
Implements Somatic short variant discovery using [GATK Best Practices](https://software.broadinstitute.org/gatk/best-practices/workflow).

Note: Also provided in this repo is mutect2_nio which is a NIO supported version of the wdl.

#### Requirements/expectations
- Tumor bam and index
Expand Down Expand Up @@ -40,7 +40,7 @@ Used to validate mutect2 workflow.
- GATK4 or later

Cromwell version support
- Successfully tested on v30
- Successfully tested on v31


### Parameter descriptions :
Expand Down
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.3.0"
"Mutect2NormalNormal.gatk_docker": "broadinstitute/gatk:4.0.4.0"
}

2 changes: 1 addition & 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": "broadinstitute/oncotator:1.9.6.1",
"Mutect2.gatk_docker": "broadinstitute/gatk:4.0.2.0",
"Mutect2.gatk_docker": "broadinstitute/gatk:4.0.4.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 Down
48 changes: 40 additions & 8 deletions mutect2.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
## ** Secondary resources ** (for optional tasks)
## 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
##
## 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 @@ -83,6 +84,8 @@ workflow Mutect2 {
Boolean make_bamout_or_default = select_first([make_bamout, false])
Boolean? compress_vcfs
Boolean compress = select_first([compress_vcfs, false])
File? gga_vcf
File? gga_vcf_idx

# oncotator inputs
Boolean? run_oncotator
Expand All @@ -109,7 +112,11 @@ workflow Mutect2 {
String gatk_docker
String basic_bash_docker = "ubuntu:16.04"
String? oncotator_docker
String oncotator_docker_or_default = select_first([oncotator_docker, "broadinstitute/oncotator:1.9.6.1"])
String oncotator_docker_or_default = select_first([oncotator_docker, "broadinstitute/oncotator:1.9.8.0"])
Boolean? filter_oncotator_maf
Boolean filter_oncotator_maf_or_default = select_first([filter_oncotator_maf, true])
String? oncotator_extra_args

Int? preemptible_attempts

# Use as a last resort to increase the disk given to every task in case of ill behaving data
Expand Down Expand Up @@ -177,9 +184,10 @@ workflow Mutect2 {
m2_extra_args = m2_extra_args,
make_bamout = make_bamout_or_default,
compress = compress,
gga_vcf = gga_vcf,
gga_vcf_idx = gga_vcf_idx,
gatk_override = gatk_override,
gatk_docker = gatk_docker,
preemptible_attempts = preemptible_attempts,
disk_space = tumor_bam_size + normal_bam_size + ref_size + gnomad_vcf_size + m2_output_size + disk_pad
}

Expand Down Expand Up @@ -270,6 +278,7 @@ workflow Mutect2 {
compress = compress,
preemptible_attempts = preemptible_attempts,
contamination_table = CalculateContamination.contamination_table,
maf_segments = CalculateContamination.maf_segments,
m2_extra_filtering_args = m2_extra_filtering_args,
disk_space = ceil(size(MergeVCFs.merged_vcf, "GB") * small_input_to_output_multiplier) + disk_pad
}
Expand Down Expand Up @@ -307,7 +316,9 @@ workflow Mutect2 {
control_id = M2.normal_sample[0],
oncotator_docker = oncotator_docker_or_default,
preemptible_attempts = preemptible_attempts,
disk_space = ceil(size(oncotate_vcf_input, "GB") * large_input_to_output_multiplier) + onco_tar_size + disk_pad
disk_space = ceil(size(oncotate_vcf_input, "GB") * large_input_to_output_multiplier) + onco_tar_size + disk_pad,
filter_maf = filter_oncotator_maf_or_default,
oncotator_extra_args = oncotator_extra_args
}
}

Expand Down Expand Up @@ -417,6 +428,8 @@ task M2 {
String? m2_extra_args
Boolean? make_bamout
Boolean compress
File? gga_vcf
File? gga_vcf_idx

String output_vcf = "output" + if compress then ".vcf.gz" else ".vcf"
String output_vcf_index = output_vcf + if compress then ".tbi" else ".idx"
Expand Down Expand Up @@ -460,6 +473,7 @@ task M2 {
${"--germline-resource " + gnomad} \
${"-pon " + pon} \
${"-L " + intervals} \
${"--genotyping-mode GENOTYPE_GIVEN_ALLELES --alleles " + gga_vcf} \
-O "${output_vcf}" \
${true='--bam-output bamout.bam' false='' make_bamout} \
${m2_extra_args}
Expand Down Expand Up @@ -555,8 +569,15 @@ task MergeBamOuts {
set -e
export GATK_LOCAL_JAR=${default="/root/gatk.jar" gatk_override}
gatk --java-options "-Xmx${command_mem}m" GatherBamFiles \
-I ${sep=" -I " bam_outs} -O ${output_vcf_name}.out.bam -R ${ref_fasta}
samtools index ${output_vcf_name}.out.bam ${output_vcf_name}.out.bam.bai
-I ${sep=" -I " bam_outs} -O unsorted.out.bam -R ${ref_fasta}

# We must sort because adjacent scatters may have overlapping (padded) assembly regions, hence
# overlapping bamouts

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
>>>

runtime {
Expand All @@ -569,7 +590,7 @@ task MergeBamOuts {

output {
File merged_bam_out = "${output_vcf_name}.out.bam"
File merged_bam_out_index = "${output_vcf_name}.out.bam.bai"
File merged_bam_out_index = "${output_vcf_name}.out.bai"
}
}

Expand Down Expand Up @@ -650,7 +671,7 @@ task CalculateContamination {
fi

gatk --java-options "-Xmx${command_mem}m" GetPileupSummaries -R ${ref_fasta} -I ${tumor_bam} ${"-L " + intervals} -V ${variants_for_contamination} -O pileups.table
gatk --java-options "-Xmx${command_mem}m" CalculateContamination -I pileups.table -O contamination.table $NORMAL_CMD
gatk --java-options "-Xmx${command_mem}m" CalculateContamination -I pileups.table -O contamination.table --tumor-segmentation segments.table $NORMAL_CMD
}

runtime {
Expand All @@ -663,6 +684,7 @@ task CalculateContamination {
output {
File pileups = "pileups.table"
File contamination_table = "contamination.table"
File maf_segments = "segments.table"
}
}

Expand All @@ -676,6 +698,7 @@ task Filter {
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? contamination_table
File? maf_segments
String? m2_extra_filtering_args

File? gatk_override
Expand All @@ -700,6 +723,7 @@ task Filter {
gatk --java-options "-Xmx${command_mem}m" FilterMutectCalls -V ${unfiltered_vcf} \
-O ${output_vcf} \
${"--contamination-table " + contamination_table} \
${"--tumor-segmentation " + maf_segments} \
${m2_extra_filtering_args}
}

Expand Down Expand Up @@ -778,6 +802,7 @@ task oncotate_m2 {
File? default_config_file
String case_id
String? control_id
String? oncotator_extra_args

# runtime
String oncotator_docker
Expand All @@ -787,6 +812,10 @@ task oncotate_m2 {
Int? cpu
Boolean use_ssd = false

Boolean? filter_maf
Boolean is_filter_maf = select_first([filter_maf, true])
String filter_maf_args = if (is_filter_maf) then " --collapse-filter-cols --prune-filter-cols " else ""

# 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 3500
Int command_mem = machine_mem - 500
Expand Down Expand Up @@ -818,7 +847,9 @@ task oncotate_m2 {
-a source:${default="Unknown" sequence_source} \
-a normal_barcode:${control_id} \
-a tumor_barcode:${case_id} \
${"--default_config " + default_config_file}
${"--default_config " + default_config_file} \
${filter_maf_args} \
${oncotator_extra_args}
>>>

runtime {
Expand Down Expand Up @@ -947,3 +978,4 @@ task Funcotate {
File funcotated_vcf_index = "${output_vcf_index}"
}
}

Loading

0 comments on commit 1c458a9

Please sign in to comment.