From 2ecb060e0ae9266132f261c3a14526e7038abf64 Mon Sep 17 00:00:00 2001 From: Sarah Wait Zaranek Date: Tue, 21 Apr 2020 01:31:20 +0000 Subject: [PATCH] updating cwl Arvados-DCO-1.1-Signed-off-by: Sarah Wait Zaranek no issue # --- cwl/bwamem-samtools-view.cwl | 16 +++++++-- cwl/calc-coverage.cwl | 39 ++++++++++++++++++++++ cwl/check-sam.cwl | 51 ++++++++++++++++++++++++++++ cwl/fix-groups.cwl | 43 ++++++++++++++++++++++++ cwl/gatk-haplotypecaller.cwl | 13 ++++++-- cwl/mark-duplicates.cwl | 44 ++++++++++++++++++++++++ cwl/old/bwa-gatk-wf.cwl | 65 ++++++++++++++++++++++++++++++++++++ cwl/old/samtools-sort.cwl | 30 +++++++++++++++++ cwl/samtools-fixmate.cwl | 37 ++++++++++++++++++++ cwl/samtools-index.cwl | 8 +++++ cwl/samtools-sort.cwl | 22 +++++++++--- 11 files changed, 359 insertions(+), 9 deletions(-) create mode 100644 cwl/calc-coverage.cwl create mode 100644 cwl/check-sam.cwl create mode 100644 cwl/fix-groups.cwl create mode 100644 cwl/mark-duplicates.cwl create mode 100644 cwl/old/bwa-gatk-wf.cwl create mode 100644 cwl/old/samtools-sort.cwl create mode 100644 cwl/samtools-fixmate.cwl diff --git a/cwl/bwamem-samtools-view.cwl b/cwl/bwamem-samtools-view.cwl index 044ef74..efc423e 100644 --- a/cwl/bwamem-samtools-view.cwl +++ b/cwl/bwamem-samtools-view.cwl @@ -1,6 +1,9 @@ cwlVersion: v1.1 class: CommandLineTool label: Realigning fastqs and converting output to bam +$namespaces: + arv: "http://arvados.org/cwl#" + cwltool: "http://commonwl.org/cwltool#" requirements: DockerRequirement: @@ -8,7 +11,11 @@ requirements: ShellCommandRequirement: {} ResourceRequirement: ramMin: 26000 - coresMin: 8 + coresMin: 16 + +hints: + arv:RuntimeConstraints: + outputDirType: keep_output_dir inputs: reference: @@ -36,17 +43,22 @@ outputs: arguments: - /bwa-0.7.17/bwa - mem + - -M - -t - $(runtime.cores) - $(inputs.reference) - -R - - "@RG\\tID:sample\\tSM:sample\\tLB:sample\\tPL:ILLUMINA" + - '@RG\tID:sample\tSM:sample\tLB:sample\tPL:ILLUMINA\tPU:sample1' + - -c + - 250 - $(inputs.fastq1) - $(inputs.fastq2) - shellQuote: false valueFrom: '|' - samtools - view + - -@ + - $(runtime.cores) - -b - -S - shellQuote: false diff --git a/cwl/calc-coverage.cwl b/cwl/calc-coverage.cwl new file mode 100644 index 0000000..b1e9373 --- /dev/null +++ b/cwl/calc-coverage.cwl @@ -0,0 +1,39 @@ +cwlVersion: v1.1 +class: CommandLineTool +label: Marking Duplicates using Picard + +requirements: + DockerRequirement: + dockerPull: broadinstitute/gatk + +hints: + ResourceRequirement: + ramMin: 20000 + coresMin: 4 + +inputs: + bam: + type: File + +outputs: + dupbam: + type: File + outputBinding: + glob: "*.bam" + dupmetrics: + type: File + outputBinding: + glob: "*.txt" + +baseCommand: /gatk/gatk + +arguments: + - "--java-options" + - "-Xmx8G" + - MarkDuplicates + - prefix: "-I" + valueFrom: $(inputs.bam.path) + - prefix: "-O" + valueFrom: marked_dups$(inputs.bam.basename) + - prefix: "-M" + valueFrom: "metrics.txt" diff --git a/cwl/check-sam.cwl b/cwl/check-sam.cwl new file mode 100644 index 0000000..df15439 --- /dev/null +++ b/cwl/check-sam.cwl @@ -0,0 +1,51 @@ +cwlVersion: v1.1 +class: CommandLineTool +label: Validate Sam using Picard + +requirements: + DockerRequirement: + dockerPull: broadinstitute/gatk + InitialWorkDirRequirement: + listing: + - $(inputs.sam) + +hints: + ResourceRequirement: + ramMin: 20000 + coresMin: 4 + +inputs: + sam: + type: File + + reference: + type: File + secondaryFiles: + - .amb + - .ann + - .bwt + - .pac + - .sa + - .fai + - ^.dict + +outputs: + metrics: + type: File + outputBinding: + glob: "*.txt" + +baseCommand: /gatk/gatk + +arguments: + - "--java-options" + - "-Xmx8G" + - ValidateSamFile + - prefix: "-I" + valueFrom: $(inputs.sam.basename) + - prefix: "-M" + valueFrom: "SUMMARY" + - prefix: "-O" + valueFrom: "metrics.txt" + - prefix: "-R" + valueFrom: $(inputs.reference.path) diff --git a/cwl/fix-groups.cwl b/cwl/fix-groups.cwl new file mode 100644 index 0000000..475814e --- /dev/null +++ b/cwl/fix-groups.cwl @@ -0,0 +1,43 @@ +cwlVersion: v1.1 +class: CommandLineTool +label: Marking Duplicates using Picard + +requirements: + DockerRequirement: + dockerPull: broadinstitute/gatk + +hints: + ResourceRequirement: + ramMin: 20000 + coresMin: 4 + +inputs: + bam: + type: File + +outputs: + fixedrgbam: + type: File + outputBinding: + glob: "*.bam" + +baseCommand: /gatk/gatk + +arguments: + - "--java-options" + - "-Xmx8G" + - AddOrReplaceReadGroups + - prefix: "-I" + valueFrom: $(inputs.bam.path) + - prefix: "-O" + valueFrom: fixedrg$(inputs.bam.basename) + - prefix: "-ID" + valueFrom: "H0164.2" + - prefix: "-LB" + valueFrom: "library1" + - prefix: "-PL" + valueFrom: "illumina" + - prefix: "-PU" + valueFrom: "H0164ALXX140820.2" + - prefix: "-SM" + valueFrom: "sample1" diff --git a/cwl/gatk-haplotypecaller.cwl b/cwl/gatk-haplotypecaller.cwl index f101783..9679d2a 100644 --- a/cwl/gatk-haplotypecaller.cwl +++ b/cwl/gatk-haplotypecaller.cwl @@ -2,6 +2,10 @@ cwlVersion: v1.1 class: CommandLineTool label: Germline variant calling using GATK with output gvcf +$namespaces: + arv: "http://arvados.org/cwl#" + cwltool: "http://commonwl.org/cwltool#" + requirements: DockerRequirement: dockerPull: broadinstitute/gatk @@ -10,9 +14,12 @@ requirements: - $(inputs.bam) hints: + arv:RuntimeConstraints: + outputDirType: keep_output_dir + keep_cache: 1024 ResourceRequirement: - ramMin: 20000 - coresMin: 4 + ramMin: 5000 + coresMin: 2 inputs: bam: @@ -41,7 +48,7 @@ baseCommand: /gatk/gatk arguments: - "--java-options" - - "-Xmx8G" + - "-Xmx4G" - HaplotypeCaller - prefix: "-R" valueFrom: $(inputs.reference) diff --git a/cwl/mark-duplicates.cwl b/cwl/mark-duplicates.cwl new file mode 100644 index 0000000..8cdbb9b --- /dev/null +++ b/cwl/mark-duplicates.cwl @@ -0,0 +1,44 @@ +cwlVersion: v1.1 +class: CommandLineTool +label: Marking Duplicates using Picard +$namespaces: + arv: "http://arvados.org/cwl#" + cwltool: "http://commonwl.org/cwltool#" + +requirements: + DockerRequirement: + dockerPull: broadinstitute/gatk + +hints: + ResourceRequirement: + ramMin: 20000 + coresMin: 4 + arv:RuntimeConstraints: + outputDirType: keep_output_dir + +inputs: + bam: + type: File + +outputs: + dupbam: + type: File + outputBinding: + glob: "*.bam" + dupmetrics: + type: File + outputBinding: + glob: "*.txt" + +baseCommand: /gatk/gatk + +arguments: + - "--java-options" + - "-Xmx8G" + - MarkDuplicates + - prefix: "-I" + valueFrom: $(inputs.bam.path) + - prefix: "-O" + valueFrom: marked_dups$(inputs.bam.basename) + - prefix: "-M" + valueFrom: "metrics.txt" diff --git a/cwl/old/bwa-gatk-wf.cwl b/cwl/old/bwa-gatk-wf.cwl new file mode 100644 index 0000000..56c1758 --- /dev/null +++ b/cwl/old/bwa-gatk-wf.cwl @@ -0,0 +1,65 @@ +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 + +outputs: + qc-html: + type: File[] + outputSource: fastqc/out-html + qc-zip: + type: File[] + outputSource: fastqc/out-zip + vcf: + type: File + outputSource: haplotypecaller/vcf + +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: [out] + samtools-index: + run: samtools-index.cwl + in: + bam: samtools-sort/out + out: [out] + haplotypecaller: + run: gatk-haplotypecaller.cwl + in: + reference: reference + bam: samtools-index/out + sample: sample + out: [vcf] diff --git a/cwl/old/samtools-sort.cwl b/cwl/old/samtools-sort.cwl new file mode 100644 index 0000000..cc7c23f --- /dev/null +++ b/cwl/old/samtools-sort.cwl @@ -0,0 +1,30 @@ +cwlVersion: v1.1 +class: CommandLineTool + +requirements: + DockerRequirement: + dockerPull: curii/bwa-samtools-picard + ShellCommandRequirement: {} + ResourceRequirement: + ramMin: 10000 + coresMin: 4 + +inputs: + bam: File + sample: string + +outputs: + out: + type: File + outputBinding: + glob: "*sorted.bam" + +baseCommand: samtools + +arguments: + - sort + - -t + - $(runtime.cores) + - $(inputs.bam) + - -o + - $(runtime.outdir)/$(inputs.sample).sorted.bam diff --git a/cwl/samtools-fixmate.cwl b/cwl/samtools-fixmate.cwl new file mode 100644 index 0000000..61d5c1f --- /dev/null +++ b/cwl/samtools-fixmate.cwl @@ -0,0 +1,37 @@ +cwlVersion: v1.1 +class: CommandLineTool + +$namespaces: + arv: "http://arvados.org/cwl#" + cwltool: "http://commonwl.org/cwltool#" + +requirements: + DockerRequirement: + dockerPull: curii/bwa-samtools-picard + ShellCommandRequirement: {} + ResourceRequirement: + ramMin: 10000 + coresMin: 4 + +hints: + arv:RuntimeConstraints: + outputDirType: keep_output_dir + +inputs: + bam: File + sample: string + +outputs: + out: + type: File + outputBinding: + glob: "*fixed.bam" + +baseCommand: samtools + +arguments: + - fixmate + - -O + - "bam" + - $(inputs.bam.path) + - $(runtime.outdir)/$(inputs.sample).fixed.bam diff --git a/cwl/samtools-index.cwl b/cwl/samtools-index.cwl index 58ccbf7..3876f3d 100644 --- a/cwl/samtools-index.cwl +++ b/cwl/samtools-index.cwl @@ -1,6 +1,10 @@ cwlVersion: v1.1 class: CommandLineTool +$namespaces: + arv: "http://arvados.org/cwl#" + cwltool: "http://commonwl.org/cwltool#" + requirements: DockerRequirement: dockerPull: curii/bwa-samtools-picard @@ -8,6 +12,10 @@ requirements: listing: - $(inputs.bam) +hints: + arv:RuntimeConstraints: + outputDirType: keep_output_dir + inputs: bam: File diff --git a/cwl/samtools-sort.cwl b/cwl/samtools-sort.cwl index cc7c23f..c94d681 100644 --- a/cwl/samtools-sort.cwl +++ b/cwl/samtools-sort.cwl @@ -1,14 +1,26 @@ cwlVersion: v1.1 class: CommandLineTool +$namespaces: + arv: "http://arvados.org/cwl#" + cwltool: "http://commonwl.org/cwltool#" + requirements: DockerRequirement: dockerPull: curii/bwa-samtools-picard ShellCommandRequirement: {} + InitialWorkDirRequirement: + listing: + - $(inputs.bam) ResourceRequirement: - ramMin: 10000 + ramMin: 20000 coresMin: 4 +hints: + arv:RuntimeConstraints: + keep_cache: 9216 + outputDirType: keep_output_dir + inputs: bam: File sample: string @@ -23,8 +35,10 @@ baseCommand: samtools arguments: - sort - - -t + - -@ - $(runtime.cores) - - $(inputs.bam) + - $(inputs.bam.basename) + - -m + - '2G' - -o - - $(runtime.outdir)/$(inputs.sample).sorted.bam + - $(inputs.sample).sorted.bam -- 2.30.2