Skip to content

Commit

Permalink
Merge pull request #3 from ICGC-TCGA-PanCancer/my-wf-2@0.1.1
Browse files Browse the repository at this point in the history
[release]
  • Loading branch information
junjun-zhang authored Jan 29, 2021
2 parents ab7c78d + 44111b5 commit a67c498
Show file tree
Hide file tree
Showing 18 changed files with 353 additions and 0 deletions.
69 changes: 69 additions & 0 deletions my-wf-2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
*.py[cod]

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
.eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
venv*/
pyvenv*/

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
.coverage.*
nosetests.xml
coverage.xml
htmlcov

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject
.idea
*.iml
*.komodoproject

# Complexity
output/*.html
output/*/index.html

# Sphinx
docs/_build

.DS_Store
*~
.*.sw[po]
.build
.ve
.env
.cache
.pytest
.bootstrap
.appveyor.token
*.bak
*.log
.vscode
.python-version
.nextflow*
work
outdir
31 changes: 31 additions & 0 deletions my-wf-2/my-wf-2.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2
version = '0.1.1' // tool version

// universal params go here, change default value as needed
params.container_version = ""
params.cpus = 1
params.mem = 1 // GB
params.publish_dir = "" // set to empty string will disable publishDir

// tool specific parmas go here, add / change as needed
params.input_file = ""
params.output_pattern = "*.html" // fastqc output html report

include { fastqc } from "./wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs1/fastqc@0.1.0/fastqc"
include { cleanupWorkdir as cleanup } from "./wfpr_modules/github.com/icgc-argo/demo-wfpkgs/demo-utils@1.1.0/main"


workflow MyWf2 {
take: // input, make update as needed
input_file

main:
fastqc(input_file)

cleanup(fastqc.out, true)

emit:
output_file = fastqc.out.output
}
4 changes: 4 additions & 0 deletions my-wf-2/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docker {
enabled = true
runOptions = '-u \$(id -u):\$(id -g)'
}
32 changes: 32 additions & 0 deletions my-wf-2/pkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "my-wf-2",
"version": "0.1.1",
"description": "FastQC workflow",
"main": "my-wf-2",
"scripts": {
"test": "wfpm test"
},
"deprecated": false,
"keywords": [
"bioinformatics",
"seq",
"qc metrics"
],
"repository": {
"type": "git",
"url": "https://github.com/icgc-tcga-pancancer/demo-wfs.git"
},
"dependencies": [
"github.com/icgc-tcga-pancancer/demo-wfs/my-wf-1@0.1.0"
],
"devDependencies": [],
"contributors": [
{
"name": "Junjun Zhang",
"email": "junjun.zhang@oicr.on.ca"
}
],
"license": "MIT",
"bugReport": "https://github.com/icgc-tcga-pancancer/demo-wfs/issues",
"homepage": "https://github.com/icgc-tcga-pancancer/demo-wfs#readme"
}
67 changes: 67 additions & 0 deletions my-wf-2/tests/checker.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env nextflow

/*
This is an auto-generated checker workflow, please update as needed
*/

nextflow.enable.dsl = 2
version = '0.1.1' // tool version

// universal params
params.publish_dir = ""
params.container_version = ""

// tool specific parmas go here, add / change as needed
params.input_file = ""
params.expected_output = ""

include { MyWf2 } from '../my-wf-2'

Channel
.fromPath(params.input_file, checkIfExists: true)
.set { input_file }


process file_diff {
input:
path output_file
path expected_gzip

output:
stdout()

script:
"""
# remove date field before comparison eg, <div id="header_filename">Tue 19 Jan 2021<br/>test_rg_3.bam</div>
# sed -e 's#"header_filename">.*<br/>test_rg_3.bam#"header_filename"><br/>test_rg_3.bam</div>#'
diff <( cat ${output_file} | sed -e 's#"header_filename">.*<br/>test_rg_3.bam#"header_filename"><br/>test_rg_3.bam</div>#' ) \
<( gunzip -c ${expected_gzip} | sed -e 's#"header_filename">.*<br/>test_rg_3.bam#"header_filename"><br/>test_rg_3.bam</div>#' ) \
&& ( echo "Test PASSED" && exit 0 ) || ( echo "Test FAILED, output file mismatch." && exit 1 )
"""
}


