Skip to content

Commit 4f452e4

Browse files
authored
Merge pull request #144 from icgc-argo-workflows/payload-gen-rna-alignment@0.1.0
[release]
2 parents f0e555d + 26e0af0 commit 4f452e4

23 files changed

Lines changed: 1084 additions & 0 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.gitignore
2+
.nextflow*
3+
tests
4+
work
5+
outdir
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM quay.io/icgc-argo/dna-seq-processing-tools:base-docker.0.2.1
2+
3+
LABEL org.opencontainers.image.source https://github.com/icgc-argo-workflows/data-processing-utility-tools
4+
5+
ENV PATH="/tools:${PATH}"
6+
7+
COPY *.py /tools/
8+
9+
ENTRYPOINT ["/usr/bin/env"]
10+
11+
CMD ["/bin/bash"]

payload-gen-rna-alignment/main.nf

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#!/usr/bin/env nextflow
2+
3+
/*
4+
Copyright (C) 2021, Ontario Institute for Cancer Research
5+
6+
This program is free software: you can redistribute it and/or modify
7+
it under the terms of the GNU Affero General Public License as published by
8+
the Free Software Foundation, either version 3 of the License, or
9+
(at your option) any later version.
10+
11+
This program is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU Affero General Public License for more details.
15+
16+
You should have received a copy of the GNU Affero General Public License
17+
along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
19+
Authors:
20+
Linda Xiang
21+
*/
22+
23+
/********************************************************************/
24+
/* this block is auto-generated based on info from pkg.json where */
25+
/* changes can be made if needed, do NOT modify this block manually */
26+
nextflow.enable.dsl = 2
27+
version = '0.1.0' // package version
28+
29+
container = [
30+
'ghcr.io': 'ghcr.io/icgc-argo-workflows/data-processing-utility-tools.payload-gen-rna-alignment'
31+
]
32+
default_container_registry = 'ghcr.io'
33+
/********************************************************************/
34+
35+
36+
// universal params go here
37+
params.container_registry = ""
38+
params.container_version = ""
39+
params.container = ""
40+
41+
params.cpus = 1
42+
params.mem = 1 // GB
43+
params.publish_dir = "" // set to empty string will disable publishDir
44+
45+
46+
// tool specific parmas go here, add / change as needed
47+
params.files_to_upload = ""
48+
params.seq_experiment_analysis = ""
49+
params.wf_name = ""
50+
params.wf_version = ""
51+
params.aligner = ""
52+
params.genome_annotation = ""
53+
params.genome_build = ""
54+
55+
56+
process payloadGenRnaAlignment {
57+
container "${params.container ?: container[params.container_registry ?: default_container_registry]}:${params.container_version ?: version}"
58+
publishDir "${params.publish_dir}/${task.process.replaceAll(':', '_')}", mode: "copy", enabled: params.publish_dir
59+
60+
cpus params.cpus
61+
memory "${params.mem} GB"
62+
63+
input: // input, make update as needed
64+
path files_to_upload
65+
path seq_experiment_analysis
66+
val aligner
67+
val analysis_type
68+
val genome_annotation
69+
val genome_build
70+
val wf_name
71+
val wf_version
72+
73+
output: // output, make update as needed
74+
path "*.payload.json", emit: payload
75+
path "out/*", emit: files_to_upload
76+
path "out/*{.cram,.cram.crai}", emit: cram, optional: true
77+
path "out/*{.bam,.bam.bai}", emit: bam, optional: true
78+
path "out/*.splice_junctions.txt", emit: splice_junctions, optional: true
79+
path "out/*.supplement.tgz", emit: supplement, optional: true
80+
path "out/*{.fastqc.tgz,.collectrnaseqmetrics.tgz,.duplicates_metrics.tgz}", emit: qc_metrics, optional: true
81+
82+
script:
83+
// add and initialize variables here as needed
84+
arg_aligner = aligner ? "-l ${aligner}": ""
85+
86+
"""
87+
main.py \
88+
-f ${files_to_upload} \
89+
-a ${seq_experiment_analysis} \
90+
-t ${analysis_type} \
91+
-g "${genome_annotation}" \
92+
-b "${genome_build}" \
93+
-w "${wf_name}" \
94+
-r ${workflow.runName} \
95+
-s ${workflow.sessionId} \
96+
-v ${wf_version} ${arg_aligner}
97+
98+
"""
99+
}
100+
101+
102+
// this provides an entry point for this main script, so it can be run directly without clone the repo
103+
// using this command: nextflow run <git_acc>/<repo>/<pkg_name>/<main_script>.nf -r <pkg_name>.v<pkg_version> --params-file xxx
104+
workflow {
105+
payloadGenRnaAlignment(
106+
Channel.fromPath(params.files_to_upload).collect(),
107+
file(params.seq_experiment_analysis),
108+
params.aligner,
109+
params.analysis_type,
110+
params.genome_annotation,
111+
params.genome_build,
112+
params.wf_name,
113+
params.wf_version
114+
)
115+
}
116+

0 commit comments

Comments
 (0)