--- /dev/null
+cwlVersion: v1.1
+class: Workflow
+
+requirements:
+ - class: SubworkflowFeatureRequirement
+
+inputs:
+ fastq1: File
+ fastq2: File
+ reference:
+ type: File
+ secondaryFiles:
+ - .amb
+ - .ann
+ - .bwt
+ - .pac
+ - .sa
+ - .fai
+ - ^.dict
+ sample: string
+ knownsites:
+ type: File
+ secondaryFiles:
+ - .tbi
+ scattercount: string
+ clinvarvcf: File
+ reportfunc: File
+ headhtml: File
+ tailhtml: File
+
+outputs:
+ qc-html:
+ type: File[]
+ outputSource: fastqc/out-html
+ qc-zip:
+ type: File[]
+ outputSource: fastqc/out-zip
+ gvcf:
+ type: File
+ outputSource: haplotypecaller/gatheredgvcf
+ report:
+ type: File
+ outputSource: generate-report/report
+steps:
+ fastqc:
+ run: fastqc.cwl
+ in:
+ fastq1: fastq1
+ fastq2: fastq2
+ out: [out-html, out-zip]
+ bwamem-samtools-view:
+ run: bwamem-samtools-view.cwl
+ in:
+ fastq1: fastq1
+ fastq2: fastq2
+ reference: reference
+ sample: sample
+ out: [bam]
+ samtools-sort:
+ run: samtools-sort.cwl
+ in:
+ bam: bwamem-samtools-view/bam
+ sample: sample
+ out: [sortedbam]
+ mark-duplicates:
+ run: mark-duplicates.cwl
+ in:
+ bam: samtools-sort/sortedbam
+ out: [dupbam,dupmetrics]
+ samtools-index:
+ run: samtools-index.cwl
+ in:
+ bam: mark-duplicates/dupbam
+ out: [indexedbam]
+ haplotypecaller:
+ run: scatter-gatk-wf-with-interval.cwl
+ in:
+ reference: reference
+ bam: samtools-index/indexedbam
+ sample: sample
+ scattercount: scattercount
+ knownsites1: knownsites
+ out: [gatheredgvcf]
+ generate-report:
+ run: report-wf.cwl
+ in:
+ gvcf: haplotypecaller/gatheredgvcf
+ samplename: sample
+ clinvarvcf: clinvarvcf
+ reportfunc: reportfunc
+ headhtml: headhtml
+ tailhtml: tailhtml
+ out: [report]
--- /dev/null
+cwlVersion: v1.1
+class: CommandLineTool
+label: Gathering vcf using Picard
+$namespaces:
+ arv: "http://arvados.org/cwl#"
+ cwltool: "http://commonwl.org/cwltool#"
+
+requirements:
+ DockerRequirement:
+ dockerPull: broadinstitute/gatk:4.1.7.0
+ ShellCommandRequirement: {}
+ InlineJavascriptRequirement: {}
+
+hints:
+ ResourceRequirement:
+ ramMin: 20000
+ coresMin: 4
+ arv:RuntimeConstraints:
+ outputDirType: keep_output_dir
+
+inputs:
+ gvcfarray:
+ type: File[]
+ sample: string
+ reference:
+ type: File
+ secondaryFiles:
+ - .amb
+ - .ann
+ - .bwt
+ - .pac
+ - .sa
+ - .fai
+ - ^.dict
+outputs:
+ gatheredgvcf:
+ type: File
+ secondaryFiles:
+ - .tbi
+ outputBinding:
+ glob: "*.g.vcf.gz"
+
+baseCommand: /gatk/gatk
+
+arguments:
+ - "--java-options"
+ - "-Xmx8G"
+ - MergeVcfs
+ - shellQuote: false
+ valueFrom: |
+ ${function compare(a, b) {
+ var baseA = a.basename;
+ var baseB = b.basename;
+
+ var comparison = 0;
+ if (baseA > baseB) {
+ comparison = 1;
+ } else if (baseA < baseB) {
+ comparison = -1;
+ }
+ return comparison;
+ }
+
+ var sortedarray = [];
+ sortedarray = inputs.gvcfarray.sort(compare)
+
+ var samples = [];
+ for (var i = 0; i < sortedarray.length; i++) {
+ var name = sortedarray[i];
+ if (name.nameext ==='.gz' ) {
+ samples.push(name.path);
+ }
+ }
+
+ var sampleinput = "";
+
+ for (var i = 0; i < samples.length; i++) {
+ var s1 = samples[i];
+ sampleinput = sampleinput + "-I " + s1 + " "
+ }
+
+ return sampleinput;
+ }
+ - prefix: "-O"
+ valueFrom: $(inputs.sample).g.vcf.gz
outputDirType: keep_output_dir
inputs:
- gvcfarray: File[]
+ gvcfdir:
+ type: Directory
+ label: Input directory of gvcfs
+ loadListing: 'shallow_listing'
sample: string
reference:
type: File
- GatherVcfs
- shellQuote: false
valueFrom: >
- ${
- var cmd "";
- for( var i = 0; i < inputs.gvcfarray.length; i++){
- cmd += "\s echo " + "-I" + "\s" + inputs.gvcfsarray[i]
- }
- return cmd;
- }
+ ${
+ var samples = [];
+ for (var i = 0; i < inputs.gvcfdir.listing.length; i++) {
+ var name = inputs.gvcfdir.listing[i];
+ if (name.nameext ==='.gz' ) {
+ samples.push(name.basename);
+ }
+ }
+ samples = samples.sort();
+ var sampleinput = [];
+
+ for (var i = 0; i < samples.length; i++) {
+ var s1 = samples[i];
+ sampleinput = sampleinput + "-I " + s1 + " "
+ }
+ return sampleinput;
+ }
- prefix: "-O"
valueFrom: $(inputs.sample).g.vcf.gz
DockerRequirement:
dockerPull: broadinstitute/gatk:4.1.7.0
ShellCommandRequirement: {}
- InitialWorkDirRequirement:
- listing:
- - $(inputs.gvcf1)
- - $(inputs.gvcf2)
+ InlineJavascriptRequirement: {}
hints:
ResourceRequirement:
outputDirType: keep_output_dir
inputs:
- gvcf1:
- type: File
- gvcf2:
- type: File
+ gvcfdir:
+ type: Directory
+ label: Input directory of gvcfs
+ loadListing: 'shallow_listing'
sample: string
reference:
type: File
outputs:
gatheredgvcf:
type: File
+ secondaryFiles:
+ - .tbi
outputBinding:
glob: "*.g.vcf.gz"
arguments:
- "--java-options"
- "-Xmx8G"
- - GatherVcfs
- - "-I"
- - $(inputs.gvcf1.basename)
- - "-I"
- - $(inputs.gvcf2.basename)
+ - MergeVcfs
+ - shellQuote: false
+ valueFrom: |
+ ${function compare(a, b) {
+ var baseA = a.basename;
+ var baseB = b.basename;
+
+ var comparison = 0;
+ if (baseA > baseB) {
+ comparison = 1;
+ } else if (baseA < baseB) {
+ comparison = -1;
+ }
+ return comparison;
+ }
+
+ var samples = [];
+ for (var i = 0; i < inputs.gvcfdir.listing.length; i++) {
+ var name = inputs.gvcfdir.listing[i];
+ if (name.nameext ==='.gz' ) {
+ samples.push(name.path);
+ }
+ }
+ samples = samples.sort(compare);
+ var sampleinput = [];
+
+ for (var i = 0; i < samples.length; i++) {
+ var s1 = samples[i];
+ sampleinput = sampleinput + "-I " + s1 + " "
+ }
+
+ return sampleinput;
+ }
- prefix: "-O"
valueFrom: $(inputs.sample).g.vcf.gz
outputs:
gvcf:
type: File
+ secondaryFiles:
+ - .tbi
outputBinding:
glob: "*vcf.gz"
sample: string
outputs:
- genotypegvcf:
+ filteredgvcf:
type: File
outputBinding:
- glob: "*selected.g.vcf.gz"
+ glob: "*g.vcf.gz"
baseCommand: /gatk/gatk
- prefix: "--remove-unused-alternates"
valueFrom: "true"
- prefix: "-V"
- valueFrom: $(inputs.gvcf)
+ valueFrom: $(inputs.gvcf.path)
- prefix: "-O"
- valueFrom: $(inputs.sample)selected.g.vcf.gz
+ valueFrom: selected$(inputs.gvcf.basename)
outputs:
gvcf:
type: File
- outputSource: haplotypecaller/gvcf
+ outputSource: selectvariants/filteredgvcf
steps:
basecalibrator:
sample: sample
intervallist: intervallist
out: [gvcf]
+ selectvariants:
+ run: gatk-selectvariants.cwl
+ in:
+ gvcf: haplotypecaller/gvcf
+ reference: reference
+ sample: sample
+ out: [filteredgvcf]
--- /dev/null
+$namespaces:
+ arv: "http://arvados.org/cwl#"
+ cwltool: "http://commonwl.org/cwltool#"
+class: ExpressionTool
+cwlVersion: v1.1
+label: Create array of gvcfs to process
+requirements:
+ InlineJavascriptRequirement: {}
+inputs:
+ gvcfdir:
+ type: Directory
+ label: Input directory of gvcfs
+ loadListing: 'shallow_listing'
+outputs:
+ sampleinput:
+ type: string
+expression: |
+ ${
+ var samples = [];
+ for (var i = 0; i < inputs.gvcfdir.listing.length; i++) {
+ var name = inputs.gvcfdir.listing[i];
+ if (name.nameext ==='.gz' ) {
+ samples.push(name.basename);
+ }
+ }
+ samples = samples.sort();
+ var sampleinput = [];
+
+ for (var i = 0; i < samples.length; i++) {
+ var s1 = samples[i];
+ sampleinput = sampleinput + "-I " + s1 + " "
+ }
+
+
+ return {"sampleinput": sampleinput};
+
+ }
bam: File
outputs:
- bam:
+ indexedbam:
type: File
outputBinding:
glob: "*bam"
DockerRequirement:
dockerPull: curii/bwa-samtools-picard
ShellCommandRequirement: {}
- InitialWorkDirRequirement:
- listing:
- - $(inputs.bam)
ResourceRequirement:
ramMin: 20000
coresMin: 4
sample: string
outputs:
- bam:
+ sortedbam:
type: File
outputBinding:
glob: "*sorted.bam"
- sort
- -@
- $(runtime.cores)
- - $(inputs.bam.basename)
+ - $(inputs.bam.path)
- -m
- '2G'
- -o
scattercount: string
outputs:
- gvcf:
- type: File[]
- outputSource: recal-haplotypecaller/gvcf
-
+ gatheredgvcf:
+ type: File
+ secondaryFiles:
+ - .tbi
+ outputSource: merge-GVCFs/gatheredgvcf
+
steps:
splitintervals:
run: gatk-splitintervals.cwl
knownsites1: knownsites1
intervallist: splitintervals/intervalfiles
out: [gvcf]
+
+ merge-GVCFs:
+ run: gather-array-vcf.cwl
+ in:
+ gvcfarray: recal-haplotypecaller/gvcf
+ sample: sample
+ reference: reference
+ out: [gatheredgvcf]