diff --git a/fastqc-wf3/.gitignore b/fastqc-wf3/.gitignore new file mode 100644 index 0000000..a50828c --- /dev/null +++ b/fastqc-wf3/.gitignore @@ -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 diff --git a/fastqc-wf3/fastqc-wf3.nf b/fastqc-wf3/fastqc-wf3.nf new file mode 100755 index 0000000..b0e9662 --- /dev/null +++ b/fastqc-wf3/fastqc-wf3.nf @@ -0,0 +1,42 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 +version = '0.1.0' // package 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 +params.another = "" + + +// include section starts +include { FastqcWf2 } from "./wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/fastqc-wf2" +include { cleanupWorkdir } from "./wfpr_modules/github.com/icgc-argo/demo-wfpkgs/demo-utils@1.2.0/main" + +// include section ends + + +workflow FastqcWf3 { + take: // update as needed + // input section starts + input_file + // input section ends + + main: // update as needed + // main section starts + FastqcWf2(input_file) + + cleanupWorkdir(FastqcWf2.out, true) + // main section ends + + emit: // update as needed + // output section starts + output_file = FastqcWf2.out.output_file + // output section ends +} diff --git a/fastqc-wf3/nextflow.config b/fastqc-wf3/nextflow.config new file mode 100644 index 0000000..f2cd1e3 --- /dev/null +++ b/fastqc-wf3/nextflow.config @@ -0,0 +1,4 @@ +docker { + enabled = true + runOptions = '-u \$(id -u):\$(id -g)' +} diff --git a/fastqc-wf3/pkg.json b/fastqc-wf3/pkg.json new file mode 100644 index 0000000..d3e4f38 --- /dev/null +++ b/fastqc-wf3/pkg.json @@ -0,0 +1,33 @@ +{ + "name": "fastqc-wf3", + "version": "0.1.0", + "description": "FastQC workflow", + "main": "fastqc-wf3", + "scripts": { + "test": "wfpm test" + }, + "deprecated": false, + "keywords": [ + "bioinformatics", + "seq", + "qc metrics" + ], + "repository": { + "type": "git", + "url": "https://github.com/icgc-tcga-pancancer/awesome-wfpkgs2.git" + }, + "dependencies": [ + "github.com/icgc-argo/demo-wfpkgs/demo-utils@1.2.0", + "github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2" + ], + "devDependencies": [], + "contributors": [ + { + "name": "Junjun Zhang", + "email": "junjun.ca@gmail.com" + } + ], + "license": "MIT", + "bugReport": "https://github.com/icgc-tcga-pancancer/awesome-wfpkgs2/issues", + "homepage": "https://github.com/icgc-tcga-pancancer/awesome-wfpkgs2#readme" +} \ No newline at end of file diff --git a/fastqc-wf3/tests/checker.nf b/fastqc-wf3/tests/checker.nf new file mode 100755 index 0000000..9bef815 --- /dev/null +++ b/fastqc-wf3/tests/checker.nf @@ -0,0 +1,68 @@ +#!/usr/bin/env nextflow + +/* + This is an auto-generated checker workflow, please update as needed +*/ + +nextflow.enable.dsl = 2 +version = '0.1.0' // package 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 { FastqcWf3 } from '../fastqc-wf3' +// include statements go here for dev dependencies + +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,
Tue 19 Jan 2021
test_rg_3.bam
+ # sed -e 's#"header_filename">.*
test_rg_3.bam#"header_filename">
test_rg_3.bam#' + + diff <( cat ${output_file} | sed -e 's#"header_filename">.*
test_rg_3.bam#"header_filename">
test_rg_3.bam#' ) \ + <( gunzip -c ${expected_gzip} | sed -e 's#"header_filename">.*
test_rg_3.bam#"header_filename">
test_rg_3.bam#' ) \ + && ( echo "Test PASSED" && exit 0 ) || ( echo "Test FAILED, output file mismatch." && exit 1 ) + """ +} + + +workflow checker { + take: + input_file + expected_output + + main: + FastqcWf3( + input_file + ) + + file_diff( + FastqcWf3.out.output_file, + expected_output + ) +} + + +workflow { + checker( + file(params.input_file), + file(params.expected_output) + ) +} diff --git a/fastqc-wf3/tests/expected/expected.input_file_name.txt b/fastqc-wf3/tests/expected/expected.input_file_name.txt new file mode 100644 index 0000000..d2a060a --- /dev/null +++ b/fastqc-wf3/tests/expected/expected.input_file_name.txt @@ -0,0 +1 @@ +The input file name is README.md diff --git a/fastqc-wf3/tests/expected/expected.test_rg_3_fastqc.out.gz b/fastqc-wf3/tests/expected/expected.test_rg_3_fastqc.out.gz new file mode 100644 index 0000000..663e51e Binary files /dev/null and b/fastqc-wf3/tests/expected/expected.test_rg_3_fastqc.out.gz differ diff --git a/fastqc-wf3/tests/input/README.md b/fastqc-wf3/tests/input/README.md new file mode 100644 index 0000000..9df14b7 --- /dev/null +++ b/fastqc-wf3/tests/input/README.md @@ -0,0 +1 @@ +This folder contains tiny data files for testing. diff --git a/fastqc-wf3/tests/input/test_rg_3.bam b/fastqc-wf3/tests/input/test_rg_3.bam new file mode 100644 index 0000000..ab8a214 Binary files /dev/null and b/fastqc-wf3/tests/input/test_rg_3.bam differ diff --git a/fastqc-wf3/tests/nextflow.config b/fastqc-wf3/tests/nextflow.config new file mode 100644 index 0000000..4e214a1 --- /dev/null +++ b/fastqc-wf3/tests/nextflow.config @@ -0,0 +1 @@ +includeConfig '../nextflow.config' diff --git a/fastqc-wf3/tests/test-job-1.json b/fastqc-wf3/tests/test-job-1.json new file mode 100644 index 0000000..e9bb82b --- /dev/null +++ b/fastqc-wf3/tests/test-job-1.json @@ -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 +} diff --git a/fastqc-wf3/tests/wfpr_modules b/fastqc-wf3/tests/wfpr_modules new file mode 120000 index 0000000..de8975c --- /dev/null +++ b/fastqc-wf3/tests/wfpr_modules @@ -0,0 +1 @@ +../wfpr_modules \ No newline at end of file diff --git a/fastqc-wf3/wfpr_modules b/fastqc-wf3/wfpr_modules new file mode 120000 index 0000000..de8975c --- /dev/null +++ b/fastqc-wf3/wfpr_modules @@ -0,0 +1 @@ +../wfpr_modules \ No newline at end of file diff --git a/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs1/fastqc@0.2.0/wfpr_modules b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs1/fastqc@0.2.0/wfpr_modules new file mode 120000 index 0000000..1cc74ba --- /dev/null +++ b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs1/fastqc@0.2.0/wfpr_modules @@ -0,0 +1 @@ +../../../../../wfpr_modules \ No newline at end of file diff --git a/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/.gitignore b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/.gitignore new file mode 100644 index 0000000..a50828c --- /dev/null +++ b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/.gitignore @@ -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 diff --git a/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/fastqc-wf2.nf b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/fastqc-wf2.nf new file mode 100755 index 0000000..c19d035 --- /dev/null +++ b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/fastqc-wf2.nf @@ -0,0 +1,33 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 +version = '0.1.2' + +// 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.2.0/fastqc" +include { FastqcWf } from "./wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf@0.2.0/fastqc-wf" +include { cleanupWorkdir } from "./wfpr_modules/github.com/icgc-argo/demo-wfpkgs/demo-utils@1.1.0/main" + + + +workflow FastqcWf2 { + take: // input, make update as needed + input_file + + main: + FastqcWf(input_file) + + cleanupWorkdir(FastqcWf.out, true) + + emit: + output_file = FastqcWf.out.output_file +} diff --git a/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/nextflow.config b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/nextflow.config new file mode 100644 index 0000000..f2cd1e3 --- /dev/null +++ b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/nextflow.config @@ -0,0 +1,4 @@ +docker { + enabled = true + runOptions = '-u \$(id -u):\$(id -g)' +} diff --git a/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/pkg.json b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/pkg.json new file mode 100644 index 0000000..9b18cd8 --- /dev/null +++ b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/pkg.json @@ -0,0 +1,33 @@ +{ + "name": "fastqc-wf2", + "version": "0.1.2", + "description": "FastQC workflow", + "main": "fastqc-wf2", + "scripts": { + "test": "wfpm test" + }, + "deprecated": false, + "keywords": [ + "bioinformatics", + "seq", + "qc metrics" + ], + "repository": { + "type": "git", + "url": "https://github.com/icgc-tcga-pancancer/awesome-wfpkgs2.git" + }, + "dependencies": [ + "github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf@0.2.0", + "github.com/icgc-argo/demo-wfpkgs/demo-utils@1.2.0" + ], + "devDependencies": [], + "contributors": [ + { + "name": "Junjun Zhang", + "email": "junjun.ca@gmail.com" + } + ], + "license": "MIT", + "bugReport": "https://github.com/icgc-tcga-pancancer/awesome-wfpkgs2/issues", + "homepage": "https://github.com/icgc-tcga-pancancer/awesome-wfpkgs2#readme" +} \ No newline at end of file diff --git a/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/wfpr_modules b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/wfpr_modules new file mode 120000 index 0000000..1cc74ba --- /dev/null +++ b/wfpr_modules/github.com/icgc-tcga-pancancer/awesome-wfpkgs2/fastqc-wf2@0.1.2/wfpr_modules @@ -0,0 +1 @@ +../../../../../wfpr_modules \ No newline at end of file