|
| 1 | +version 1.0 |
| 2 | + |
| 3 | +import "../../../tasks/QC/QCAssessment.wdl" as QCAssessment |
| 4 | +import "../../../tasks/QC/FastQC.wdl" as FastQC |
| 5 | +import "../../../tasks/QC/AlignedMetrics.wdl" as AM |
| 6 | + |
| 7 | +workflow QCAssessment { |
| 8 | + meta { |
| 9 | + description: "Assess quality metrics from mosdepth coverage and callable loci data to determine pass/fail status. To pass, the fraction of callable bases must be greater than min_callable_fraction and at least min_coverage_threshold_regions fraction of the genome must have a coverage depth greater than min_coverage." |
| 10 | + } |
| 11 | + |
| 12 | + parameter_meta { |
| 13 | + bam: "Bam file to assess" |
| 14 | + bai: "Index file for given bam file" |
| 15 | + coverage_bed_file: "Bed file for regions to assess" |
| 16 | + min_coverage: "Minimum required mean coverage depth (default: 5)" |
| 17 | + min_coverage_threshold_regions: "Minimum required fraction of genome that must have a coverage depth greater than min_coverage (default: 0.2)" |
| 18 | + min_callable_fraction: "Minimum required fraction of genome that is callable (default: 0.50)" |
| 19 | + prefix: "Prefix for output files" |
| 20 | + } |
| 21 | + |
| 22 | + input { |
| 23 | + File bam |
| 24 | + File bai |
| 25 | + File coverage_bed_file |
| 26 | + |
| 27 | + String prefix |
| 28 | + |
| 29 | + Float min_coverage = 5 |
| 30 | + Float min_coverage_threshold_regions = 0.2 |
| 31 | + Float min_callable_fraction = 0.50 |
| 32 | + |
| 33 | + RuntimeAttr? runtime_attr_override |
| 34 | + } |
| 35 | + |
| 36 | + call AM.MosDepthOverBed as t_001_MosDepthOverBed { |
| 37 | + input: |
| 38 | + bam = bam, |
| 39 | + bai = bai, |
| 40 | + bed = select_first(coverage_bed_file) |
| 41 | + } |
| 42 | +
|
| 43 | + call QCAssessment.AssessQualityMetrics as t_002_AssessQualityMetrics { |
| 44 | + input: |
| 45 | + callable_loci_summary = t_001_MosDepthOverBed.callable_loci_summary, |
| 46 | + mosdepth_region_bed = t_001_MosDepthOverBed.regions, |
| 47 | + min_coverage = min_coverage, |
| 48 | + min_coverage_threshold_regions = min_coverage_threshold_regions, |
| 49 | + min_callable_fraction = min_callable_fraction, |
| 50 | + prefix = SM |
| 51 | + } |
| 52 | +
|
| 53 | + call FastQC.FastQC as t_003_FastQC { |
| 54 | + input: |
| 55 | + bam = bam, |
| 56 | + bai = bai |
| 57 | + } |
| 58 | +
|
| 59 | + output { |
| 60 | + |
| 61 | + # Primary outputs: |
| 62 | + String qc_status = t_002_AssessQualityMetrics.qc_status |
| 63 | + String qc_message = t_002_AssessQualityMetrics.qc_message |
| 64 | + |
| 65 | + # Mosdepth outputs: |
| 66 | + File mosdepth_global_dist = t_001_MosDepthOverBed.global_dist |
| 67 | + File mosdepth_region_dist = t_001_MosDepthOverBed.region_dist |
| 68 | + File mosdepth_regions = t_001_MosDepthOverBed.regions |
| 69 | + File mosdepth_regions_csi = t_001_MosDepthOverBed.regions_csi |
| 70 | + |
| 71 | + # Callable loci outputs: |
| 72 | + File callable_loci_summary = select_first([t_001_MosDepthOverBed.callable_loci_summary, t_002_AssessQualityMetrics.callable_loci_summary]) |
| 73 | + File callable_loci_bed = select_first([t_001_MosDepthOverBed.callable_loci_bed, t_002_AssessQualityMetrics.callable_loci_bed]) |
| 74 | + |
| 75 | + # FastQC outputs: |
| 76 | + File fastqc_zip = t_003_FastQC.fastqc_zip |
| 77 | + File fastqc_html = t_003_FastQC.fastqc_html |
| 78 | + } |
| 79 | +} |
0 commit comments