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

Fix output_bam_basename calculation #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions processing-for-variant-discovery-gatk3.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,14 @@ workflow GenericPreProcessingWorkflow {
# Align flowcell-level unmapped input bams in parallel
scatter (unmapped_bam in flowcell_unmapped_bams) {

# Because of a wdl/cromwell bug this is not currently valid so we have to sub(sub()) in each task
# String base_name = sub(sub(unmapped_bam, "gs://.*/", ""), unmapped_bam_suffix + "$", "")

String sub_strip_path = "gs://.*/"
String sub_strip_unmapped = unmapped_bam_suffix + "$"
String base_name = sub(basename(unmapped_bam), unmapped_bam_suffix + "$", "") + ".unmerged"

# Map reads to reference
call SamToFastqAndBwaMem {
input:
input_bam = unmapped_bam,
bwa_commandline = bwa_commandline,
output_bam_basename = sub(sub(unmapped_bam, sub_strip_path, ""), sub_strip_unmapped, "") + ".unmerged",
output_bam_basename = base_name,
ref_fasta = ref_fasta,
ref_fasta_index = ref_fasta_index,
ref_dict = ref_dict,
Expand All @@ -108,7 +104,7 @@ workflow GenericPreProcessingWorkflow {
bwa_commandline = bwa_commandline,
bwa_version = GetBwaVersion.version,
aligned_bam = SamToFastqAndBwaMem.output_bam,
output_bam_basename = sub(sub(unmapped_bam, sub_strip_path, ""), sub_strip_unmapped, "") + ".aligned.unsorted",
output_bam_basename = base_name,
ref_fasta = ref_fasta,
ref_fasta_index = ref_fasta_index,
ref_dict = ref_dict,
Expand All @@ -120,7 +116,7 @@ workflow GenericPreProcessingWorkflow {
call SortAndFixTags as SortAndFixReadGroupBam {
input:
input_bam = MergeBamAlignment.output_bam,
output_bam_basename = sub(sub(unmapped_bam, sub_strip_path, ""), sub_strip_unmapped, "") + ".sorted",
output_bam_basename = base_name,
ref_dict = ref_dict,
ref_fasta = ref_fasta,
ref_fasta_index = ref_fasta_index,
Expand Down