-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ICGC-TCGA-PanCancer/fastqc@0.1.0
[release] fastqc@0.1.0
- Loading branch information
Showing
16 changed files
with
302 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.gitignore | ||
.nextflow* | ||
tests | ||
work | ||
outdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM pegi3s/fastqc:0.11.9 | ||
|
||
LABEL org.opencontainers.image.source https://github.com/icgc-tcga-pancancer/demo-tool-pkgs | ||
|
||
ENV PATH="/tools:${PATH}" | ||
|
||
COPY *.py /tools/ | ||
|
||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
/********************************************************************/ | ||
/* this block is auto-generated based on info from pkg.json where */ | ||
/* changes can be made if needed, do NOT modify this block manually */ | ||
nextflow.enable.dsl = 2 | ||
version = '0.1.0' // tool version | ||
|
||
container = [ | ||
'ghcr.io': 'ghcr.io/icgc-tcga-pancancer/demo-tool-pkgs.fastqc' | ||
] | ||
default_container_registry = 'ghcr.io' | ||
/********************************************************************/ | ||
|
||
|
||
// universal params go here | ||
params.container_registry = default_container_registry | ||
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 | ||
|
||
|
||
process fastqc { | ||
container "${container[params.container_registry]}:${params.container_version ?: version}" | ||
publishDir "${params.publish_dir}/${task.process.replaceAll(':', '_')}", mode: "copy", enabled: "${params.publish_dir ? true : ''}" | ||
|
||
cpus params.cpus | ||
memory "${params.mem} GB" | ||
|
||
input: // input, make update as needed | ||
path input_file | ||
|
||
output: // output, make update as needed | ||
path "output_dir/${params.output_pattern}", emit: output | ||
|
||
script: | ||
// add and initialize variables here as needed | ||
|
||
""" | ||
mkdir -p output_dir | ||
fastqc.py \ | ||
-i ${input_file} \ | ||
-o output_dir | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
import sys | ||
import argparse | ||
import subprocess | ||
|
||
|
||
def main(): | ||
""" | ||
Python implementation of tool: fastqc | ||
This is auto-generated Python code, please update as needed! | ||
""" | ||
|
||
parser = argparse.ArgumentParser(description='Tool: fastqc') | ||
parser.add_argument('-i', '--input-file', dest='input_file', type=str, | ||
help='Input file', required=True) | ||
parser.add_argument('-o', '--output-dir', dest='output_dir', type=str, | ||
help='Output directory', required=True) | ||
args = parser.parse_args() | ||
|
||
if not os.path.isfile(args.input_file): | ||
sys.exit('Error: specified input file %s does not exist or is not accessible!' % args.input_file) | ||
|
||
if not os.path.isdir(args.output_dir): | ||
sys.exit('Error: specified output dir %s does not exist or is not accessible!' % args.output_dir) | ||
|
||
subprocess.run(f"fastqc -o {args.output_dir} {args.input_file}", shell=True, check=True) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
docker { | ||
enabled = true | ||
runOptions = '-u \$(id -u):\$(id -g)' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "fastqc", | ||
"version": "0.1.0", | ||
"description": "FastQC tool", | ||
"main": "fastqc", | ||
"scripts": { | ||
"test": "wfpm test" | ||
}, | ||
"deprecated": false, | ||
"keywords": [ | ||
"bioinformatics", | ||
"seq", | ||
"qc metrics" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/icgc-tcga-pancancer/demo-tool-pkgs.git" | ||
}, | ||
"container": { | ||
"registries": [ | ||
{ | ||
"registry": "ghcr.io", | ||
"type": "docker", | ||
"org": "icgc-tcga-pancancer", | ||
"default": true | ||
} | ||
] | ||
}, | ||
"dependencies": [], | ||
"devDependencies": [], | ||
"contributors": [ | ||
{ | ||
"name": "Junjun Zhang", | ||
"email": "junjun.ca@gmail.com" | ||
} | ||
], | ||
"license": "MIT", | ||
"bugReport": "https://github.com/icgc-tcga-pancancer/demo-tool-pkgs/issues", | ||
"homepage": "https://github.com/icgc-tcga-pancancer/demo-tool-pkgs#readme" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
/********************************************************************/ | ||
/* this block is auto-generated based on info from pkg.json where */ | ||
/* changes can be made if needed, do NOT modify this block manually */ | ||
nextflow.enable.dsl = 2 | ||
version = '0.1.0' // tool version | ||
|
||
container = [ | ||
'ghcr.io': 'ghcr.io/icgc-tcga-pancancer/demo-tool-pkgs.fastqc' | ||
] | ||
default_container_registry = 'ghcr.io' | ||
/********************************************************************/ | ||
|
||
// universal params | ||
params.container_registry = default_container_registry | ||
params.container_version = "" | ||
|
||
|
||
// tool specific parmas go here, add / change as needed | ||
params.input_file = "" | ||
params.expected_output = "" | ||
|
||
include { fastqc } from '../fastqc' | ||
|
||
Channel | ||
.fromPath(params.input_file, checkIfExists: true) | ||
.set { input_file } | ||
|
||
|
||
process file_diff { | ||
container "${container[params.container_registry]}:${params.container_version ?: version}" | ||
|
||
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: | ||
fastqc( | ||
input_file | ||
) | ||
|
||
file_diff( | ||
fastqc.out.output, | ||
expected_output | ||
) | ||
} | ||
|
||
|
||
workflow { | ||
checker( | ||
file(params.input_file), | ||
file(params.expected_output) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The input file name is README.md |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This folder contains tiny data files for testing. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
includeConfig '../nextflow.config' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../wfpr_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../wfpr_modules |