Skip to content
This repository was archived by the owner on Aug 25, 2021. It is now read-only.

Commit ec91541

Browse files
authored
Merge pull request icgc-argo-workflows#2 from ICGC-TCGA-PanCancer/demo-fastqc1-wf@0.1.0
[release]
2 parents e5f56bd + 40d52a3 commit ec91541

23 files changed

Lines changed: 494 additions & 0 deletions

demo-fastqc1-wf/.gitignore

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

demo-fastqc1-wf/demo-fastqc1-wf.nf

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env nextflow
2+
3+
nextflow.enable.dsl = 2
4+
version = '0.1.0' // package version
5+
6+
// universal params go here, change default value as needed
7+
params.container = ""
8+
params.container_registry = ""
9+
params.container_version = ""
10+
params.cpus = 1
11+
params.mem = 1 // GB
12+
params.publish_dir = "" // set to empty string will disable publishDir
13+
14+
// tool specific parmas go here, add / change as needed
15+
params.input_file = ""
16+
params.cleanup = true
17+
18+
include { cleanupWorkdir; getSecondaryFiles; getBwaSecondaryFiles } from './wfpr_modules/github.com/icgc-argo/demo-wfpkgs/demo-utils@1.3.0/main.nf' params([*:params, 'cleanup': false])
19+
include { demoFastqc1 } from './wfpr_modules/github.com/icgc-tcga-pancancer/demo-pkgs1/demo-fastqc1@0.1.0/demo-fastqc1' params([*:params, 'cleanup': false])
20+
21+
22+
// please update workflow code as needed
23+
workflow DemoFastqc1Wf {
24+
take: // update as needed
25+
input_file
26+
27+
28+
main: // update as needed
29+
demoFastqc1(input_file)
30+
if (params.cleanup) { cleanupWorkdir(demoFastqc1.out, true) }
31+
32+
emit: // update as needed
33+
output_file = demoFastqc1.out.output_file
34+
}
35+
36+
37+
workflow {
38+
DemoFastqc1Wf(
39+
file(params.input_file)
40+
)
41+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env nextflow
2+
3+
/*
4+
This is an example process as a local module. Using local module is optional, in general
5+
is discouraged. A process can pentially be reused in different workflows should be developed
6+
in an independent package, so that it can be imported by anyone into any workflow.
7+
*/
8+
9+
nextflow.enable.dsl = 2
10+
11+
params.input_file = ""
12+
params.publish_dir = ""
13+
14+
15+
process demoCopyFile {
16+
publishDir "${params.publish_dir}/${task.process.replaceAll(':', '_')}", mode: "copy", enabled: "${params.publish_dir ? true : ''}"
17+
18+
input:
19+
path input_file
20+
21+
output:
22+
path "output_dir/*", emit: output_file
23+
24+
script:
25+
"""
26+
mkdir output_dir
27+
cp ${input_file} output_dir/
28+
"""
29+
}

demo-fastqc1-wf/nextflow.config

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+
}

demo-fastqc1-wf/pkg.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "demo-fastqc1-wf",
3+
"version": "0.1.0",
4+
"description": "FastQC workflow",
5+
"main": "demo-fastqc1-wf",
6+
"scripts": {
7+
"test": "wfpm test"
8+
},
9+
"deprecated": false,
10+
"keywords": [
11+
"bioinformatics",
12+
"seq",
13+
"qc metrics"
14+
],
15+
"repository": {
16+
"type": "git",
17+
"url": "https://github.com/icgc-tcga-pancancer/demo-pkgs2.git"
18+
},
19+
"dependencies": [
20+
"github.com/icgc-argo/demo-wfpkgs/demo-utils@1.3.0",
21+
"github.com/icgc-tcga-pancancer/demo-pkgs1/demo-fastqc1@0.1.0"
22+
],
23+
"devDependencies": [],
24+
"contributors": [
25+
{
26+
"name": "Junjun Zhang",
27+
"email": "junjun.ca@gmail.com"
28+
}
29+
],
30+
"license": "MIT",
31+
"bugReport": "https://github.com/icgc-tcga-pancancer/demo-pkgs2/issues",
32+
"homepage": "https://github.com/icgc-tcga-pancancer/demo-pkgs2#readme"
33+
}

demo-fastqc1-wf/tests/checker.nf

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env nextflow
2+
3+
/*
4+
This is an auto-generated checker workflow to test the generated main template workflow, it's
5+
meant to illustrate how testing works. Please update to suit your own needs.
6+
*/
7+
8+
nextflow.enable.dsl = 2
9+
version = '0.1.0' // package version
10+
11+
// universal params
12+
params.publish_dir = ""
13+
params.container = ""
14+
params.container_registry = ""
15+
params.container_version = ""
16+
17+
// tool specific parmas go here, add / change as needed
18+
params.input_file = ""
19+
params.expected_output = ""
20+
params.cleanup = false
21+
22+
include { DemoFastqc1Wf } from '../demo-fastqc1-wf' params(['cleanup': false, *:params])
23+
// include section starts
24+
// include section ends
25+
26+
Channel
27+
.fromPath(params.input_file, checkIfExists: true)
28+
.set { input_file }
29+
30+
31+
process file_smart_diff {
32+
input:
33+
path output_file
34+
path expected_file
35+
36+
output:
37+
stdout()
38+
39+
script:
40+
"""
41+
# Note: this is only for demo purpose, please write your own 'diff' according to your own needs.
42+
# remove date field before comparison eg, <div id="header_filename">Tue 19 Jan 2021<br/>test_rg_3.bam</div>
43+
# sed -e 's#"header_filename">.*<br/>test_rg_3.bam#"header_filename"><br/>test_rg_3.bam</div>#'
44+
45+
diff <( cat ${output_file} | sed -e 's#"header_filename">.*<br/>#"header_filename"><br/>#' ) \
46+
<( ([[ '${expected_file}' == *.gz ]] && gunzip -c ${expected_file} || cat ${expected_file}) | sed -e 's#"header_filename">.*<br/>#"header_filename"><br/>#' ) \
47+
&& ( echo "Test PASSED" && exit 0 ) || ( echo "Test FAILED, output file mismatch." && exit 1 )
48+
"""
49+
}
50+
51+
52+
workflow checker {
53+
take:
54+
input_file
55+
expected_output
56+
57+
main:
58+
DemoFastqc1Wf(
59+
input_file
60+
)
61+
62+
file_smart_diff(
63+
DemoFastqc1Wf.out.output_file,
64+
expected_output
65+
)
66+
}
67+
68+
69+
workflow {
70+
checker(
71+
file(params.input_file),
72+
file(params.expected_output)
73+
)
74+
}
14.6 KB
Binary file not shown.
148 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This folder contains tiny data files for testing.
14.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)