From 5f6cf433f6c19a02e26f6b49b1d2d5b5f6199903 Mon Sep 17 00:00:00 2001 From: Jason Walker Date: Tue, 19 Mar 2019 15:53:53 -0500 Subject: [PATCH 1/2] A new basic workflow for generic, non-human exome alignment and qc. --- .../pipelines/simple_exome_alignment.cwl | 134 ++++++++++++++++++ definitions/subworkflows/qc_exome_no_vbi.cwl | 117 +++++++++++++++ 2 files changed, 251 insertions(+) create mode 100644 definitions/pipelines/simple_exome_alignment.cwl create mode 100644 definitions/subworkflows/qc_exome_no_vbi.cwl diff --git a/definitions/pipelines/simple_exome_alignment.cwl b/definitions/pipelines/simple_exome_alignment.cwl new file mode 100644 index 000000000..305b6d1c9 --- /dev/null +++ b/definitions/pipelines/simple_exome_alignment.cwl @@ -0,0 +1,134 @@ +#!/usr/bin/env cwl-runner + +cwlVersion: v1.0 +class: Workflow +label: "simple xome alignment with qc" +requirements: + - class: SchemaDefRequirement + types: + - $import: ../types/labelled_file.yml + - class: SubworkflowFeatureRequirement +inputs: + reference: string + bams: + type: File[] + readgroups: + type: string[] + bait_intervals: + type: File + final_name: + type: string? + target_intervals: + type: File + per_base_intervals: + type: ../types/labelled_file.yml#labelled_file[] + per_target_intervals: + type: ../types/labelled_file.yml#labelled_file[] + summary_intervals: + type: ../types/labelled_file.yml#labelled_file[] + picard_metric_accumulation_level: + type: string + qc_minimum_mapping_quality: + type: int? + qc_minimum_base_quality: + type: int? +outputs: + cram: + type: File + outputSource: index_cram/indexed_cram + mark_duplicates_metrics: + type: File + outputSource: mark_duplicates_and_sort/metrics_file + insert_size_metrics: + type: File + outputSource: qc/insert_size_metrics + insert_size_histogram: + type: File + outputSource: qc/insert_size_histogram + alignment_summary_metrics: + type: File + outputSource: qc/alignment_summary_metrics + hs_metrics: + type: File + outputSource: qc/hs_metrics + per_target_coverage_metrics: + type: File[] + outputSource: qc/per_target_coverage_metrics + per_target_hs_metrics: + type: File[] + outputSource: qc/per_target_hs_metrics + per_base_coverage_metrics: + type: File[] + outputSource: qc/per_base_coverage_metrics + per_base_hs_metrics: + type: File[] + outputSource: qc/per_base_hs_metrics + summary_hs_metrics: + type: File[] + outputSource: qc/summary_hs_metrics + flagstats: + type: File + outputSource: qc/flagstats +steps: + align: + scatter: [bam, readgroup] + scatterMethod: dotproduct + run: align.cwl + in: + bam: bams + readgroup: readgroups + reference: reference + out: + [tagged_bam] + merge: + run: ../tools/merge_bams_samtools.cwl + in: + bams: align/tagged_bam + name: final_name + out: + [merged_bam] + name_sort: + run: ../tools/name_sort.cwl + in: + bam: merge/merged_bam + out: + [name_sorted_bam] + mark_duplicates_and_sort: + run: ../tools/mark_duplicates_and_sort.cwl + in: + bam: name_sort/name_sorted_bam + out: + [sorted_bam, metrics_file] + index_bam: + run: ../tools/index_bam.cwl + in: + bam: mark_duplicates_and_sort/sorted_bam + out: + [indexed_bam] + qc: + run: ../subworkflows/qc_exome_no_vbi.cwl + in: + bam: index_bam/indexed_bam + reference: reference + bait_intervals: bait_intervals + target_intervals: target_intervals + per_base_intervals: per_base_intervals + per_target_intervals: per_target_intervals + summary_intervals: summary_intervals + picard_metric_accumulation_level: picard_metric_accumulation_level + minimum_mapping_quality: qc_minimum_mapping_quality + minimum_base_quality: qc_minimum_base_quality + out: [insert_size_metrics, insert_size_histogram, alignment_summary_metrics, hs_metrics, per_target_coverage_metrics, per_target_hs_metrics, per_base_coverage_metrics, per_base_hs_metrics, summary_hs_metrics, flagstats] + bam_to_cram: + run: ../tools/bam_to_cram.cwl + in: + bam: index_bam/indexed_bam + reference: reference + out: + [cram] + index_cram: + run: ../tools/index_cram.cwl + in: + cram: bam_to_cram/cram + out: + [indexed_cram] diff --git a/definitions/subworkflows/qc_exome_no_vbi.cwl b/definitions/subworkflows/qc_exome_no_vbi.cwl new file mode 100644 index 000000000..3187fa40d --- /dev/null +++ b/definitions/subworkflows/qc_exome_no_vbi.cwl @@ -0,0 +1,117 @@ +#!/usr/bin/env cwl-runner + +cwlVersion: v1.0 +class: Workflow +label: "Exome QC workflow without VerifyBamId" +requirements: + - class: SchemaDefRequirement + types: + - $import: ../types/labelled_file.yml + - class: SubworkflowFeatureRequirement +inputs: + bam: + type: File + secondaryFiles: [^.bai] + reference: + type: string + bait_intervals: + type: File + target_intervals: + type: File + picard_metric_accumulation_level: + type: string? + default: ALL_READS + minimum_mapping_quality: + type: int? + minimum_base_quality: + type: int? + per_base_intervals: + type: ../types/labelled_file.yml#labelled_file[] + per_target_intervals: + type: ../types/labelled_file.yml#labelled_file[] + summary_intervals: + type: ../types/labelled_file.yml#labelled_file[] +outputs: + insert_size_metrics: + type: File + outputSource: collect_insert_size_metrics/insert_size_metrics + insert_size_histogram: + type: File + outputSource: collect_insert_size_metrics/insert_size_histogram + alignment_summary_metrics: + type: File + outputSource: collect_alignment_summary_metrics/alignment_summary_metrics + hs_metrics: + type: File + outputSource: collect_roi_hs_metrics/hs_metrics + per_target_coverage_metrics: + type: File[] + outputSource: collect_detailed_hs_metrics/per_target_coverage_metrics + per_target_hs_metrics: + type: File[] + outputSource: collect_detailed_hs_metrics/per_target_hs_metrics + per_base_coverage_metrics: + type: File[] + outputSource: collect_detailed_hs_metrics/per_base_coverage_metrics + per_base_hs_metrics: + type: File[] + outputSource: collect_detailed_hs_metrics/per_base_hs_metrics + summary_hs_metrics: + type: File[] + outputSource: collect_detailed_hs_metrics/summary_hs_metrics + flagstats: + type: File + outputSource: samtools_flagstat/flagstats +steps: + collect_insert_size_metrics: + run: ../tools/collect_insert_size_metrics.cwl + in: + bam: bam + reference: reference + metric_accumulation_level: picard_metric_accumulation_level + out: + [insert_size_metrics, insert_size_histogram] + collect_alignment_summary_metrics: + run: ../tools/collect_alignment_summary_metrics.cwl + in: + bam: bam + reference: reference + metric_accumulation_level: picard_metric_accumulation_level + out: + [alignment_summary_metrics] + collect_roi_hs_metrics: + run: ../tools/collect_hs_metrics.cwl + in: + bam: bam + reference: reference + metric_accumulation_level: + valueFrom: "ALL_READS" + bait_intervals: bait_intervals + target_intervals: target_intervals + per_target_coverage: + default: false + per_base_coverage: + default: false + output_prefix: + valueFrom: "roi" + minimum_mapping_quality: minimum_mapping_quality + minimum_base_quality: minimum_base_quality + out: + [hs_metrics] + collect_detailed_hs_metrics: + run: hs_metrics.cwl + in: + bam: bam + minimum_mapping_quality: minimum_mapping_quality + minimum_base_quality: minimum_base_quality + per_base_intervals: per_base_intervals + per_target_intervals: per_target_intervals + reference: reference + summary_intervals: summary_intervals + out: + [per_base_coverage_metrics, per_base_hs_metrics, per_target_coverage_metrics, per_target_hs_metrics, summary_hs_metrics] + samtools_flagstat: + run: ../tools/samtools_flagstat.cwl + in: + bam: bam + out: [flagstats] From ef04c30d66bccd0ca6c1e4d2169de45fc1a2f61d Mon Sep 17 00:00:00 2001 From: Jason Walker Date: Wed, 3 Apr 2019 17:52:18 -0500 Subject: [PATCH 2/2] clarify the type of intervals needed as input. --- definitions/pipelines/wgs_alignment.cwl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/definitions/pipelines/wgs_alignment.cwl b/definitions/pipelines/wgs_alignment.cwl index fcb1ebfd5..8bf8a01d8 100644 --- a/definitions/pipelines/wgs_alignment.cwl +++ b/definitions/pipelines/wgs_alignment.cwl @@ -26,7 +26,7 @@ inputs: omni_vcf: type: File secondaryFiles: [.tbi] - intervals: + qc_intervals: type: File picard_metric_accumulation_level: type: string @@ -115,7 +115,7 @@ steps: bam: alignment/final_bam reference: reference omni_vcf: omni_vcf - intervals: intervals + intervals: qc_intervals picard_metric_accumulation_level: picard_metric_accumulation_level minimum_mapping_quality: minimum_mapping_quality minimum_base_quality: minimum_base_quality