Skip to content

Commit 5ae7101

Browse files
committed
added starting template for payload-gen-variant-filtering@0.1.0
1 parent 10f99df commit 5ae7101

20 files changed

Lines changed: 483 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"]
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
lindaxiang
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/data-processing-utility-tools.payload-gen-variant-filtering'
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.input_file = ""
48+
params.output_pattern = "*" // output file name pattern
49+
50+
51+
process payloadGenVariantFiltering {
52+
container "${params.container ?: container[params.container_registry ?: default_container_registry]}:${params.container_version ?: version}"
53+
publishDir "${params.publish_dir}/${task.process.replaceAll(':', '_')}", mode: "copy", enabled: params.publish_dir
54+
55+
cpus params.cpus
56+
memory "${params.mem} GB"
57+
58+
input: // input, make update as needed
59+
path input_file
60+
61+
output: // output, make update as needed
62+
path "output_dir/${params.output_pattern}", emit: output_file
63+
64+
script:
65+
// add and initialize variables here as needed
66+
67+
"""
68+
mkdir -p output_dir
69+
70+
main.py \
71+
-i ${input_file} \
72+
-o output_dir
73+
74+
"""
75+
}
76+
77+
78+
// this provides an entry point for this main script, so it can be run directly without clone the repo
79+
// using this command: nextflow run <git_acc>/<repo>/<pkg_name>/<main_script>.nf -r <pkg_name>.v<pkg_version> --params-file xxx
80+
workflow {
81+
payloadGenVariantFiltering(
82+
file(params.input_file)
83+
)
84+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
4+
"""
5+
Copyright (C) 2021, Ontario Institute for Cancer Research
6+
7+
This program is free software: you can redistribute it and/or modify
8+
it under the terms of the GNU Affero General Public License as published by
9+
the Free Software Foundation, either version 3 of the License, or
10+
(at your option) any later version.
11+
12+
This program is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU Affero General Public License for more details.
16+
17+
You should have received a copy of the GNU Affero General Public License
18+
along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
20+
Authors:
21+
lindaxiang
22+
"""
23+
24+
import os
25+
import sys
26+
import argparse
27+
import subprocess
28+
29+
30+
def main():
31+
"""
32+
Python implementation of tool: payload-gen-variant-filtering
33+
34+
This is auto-generated Python code, please update as needed!
35+
"""
36+
37+
parser = argparse.ArgumentParser(description='Tool: payload-gen-variant-filtering')
38+
parser.add_argument('-i', '--input-file', dest='input_file', type=str,
39+
help='Input file', required=True)
40+
parser.add_argument('-o', '--output-dir', dest='output_dir', type=str,
41+
help='Output directory', required=True)
42+
args = parser.parse_args()
43+
44+
if not os.path.isfile(args.input_file):
45+
sys.exit('Error: specified input file %s does not exist or is not accessible!' % args.input_file)
46+
47+
if not os.path.isdir(args.output_dir):
48+
sys.exit('Error: specified output dir %s does not exist or is not accessible!' % args.output_dir)
49+
50+
subprocess.run(f"cp {args.input_file} {args.output_dir}/", shell=True, check=True)
51+
52+
53+
if __name__ == "__main__":
54+
main()
55+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
docker {
2+
enabled = true
3+
runOptions = '-u \$(id -u):\$(id -g)'
4+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/env nextflow
2+
3+
/********************************************************************/
4+
/* this block is auto-generated based on info from pkg.json where */
5+
/* changes can be made if needed, do NOT modify this block manually */
6+
nextflow.enable.dsl = 2
7+
version = '0.1.0' // package version
8+
9+
container = [
10+
'ghcr.io': 'ghcr.io/icgc-argo/data-processing-utility-tools.payload-gen-variant-filtering'
11+
]
12+
default_container_registry = 'ghcr.io'
13+
/********************************************************************/
14+
15+
16+
// universal params go here
17+
params.container_registry = ""
18+
params.container_version = ""
19+
params.container = ""
20+
21+
params.cpus = 1
22+
params.mem = 1 // GB
23+
params.publish_dir = "" // set to empty string will disable publishDir
24+
25+
26+
// tool specific parmas go here, add / change as needed
27+
params.input_file = ""
28+
params.output_pattern = "*.html" // fastqc output html report
29+
30+
31+
process payloadGenVariantFiltering {
32+
container "${params.container ?: container[params.container_registry ?: default_container_registry]}:${params.container_version ?: version}"
33+
publishDir "${params.publish_dir}/${task.process.replaceAll(':', '_')}", mode: "copy", enabled: "${params.publish_dir ? true : ''}"
34+
35+
cpus params.cpus
36+
memory "${params.mem} GB"
37+
38+
input: // input, make update as needed
39+
path input_file
40+
41+
output: // output, make update as needed
42+
path "output_dir/${params.output_pattern}", emit: output_file
43+
44+
script:
45+
// add and initialize variables here as needed
46+
47+
"""
48+
mkdir -p output_dir
49+
50+
payload-gen-variant-filtering.py \
51+
-i ${input_file} \
52+
-o output_dir
53+
54+
"""
55+
}
56+
57+
58+
// this provides an entry point for this main script, so it can be run directly without clone the repo
59+
// using this command: nextflow run <git_acc>/<repo>/<pkg_name>/<main_script>.nf -r <pkg_name>.v<pkg_version> --params-file xxx
60+
workflow {
61+
payloadGenVariantFiltering(
62+
file(params.input_file)
63+
)
64+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
4+
import os
5+
import sys
6+
import argparse
7+
import subprocess
8+
9+
10+
def main():
11+
"""
12+
Python implementation of tool: payload-gen-variant-filtering
13+
14+
This is auto-generated Python code, please update as needed!
15+
"""
16+
17+
parser = argparse.ArgumentParser(description='Tool: payload-gen-variant-filtering')
18+
parser.add_argument('-i', '--input-file', dest='input_file', type=str,
19+
help='Input file', required=True)
20+
parser.add_argument('-o', '--output-dir', dest='output_dir', type=str,
21+
help='Output directory', required=True)
22+
args = parser.parse_args()
23+
24+
if not os.path.isfile(args.input_file):
25+
sys.exit('Error: specified input file %s does not exist or is not accessible!' % args.input_file)
26+
27+
if not os.path.isdir(args.output_dir):
28+
sys.exit('Error: specified output dir %s does not exist or is not accessible!' % args.output_dir)
29+
30+
subprocess.run(f"fastqc -o {args.output_dir} {args.input_file}", shell=True, check=True)
31+
32+
33+
if __name__ == "__main__":
34+
main()
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "payload-gen-variant-filtering",
3+
"version": "0.1.0",
4+
"description": "Tool to generate payload for filtered VCF",
5+
"main": "main.nf",
6+
"deprecated": false,
7+
"keywords": [
8+
"bioinformatics",
9+
"vcf",
10+
"filter",
11+
"payload"
12+
],
13+
"repository": {
14+
"type": "git",
15+
"url": "https://github.com/icgc-argo/data-processing-utility-tools.git"
16+
},
17+
"container": {
18+
"registries": [
19+
{
20+
"registry": "ghcr.io",
21+
"type": "docker",
22+
"org": "icgc-argo",
23+
"default": true
24+
}
25+
]
26+
},
27+
"dependencies": [],
28+
"devDependencies": [],
29+
"contributors": [
30+
{
31+
"name": "lindaxiang",
32+
"email": "linda.xiang@oicr.on.ca"
33+
}
34+
],
35+
"license": "GNU Affero General Public License v3",
36+
"bugReport": "https://github.com/icgc-argo/data-processing-utility-tools/issues",
37+
"homepage": "https://github.com/icgc-argo/data-processing-utility-tools#readme"
38+
}

0 commit comments

Comments
 (0)