Organizing cwl files and creating conditional workflow.
[lightning.git] / cwl / gvcf2fasta / subworkflows / scatter / gvcf2fasta / gvcf2fasta_nonrefvcf-wf.cwl
diff --git a/cwl/gvcf2fasta/subworkflows/scatter/gvcf2fasta/gvcf2fasta_nonrefvcf-wf.cwl b/cwl/gvcf2fasta/subworkflows/scatter/gvcf2fasta/gvcf2fasta_nonrefvcf-wf.cwl
new file mode 100644 (file)
index 0000000..0375ca9
--- /dev/null
@@ -0,0 +1,54 @@
+# Copyright (C) The Lightning Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+cwlVersion: v1.2
+class: Workflow
+label: Convert gVCF to FASTA for gVCF with NON_REF
+requirements:
+  ScatterFeatureRequirement: {}
+hints:
+  DockerRequirement:
+    dockerPull: vcfutil
+
+inputs:
+  sampleid:
+    type: string
+    label: Sample ID
+  vcf:
+    type: File
+    label: Input gVCF
+  gqcutoff:
+    type: int
+    label: GQ (Genotype Quality) cutoff for filtering
+  genomebed:
+    type: File
+    label: Whole genome BED
+  ref:
+    type: File
+    label: Reference FASTA
+
+outputs:
+  fas:
+    type: File[]
+    label: Output pair of FASTAs
+    outputSource: bcftools-consensus/fas
+
+steps:
+  fixvcf-get_bed_varonlyvcf:
+    run: ../helpers/fixvcf-get_bed_varonlyvcf.cwl
+    in:
+      sampleid: sampleid
+      vcf: vcf
+      gqcutoff: gqcutoff
+      genomebed: genomebed
+    out: [nocallbed, varonlyvcf]
+
+  bcftools-consensus:
+    run: ../helpers/bcftools-consensus.cwl
+    in:
+      sampleid: sampleid
+      vcf: fixvcf-get_bed_varonlyvcf/varonlyvcf
+      ref: ref
+      mask: fixvcf-get_bed_varonlyvcf/nocallbed
+    out: [fas]