Skip to content

Commit

Permalink
Make LocalizeReads Optional in GatherSampleEvidence (#620)
Browse files Browse the repository at this point in the history
* Added boolean variable to GatherSampleEvidence to indicate if LocalizeReads should be run with default value of true; if false, the task will be skipped.

* Removed redundant implementation of localized reads in GatherSampleEvidence.wdl

* Updated GatherSampleEvidence rb.CramToBamReviseBase to use input cram/bam from LocalizeReads if itis called only

* Updated GatherSampleEvidence rb.CramToBamReviseBase to use input cram/bam from LocalizeReads if itis called only

* Fixed the file to check for revise_bam, localize reads, and then uses the original file

* Changed location of variable and input to better flow with current wdl formatting
  • Loading branch information
kirtanav98 authored Dec 14, 2023
1 parent 7607a32 commit dc92e9f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
18 changes: 13 additions & 5 deletions wdl/GatherSampleEvidence.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ workflow GatherSampleEvidence {
# Only use if encountering errors (expensive!)
Boolean revise_base = false

# Localize reads parameters
# set to true on default, skips localize_reads if set to false
Boolean run_localize_reads = true

# Common parameters
File primary_contigs_list
File reference_fasta
Expand Down Expand Up @@ -128,19 +132,22 @@ workflow GatherSampleEvidence {
File bam_or_cram_index_ = select_first([bam_or_cram_index, bam_or_cram_file + index_ext_])
# move the reads nearby -- handles requester_pays and makes cross-region transfers just once
call LocalizeReads {
if (run_localize_reads) {
call LocalizeReads {
input:
reads_path = bam_or_cram_file,
reads_index = bam_or_cram_index_,
move_files = move_bam_or_cram_files,
runtime_attr_override = runtime_attr_localize_reads
}
}
if (revise_base) {
call rb.CramToBamReviseBase {
input:
cram_file = LocalizeReads.output_file,
cram_index = LocalizeReads.output_index,
cram_file = select_first([LocalizeReads.output_file, bam_or_cram_file]),
cram_index = select_first([LocalizeReads.output_index, bam_or_cram_index]),
reference_fasta = reference_fasta,
reference_index = reference_index,
contiglist = select_first([primary_contigs_fai]),
Expand All @@ -151,8 +158,8 @@ workflow GatherSampleEvidence {
}
}
File reads_file_ = select_first([CramToBamReviseBase.bam_file, LocalizeReads.output_file])
File reads_index_ = select_first([CramToBamReviseBase.bam_index, LocalizeReads.output_index])
File reads_file_ = select_first([CramToBamReviseBase.bam_file, LocalizeReads.output_file, bam_or_cram_file])
File reads_index_ = select_first([CramToBamReviseBase.bam_index, LocalizeReads.output_index, bam_or_cram_index])
if (collect_coverage || run_melt) {
call cov.CollectCounts {
Expand Down Expand Up @@ -315,6 +322,7 @@ workflow GatherSampleEvidence {
}
}


task LocalizeReads {
input {
File reads_path
Expand Down
5 changes: 5 additions & 0 deletions wdl/GatherSampleEvidenceBatch.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ workflow GatherSampleEvidenceBatch {
Boolean collect_coverage = true
Boolean collect_pesr = true

# Localize reads parameters
# set to true on default, skips localize_reads if set to false
Boolean run_localize_reads = true

# Common parameters
File primary_contigs_list
File reference_fasta
Expand Down Expand Up @@ -136,6 +140,7 @@ workflow GatherSampleEvidenceBatch {
baseline_melt_vcf = baseline_melt_vcf,
baseline_scramble_vcf = baseline_scramble_vcf,
baseline_wham_vcf = baseline_wham_vcf,
run_localize_reads = run_localize_reads,
sv_pipeline_docker = sv_pipeline_docker,
sv_base_mini_docker = sv_base_mini_docker,
samtools_cloud_docker = samtools_cloud_docker,
Expand Down

0 comments on commit dc92e9f

Please sign in to comment.