Skip to content

Commit

Permalink
Added Funcotator excluded fields option explicitly to the M2 WDLs. (#…
Browse files Browse the repository at this point in the history
…5242)

- M2 WDL has explicit optional parameter for a list of fields that should be excluded from the output.
- Both M2 WDL files are updated.

Manually tested mutect2.wdl on local backend.

Closes #5141
  • Loading branch information
LeeTL1220 authored Oct 3, 2018
1 parent 26d5d7d commit e52a2d8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 8 additions & 2 deletions scripts/mutect2_wdl/mutect2.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
## funco_data_sources_tar_gz: Funcotator datasources tar gz file. Bucket location is recommended when running on the cloud.
## funco_annotation_defaults: Default values for annotations, when values are unspecified. Specified as <ANNOTATION>:<VALUE>. For example: "Center:Broad"
## funco_annotation_overrides: Values for annotations, even when values are unspecified. Specified as <ANNOTATION>:<VALUE>. For example: "Center:Broad"
## funcotator_excluded_fields: Annotations that should not appear in the output (VCF or MAF). Specified as <ANNOTATION>. For example: "ClinVar_ALLELEID"
##
## 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 @@ -116,6 +117,7 @@ workflow Mutect2 {
String? sequencing_center
String? sequence_source
File? default_config_file
String? oncotator_extra_args

# funcotator inputs
Boolean? run_funcotator
Expand All @@ -126,6 +128,8 @@ workflow Mutect2 {
File? funco_transcript_selection_list
Array[String]? funco_annotation_defaults
Array[String]? funco_annotation_overrides
Array[String]? funcotator_excluded_fields
String? funcotator_extra_args

File? gatk_override

Expand All @@ -138,8 +142,6 @@ workflow Mutect2 {
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
String? funcotator_extra_args

Int? preemptible_attempts
Int? max_retries
Expand Down Expand Up @@ -429,6 +431,7 @@ workflow Mutect2 {
gatk_docker = gatk_docker,
gatk_override = gatk_override,
filter_funcotations = filter_funcotations_or_default,
funcotator_excluded_fields = funcotator_excluded_fields,
sequencing_center = sequencing_center,
sequence_source = sequence_source,
disk_space_gb = ceil(size(funcotate_vcf_input, "GB") * large_input_to_output_multiplier) + onco_tar_size + disk_pad,
Expand Down Expand Up @@ -1197,6 +1200,7 @@ task FuncotateMaf {
File? transcript_selection_list
Array[String]? annotation_defaults
Array[String]? annotation_overrides
Array[String]? funcotator_excluded_fields
Boolean filter_funcotations
File? interval_list

Expand All @@ -1207,6 +1211,7 @@ task FuncotateMaf {
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 ""
String excluded_fields_args = if defined(funcotator_excluded_fields) then " --exclude-field " else ""
String final_output_filename = basename(input_vcf, ".vcf") + ".maf.annotated"
# ==============
Expand Down Expand Up @@ -1269,6 +1274,7 @@ task FuncotateMaf {
--annotation-default source:${default="Unknown" sequence_source} \
${annotation_def_arg}${default="" sep=" --annotation-default " annotation_defaults} \
${annotation_over_arg}${default="" sep=" --annotation-override " annotation_overrides} \
${excluded_fields_args}${default="" sep=" --exclude-field " funcotator_excluded_fields} \
${filter_funcotations_args} \
${extra_args}
>>>
Expand Down
10 changes: 8 additions & 2 deletions scripts/mutect2_wdl/mutect2_nio.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
## funco_data_sources_tar_gz: Funcotator datasources tar gz file. Bucket location is recommended when running on the cloud.
## funco_annotation_defaults: Default values for annotations, when values are unspecified. Specified as <ANNOTATION>:<VALUE>. For example: "Center:Broad"
## funco_annotation_overrides: Values for annotations, even when values are unspecified. Specified as <ANNOTATION>:<VALUE>. For example: "Center:Broad"
## funcotator_excluded_fields: Annotations that should not appear in the output (VCF or MAF). Specified as <ANNOTATION>. For example: "ClinVar_ALLELEID"
##
## 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 @@ -107,6 +108,7 @@ workflow Mutect2 {
String? sequencing_center
String? sequence_source
File? default_config_file
String? oncotator_extra_args

# funcotator inputs
Boolean? run_funcotator
Expand All @@ -117,6 +119,8 @@ workflow Mutect2 {
File? funco_transcript_selection_list
Array[String]? funco_annotation_defaults
Array[String]? funco_annotation_overrides
Array[String]? funcotator_excluded_fields
String? funcotator_extra_args

File? gatk_override

Expand All @@ -129,8 +133,6 @@ workflow Mutect2 {
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
String? funcotator_extra_args

Int? preemptible_attempts
Int? max_retries
Expand Down Expand Up @@ -373,6 +375,7 @@ workflow Mutect2 {
gatk_docker = gatk_docker,
gatk_override = gatk_override,
filter_funcotations = filter_funcotations_or_default,
funcotator_excluded_fields = funcotator_excluded_fields,
sequencing_center = sequencing_center,
sequence_source = sequence_source,
disk_space_gb = ceil(size(funcotate_vcf_input, "GB") * large_input_to_output_multiplier) + funco_tar_size + disk_pad,
Expand Down Expand Up @@ -1013,6 +1016,7 @@ task FuncotateMaf {
File? transcript_selection_list
Array[String]? annotation_defaults
Array[String]? annotation_overrides
Array[String]? funcotator_excluded_fields
Boolean filter_funcotations
File? interval_list

Expand All @@ -1023,6 +1027,7 @@ task FuncotateMaf {
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 ""
String excluded_fields_args = if defined(funcotator_excluded_fields) then " --exclude-field " else ""
String final_output_filename = basename(input_vcf, ".vcf") + ".maf.annotated"
# ==============
Expand Down Expand Up @@ -1085,6 +1090,7 @@ task FuncotateMaf {
--annotation-default source:${default="Unknown" sequence_source} \
${annotation_def_arg}${default="" sep=" --annotation-default " annotation_defaults} \
${annotation_over_arg}${default="" sep=" --annotation-override " annotation_overrides} \
${excluded_fields_args}${default="" sep=" --exclude-field " funcotator_excluded_fields} \
${filter_funcotations_args} \
${extra_args}
>>>
Expand Down
2 changes: 1 addition & 1 deletion scripts/mutect2_wdl/unsupported/funcotator.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# annotation_defaults - Annotations to include in all annotated variants if the annotation is not specified in the data sources (in the format <ANNOTATION>:<VALUE>). This will add the specified annotation to every annotated variant if it is not already present.
# annotation_overrides - Override values for annotations (in the format <ANNOTATION>:<VALUE>). Replaces existing annotations of the given name with given values.
# gatk4_jar_override - Override Jar file containing GATK 4.0. Use this when overriding the docker JAR or when using a backend without docker.
# funcotator_extra_args - Extra command-line arguments to pass through to Funcotator.
# funcotator_extra_args - Extra command-line arguments to pass through to Funcotator. (e.g. " --exclude-field foo_field --exclude-field bar_field ")
#
# This WDL needs to decide whether to use the ``gatk_jar`` or ``gatk_jar_override`` for the jar location. As of cromwell-0.24,
# this logic *must* go into each task. Therefore, there is a lot of duplicated code. This allows users to specify a jar file
Expand Down

0 comments on commit e52a2d8

Please sign in to comment.