From 5b4f2a85bedfad9e72e406e3e1990afc913c9da2 Mon Sep 17 00:00:00 2001 From: swz Date: Thu, 15 Sep 2022 12:44:44 +0000 Subject: [PATCH] Adding RNA-Seq demo no issue # Arvados-DCO-1.1-Signed-off-by: Sarah Wait Zaranek --- .licenseignore | 1 + RNA-Seq/cwl/RNA-seq-wf.cwl | 50 ++++++++++++++++++++++++++++ RNA-Seq/cwl/helper/alignment.cwl | 48 ++++++++++++++++++++++++++ RNA-Seq/cwl/helper/featureCounts.cwl | 25 ++++++++++++++ RNA-Seq/cwl/helper/subdirs.cwl | 22 ++++++++++++ RNA-Seq/docker/Dockerfile | 14 ++++++++ 6 files changed, 160 insertions(+) create mode 100644 RNA-Seq/cwl/RNA-seq-wf.cwl create mode 100644 RNA-Seq/cwl/helper/alignment.cwl create mode 100644 RNA-Seq/cwl/helper/featureCounts.cwl create mode 100644 RNA-Seq/cwl/helper/subdirs.cwl create mode 100644 RNA-Seq/docker/Dockerfile diff --git a/.licenseignore b/.licenseignore index 35252fd..e617614 100644 --- a/.licenseignore +++ b/.licenseignore @@ -1 +1,2 @@ LICENSE.txt +* diff --git a/RNA-Seq/cwl/RNA-seq-wf.cwl b/RNA-Seq/cwl/RNA-seq-wf.cwl new file mode 100644 index 0000000..97461ce --- /dev/null +++ b/RNA-Seq/cwl/RNA-seq-wf.cwl @@ -0,0 +1,50 @@ +cwlVersion: v1.2 +class: Workflow +label: RNAseq CWL practice workflow + +inputs: + fq: File[] + genome: Directory + gtf: File + +steps: + alignment: + run: alignment.cwl + scatter: fq + in: + fq: fq + genome: genome + gtf: gtf + out: [qc_html, bam_sorted_indexed] + + featureCounts: + requirements: + ResourceRequirement: + ramMin: 500 + run: featureCounts.cwl + in: + counts_input_bam: alignment/bam_sorted_indexed + gtf: gtf + out: [featurecounts] + + ### 2. Organizing output files into Directories + output-subdirs: + run: subdirs.cwl + in: + fq: fq + bams: alignment/bam_sorted_indexed + qc: alignment/qc_html + out: [dirs] + +outputs: + dirs: + type: Directory[] + outputSource: output-subdirs/dirs + + featurecounts: + type: File + outputSource: featureCounts/featurecounts + +requirements: + SubworkflowFeatureRequirement: {} + ScatterFeatureRequirement: {} diff --git a/RNA-Seq/cwl/helper/alignment.cwl b/RNA-Seq/cwl/helper/alignment.cwl new file mode 100644 index 0000000..6712aae --- /dev/null +++ b/RNA-Seq/cwl/helper/alignment.cwl @@ -0,0 +1,48 @@ +cwlVersion: v1.2 +class: Workflow +label: RNAseq CWL practice workflow + +inputs: + fq: File + genome: Directory + gtf: File + +requirements: + StepInputExpressionRequirement: {} + +steps: + fastqc: + run: bio-cwl-tools/fastqc/fastqc_2.cwl + in: + reads_file: fq + out: [html_file] + + STAR: + requirements: + ResourceRequirement: + ramMin: 9000 + run: bio-cwl-tools/STAR/STAR-Align.cwl + in: + RunThreadN: {default: 4} + GenomeDir: genome + ForwardReads: fq + OutSAMtype: {default: BAM} + SortedByCoordinate: {default: true} + OutSAMunmapped: {default: Within} + ### 1. Expressions on step inputs + OutFileNamePrefix: {valueFrom: "$(inputs.ForwardReads.nameroot)."} + out: [alignment] + + samtools: + run: bio-cwl-tools/samtools/samtools_index.cwl + in: + bam_sorted: STAR/alignment + out: [bam_sorted_indexed] + +outputs: + qc_html: + type: File + outputSource: fastqc/html_file + bam_sorted_indexed: + type: File + outputSource: samtools/bam_sorted_indexed diff --git a/RNA-Seq/cwl/helper/featureCounts.cwl b/RNA-Seq/cwl/helper/featureCounts.cwl new file mode 100644 index 0000000..a17163f --- /dev/null +++ b/RNA-Seq/cwl/helper/featureCounts.cwl @@ -0,0 +1,25 @@ +cwlVersion: v1.2 +class: CommandLineTool + +inputs: + gtf: File + counts_input_bam: + - File + - File[] + +baseCommand: featureCounts + +arguments: [-T, $(runtime.cores), + -a, $(inputs.gtf), + -o, featurecounts.tsv, + $(inputs.counts_input_bam)] + +outputs: + featurecounts: + type: File + outputBinding: + glob: featurecounts.tsv + +hints: + DockerRequirement: + dockerPull: quay.io/biocontainers/subread:1.5.0p3--0 diff --git a/RNA-Seq/cwl/helper/subdirs.cwl b/RNA-Seq/cwl/helper/subdirs.cwl new file mode 100644 index 0000000..fc4fe7d --- /dev/null +++ b/RNA-Seq/cwl/helper/subdirs.cwl @@ -0,0 +1,22 @@ +cwlVersion: v1.2 +class: ExpressionTool +requirements: + InlineJavascriptRequirement: {} +inputs: + fq: File[] + bams: File[] + qc: File[] +outputs: + dirs: Directory[] +expression: |- + ${ + var dirs = []; + for (var i = 0; i < inputs.bams.length; i++) { + dirs.push({ + "class": "Directory", + "basename": inputs.fq[i].nameroot, + "listing": [inputs.bams[i], inputs.qc[i]] + }); + } + return {"dirs": dirs}; + } diff --git a/RNA-Seq/docker/Dockerfile b/RNA-Seq/docker/Dockerfile new file mode 100644 index 0000000..e66754d --- /dev/null +++ b/RNA-Seq/docker/Dockerfile @@ -0,0 +1,14 @@ +FROM debian:10-slim +MAINTAINER Peter Amstutz + +RUN apt-get update -qy +RUN apt-get install -qy build-essential wget unzip zlib1g-dev + +# Install BWA 07.7.17 +RUN wget https://github.com/lh3/bwa/archive/v0.7.17.zip && \ + unzip v0.7.17 && \ + cd bwa-0.7.17 && \ + make && \ + cp bwa /usr/bin && \ + cd .. && \ + rm -rf bwa-0.7.17 -- 2.30.2