Skip to content
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

Make LocalizeReads Optional in GatherSampleEvidence #620

Merged
merged 6 commits into from
Dec 14, 2023
18 changes: 13 additions & 5 deletions wdl/GatherSampleEvidence.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,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 @@ -119,18 +123,21 @@ 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_,
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 @@ -141,8 +148,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 @@ -305,6 +312,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