Skip to content

Commit 8479670

Browse files
authored
Merge pull request #105 from icgc-argo/payload-gen-seq-experiment@0.3.0
[release]
2 parents ee7e9dc + 7665e4f commit 8479670

34 files changed

Lines changed: 1075 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: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
*.py[cod]
2+
3+
# C extensions
4+
*.so
5+
6+
# Packages
7+
*.egg
8+
*.egg-info
9+
dist
10+
build
11+
eggs
12+
.eggs
13+
parts
14+
bin
15+
var
16+
sdist
17+
develop-eggs
18+
.installed.cfg
19+
lib
20+
lib64
21+
venv*/
22+
pyvenv*/
23+
24+
# Installer logs
25+
pip-log.txt
26+
27+
# Unit test / coverage reports
28+
.coverage
29+
.tox
30+
.coverage.*
31+
nosetests.xml
32+
coverage.xml
33+
htmlcov
34+
35+
# Translations
36+
*.mo
37+
38+
# Mr Developer
39+
.mr.developer.cfg
40+
.project
41+
.pydevproject
42+
.idea
43+
*.iml
44+
*.komodoproject
45+
46+
# Complexity
47+
output/*.html
48+
output/*/index.html
49+
50+
# Sphinx
51+
docs/_build
52+
53+
.DS_Store
54+
*~
55+
.*.sw[po]
56+
.build
57+
.ve
58+
.env
59+
.cache
60+
.pytest
61+
.bootstrap
62+
.appveyor.token
63+
*.bak
64+
*.log
65+
.vscode
66+
.python-version
67+
.nextflow*
68+
work
69+
outdir
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3.7.5-slim-buster
2+
3+
LABEL org.opencontainers.image.source https://github.com/icgc-argo/data-processing-utility-tools
4+
5+
ENV PATH="/tools:${PATH}"
6+
7+
COPY *.py /tools/
8+
9+
CMD ["/bin/bash"]

payload-gen-seq-experiment/main.nf

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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+
Junjun Zhang
22+
*/
23+
24+
/********************************************************************/
25+
/* this block is auto-generated based on info from pkg.json where */
26+
/* changes can be made if needed, do NOT modify this block manually */
27+
nextflow.enable.dsl = 2
28+
version = '0.3.0' // package version
29+
30+
container = [
31+
'ghcr.io': 'ghcr.io/icgc-argo/data-processing-utility-tools.payload-gen-seq-experiment'
32+
]
33+
default_container_registry = 'ghcr.io'
34+
/********************************************************************/
35+
36+
37+
// universal params go here
38+
params.container_registry = ""
39+
params.container_version = ""
40+
params.container = ""
41+
42+
params.cpus = 1
43+
params.mem = 1 // GB
44+
params.publish_dir = "" // set to empty string will disable publishDir
45+
46+
47+
// tool specific parmas go here, add / change as needed
48+
params.metadata_json = "NO_FILE1"
49+
params.experiment_info_tsv = "NO_FILE2"
50+
params.read_group_info_tsv = "NO_FILE3"
51+
params.file_info_tsv = "NO_FILE4"
52+
53+
54+
process payloadGenSeqExperiment {
55+
container "${params.container ?: container[params.container_registry ?: default_container_registry]}:${params.container_version ?: version}"
56+
publishDir "${params.publish_dir}/${task.process.replaceAll(':', '_')}", mode: "copy", enabled: params.publish_dir
57+
58+
cpus params.cpus
59+
memory "${params.mem} GB"
60+
61+
input:
62+
path metadata_json
63+
path experiment_info_tsv
64+
path read_group_info_tsv
65+
path file_info_tsv
66+
67+
output:
68+
path "*.sequencing_experiment.payload.json", emit: payload
69+
70+
script:
71+
args_metadata_json = !metadata_json.name.startsWith("NO_FILE") ? "-m ${metadata_json}" : ""
72+
args_experiment_info_tsv = !experiment_info_tsv.name.startsWith("NO_FILE") ? "-x ${experiment_info_tsv}" : ""
73+
args_read_group_info_tsv = !read_group_info_tsv.name.startsWith("NO_FILE") ? "-r ${read_group_info_tsv}" : ""
74+
args_file_info_tsv = !file_info_tsv.name.startsWith("NO_FILE") ? "-f ${file_info_tsv}" : ""
75+
76+
"""
77+
main.py \
78+
${args_metadata_json} \
79+
${args_experiment_info_tsv} \
80+
${args_read_group_info_tsv} \
81+
${args_file_info_tsv}
82+
"""
83+
}
84+
85+
86+
// this provides an entry point for this main script, so it can be run directly without clone the repo
87+
// using this command: nextflow run <git_acc>/<repo>/<pkg_name>/<main_script>.nf -r <pkg_name>.v<pkg_version> --params-file xxx
88+
workflow {
89+
payloadGenSeqExperiment(
90+
file(params.metadata_json),
91+
file(params.experiment_info_tsv),
92+
file(params.read_group_info_tsv),
93+
file(params.file_info_tsv)
94+
)
95+
}

0 commit comments

Comments
 (0)