Skip to content

Commit a6dcbda

Browse files
committed
update PacBio post-alignment QC optionality
1 parent 4522540 commit a6dcbda

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

wdl/pipelines/PacBio/Utility/ProcessOnInstrumentDemuxedChunk.wdl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ workflow ProcessOnInstrumentDemuxedChunk {
3131
"output files will be copied over there"
3232

3333
qc_metrics_config_json:
34-
"A config json to for running the QC and metrics-collection sub-workflow 'AlignedBamQCandMetrics'"
34+
"A config json to for running the QC and metrics-collection sub-workflow 'AlignedBamQCandMetrics'; could be an empty json file."
3535

3636
fingerprint_sample_id:
3737
"For fingerprint verification: the ID of the sample supposedly this BAM belongs to; note that the fingerprint VCF is assumed to be located at {fingerprint_store}/{fingerprint_sample_id}*.vcf(.gz)?"
@@ -78,7 +78,7 @@ workflow ProcessOnInstrumentDemuxedChunk {
7878
String platform
7979

8080
# args for optional QC subworkflows
81-
File? qc_metrics_config_json
81+
File qc_metrics_config_json
8282
String? fingerprint_sample_id
8383
String? expected_sex_type
8484

@@ -97,8 +97,8 @@ workflow ProcessOnInstrumentDemuxedChunk {
9797

9898
# metrics block (caveat: always has to keep an eye on the QC subworkflow about outputs)
9999
Float wgs_cov = QCandMetrics.wgs_cov
100-
Map[String, Float] nanoplot_summ = QCandMetrics.nanoplot_summ
101100
Map[String, Float] sam_flag_stats = QCandMetrics.sam_flag_stats
101+
Map[String, Float]? nanoplot_summ = QCandMetrics.nanoplot_summ
102102

103103
# fingerprint
104104
Map[String, String]? fingerprint_check = QCandMetrics.fingerprint_check
@@ -149,7 +149,7 @@ workflow ProcessOnInstrumentDemuxedChunk {
149149
150150
###################################################################################
151151
# QC
152-
AlignedBamQCnMetricsConfig qcm_config = read_json(select_first([qc_metrics_config_json]))
152+
AlignedBamQCnMetricsConfig qcm_config = read_json(qc_metrics_config_json)
153153
call QCMetrics.Work as QCandMetrics { input:
154154
bam = aBAM,
155155
bai = aBAI,

wdl/pipelines/TechAgnostic/Utility/AlignedBamQCandMetrics.wdl

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ workflow Work {
8080

8181
String tech
8282

83+
Boolean run_nanoplot = true
84+
8385
File? cov_bed
8486
String? cov_bed_descriptor
8587

@@ -100,9 +102,11 @@ workflow Work {
100102

101103
output {
102104
Float wgs_cov = MosDepthWGS.wgs_cov
103-
Map[String, Float] nanoplot_summ = NanoPlotFromBam.stats_map
104105
Map[String, Float] sam_flag_stats = ParseFlagStatsJson.qc_pass_reads_SAM_flag_stats
105106

107+
# nanoplot
108+
Map[String, Float]? nanoplot_summ = NanoPlotFromBam.stats_map
109+
106110
# fingerprint
107111
Map[String, String]? fingerprint_check = fp_res
108112

@@ -160,12 +164,14 @@ workflow Work {
160164
161165
################################
162166
# nanoplot
163-
call NP.NanoPlotFromBam { input: bam = bam, bai = bai, disk_type = disk_type }
164-
FinalizationManifestLine b = object
165-
{files_to_save: flatten([[NanoPlotFromBam.stats], NanoPlotFromBam.plots]),
166-
is_singleton_file: false,
167-
destination: metrics_output_dir + "/nanoplot",
168-
output_attribute_name: "nanoplot"}
167+
if (run_nanoplot) {
168+
call NP.NanoPlotFromBam { input: bam = bam, bai = bai, disk_type = disk_type }
169+
FinalizationManifestLine b = object
170+
{files_to_save: flatten([[NanoPlotFromBam.stats], NanoPlotFromBam.plots]),
171+
is_singleton_file: false,
172+
destination: metrics_output_dir + "/nanoplot",
173+
output_attribute_name: "nanoplot"}
174+
}
169175

170176
###################################################################################
171177
# OPTIONAL QC/METRICS
@@ -255,6 +261,8 @@ struct AlignedBamQCnMetricsConfig {
255261
File? cov_bed # An optional BED file on which coverage will be collected (a mean value for each interval)
256262
String? cov_bed_descriptor # A short description of the BED provided for targeted coverage estimation; will be used in naming output files.
257263
264+
Boolean? run_nanoplot # if false or omitted, will NOT run nanoplot, which typically takes a long time to run
265+
258266
String? fingerprint_vcf_store # A GCS 'folder' holding fingerprint VCF files
259267
260268
File? vbid2_config_json # A config json to for running the VBID2 contamination estimation sub-workflow;

0 commit comments

Comments
 (0)