-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
realignment filter in M2 wdl #4848
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,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 | ||
|
@@ -74,6 +75,8 @@ workflow Mutect2 { | |
Int scatter_count | ||
File? gnomad | ||
File? variants_for_contamination | ||
File? realignment_index_bundle | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add comments above? |
||
String? realignment_extra_args | ||
Boolean? run_orientation_bias_filter | ||
Boolean run_ob_filter = select_first([run_orientation_bias_filter, false]) | ||
Array[String]? artifact_modes | ||
|
@@ -290,8 +293,23 @@ workflow Mutect2 { | |
} | ||
} | ||
|
||
if (defined(realignment_index_bundle)) { | ||
File realignment_filter_input = select_first([FilterByOrientationBias.filtered_vcf, Filter.filtered_vcf]) | ||
call FilterRealignmentArtifacts { | ||
input: | ||
gatk_override = gatk_override, | ||
bam = tumor_bam, | ||
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 | ||
} | ||
} | ||
|
||
if (run_oncotator_or_default) { | ||
File oncotate_vcf_input = select_first([FilterByOrientationBias.filtered_vcf, Filter.filtered_vcf]) | ||
File oncotate_vcf_input = select_first([FilterRealignmentArtifacts.filtered_vcf, FilterByOrientationBias.filtered_vcf, Filter.filtered_vcf]) | ||
call oncotate_m2 { | ||
input: | ||
m2_vcf = oncotate_vcf_input, | ||
|
@@ -312,7 +330,7 @@ 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_index = select_first([FilterRealignmentArtifacts.filtered_vcf, FilterByOrientationBias.filtered_vcf_index, Filter.filtered_vcf_index]) | ||
call Funcotate { | ||
input: | ||
m2_vcf = funcotate_vcf_input, | ||
|
@@ -334,8 +352,8 @@ workflow Mutect2 { | |
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([FilterRealignmentArtifacts.filtered_vcf, FilterByOrientationBias.filtered_vcf, Filter.filtered_vcf]) | ||
File filtered_vcf_index = select_first([FilterRealignmentArtifacts.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 | ||
|
@@ -765,6 +783,57 @@ task FilterByOrientationBias { | |
} | ||
} | ||
|
||
task FilterRealignmentArtifacts { | ||
#input | ||
File? gatk_override | ||
String input_vcf | ||
String bam | ||
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 | ||
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 oncotate_m2 { | ||
# inputs | ||
File m2_vcf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the comments and any relevant READMEs?