workflow checker {
take:
input_file
expected_output

main:
MyWf2(
input_file
)

file_diff(
MyWf2.out.output_file,
expected_output
)
}


workflow {
checker(
file(params.input_file),
file(params.expected_output)
)
}
1 change: 1 addition & 0 deletions my-wf-2/tests/expected/expected.input_file_name.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The input file name is README.md
Binary file not shown.
1 change: 1 addition & 0 deletions my-wf-2/tests/input/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This folder contains tiny data files for testing.
Binary file added my-wf-2/tests/input/test_rg_3.bam
Binary file not shown.
1 change: 1 addition & 0 deletions my-wf-2/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
includeConfig '../nextflow.config'
7 changes: 7 additions & 0 deletions my-wf-2/tests/test-job-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"input_file": "input/test_rg_3.bam",
"expected_output": "expected/expected.test_rg_3_fastqc.out.gz",
"publish_dir": "outdir",
"cpus": 1,
"mem": 0.5
}
1 change: 1 addition & 0 deletions my-wf-2/tests/wfpr_modules
1 change: 1 addition & 0 deletions my-wf-2/wfpr_modules
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
*.py[cod]

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
.eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
venv*/
pyvenv*/

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
.coverage.*
nosetests.xml
coverage.xml
htmlcov

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject
.idea
*.iml
*.komodoproject

# Complexity
output/*.html
output/*/index.html

# Sphinx
docs/_build

.DS_Store
*~
.*.sw[po]
.build
.ve
.env
.cache
.pytest
.bootstrap
.appveyor.token
*.bak
*.log
.vscode
.python-version
.nextflow*
work
outdir
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2
version = '0.1.0' // tool version

// universal params go here, change default value as needed
params.container_version = ""
params.cpus = 1
params.mem = 1 // GB
params.publish_dir = "" // set to empty string will disable publishDir

// tool specific parmas go here, add / change as needed
params.input_file = ""
params.output_pattern = "*.html" // fastqc output html report

include { fastqc } from "./wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs1/fastqc@0.1.0/fastqc"
include { cleanupWorkdir as cleanup } from "./wfpr_modules/github.com/icgc-argo/demo-wfpkgs/demo-utils@1.1.0/main"


workflow MyWf1 {
take: // input, make update as needed
input_file

main:
fastqc(input_file)

cleanup(fastqc.out, true)

emit:
output_file = fastqc.out.output
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docker {
enabled = true
runOptions = '-u \$(id -u):\$(id -g)'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "my-wf-1",
"version": "0.1.0",
"description": "FastQC workflow",
"main": "my-wf-1",
"scripts": {
"test": "wfpm test"
},
"deprecated": false,
"keywords": [
"bioinformatics",
"seq",
"qc metrics"
],
"repository": {
"type": "git",
"url": "https://github.com/icgc-tcga-pancancer/demo-wfs.git"
},
"dependencies": [
"github.com/icgc-tcga-pancancer/awesome-wfpkgs1/fastqc@0.1.0",
"github.com/icgc-argo/demo-wfpkgs/demo-utils@1.1.0"
],
"devDependencies": [],
"contributors": [
{
"name": "Junjun Zhang",
"email": "junjun.zhang@oicr.on.ca"
}
],
"license": "MIT",
"bugReport": "https://github.com/icgc-tcga-pancancer/demo-wfs/issues",
"homepage": "https://github.com/icgc-tcga-pancancer/demo-wfs#readme"
}

0 comments on commit a67c498

Please sign in to comment.