forked from nf-core/modules
-
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.
* compress workflow * add compress tests to pytest * fix * uncompress * uncompress tests * Revert "uncompress tests", will do nf-tests This reverts commit 6e7a33e. * Revert "add compress tests to pytest", will do nf-tests This reverts commit 139e5c2. * generating the nf-tests for the processes * first test written, need actual run * set stageInMode * call -f to make pigz follow symlinks * uncompress keeps input * remove compress module * written first iteration of nf-test for pigz/uncompress * empty line in tag.yml * adding missing tags in main.nf.test and fixed linting errors * add old singularity container for pigz * switch from pgzip to pigz singularity/biocontainers container, in anticipation of BioContainers/multi-package-containers#2793 being merged --------- Co-authored-by: Leon Rauschning <[email protected]> Co-authored-by: alessiovignoli <[email protected]>
- Loading branch information
1 parent
3d20bff
commit 4ef7bec
Showing
5 changed files
with
136 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,48 @@ | ||
process PIGZ_UNCOMPRESS { | ||
label 'process_low' | ||
//stageInMode 'copy' // this directive can be set in case the original input should be kept | ||
|
||
conda "conda-forge::pigz" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/pigz:2.8': | ||
'biocontainers/pigz:2.8' }" | ||
|
||
input: | ||
path zip | ||
|
||
output: | ||
path "${uncompressed_filename}" , emit: file | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
uncompressed_filename = zip.toString() - '.gz' | ||
// calling pigz -f to make it follow symlinks | ||
""" | ||
unpigz \\ | ||
-p $task.cpus \\ | ||
-fk \\ | ||
$args \\ | ||
${zip} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
pigz: \$(echo \$(pigz --version 2>&1) | sed 's/^.*pigz\\w*//' )) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
uncompressed_filename = zip.toString() - '.gz' | ||
""" | ||
touch ${zip.dropRight(3)} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
pigz: \$(echo \$(pigz --version 2>&1) | sed 's/^.*pigz\w*//' )) | ||
END_VERSIONS | ||
""" | ||
} |
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,32 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json | ||
name: "pigz_uncompress" | ||
description: write your description here | ||
keywords: | ||
- uncompress | ||
- gzip | ||
- parallelized | ||
tools: | ||
- "pigz": | ||
description: "Parallel implementation of the gzip algorithm." | ||
homepage: "https://zlib.net/pigz/" | ||
documentation: "https://zlib.net/pigz/pigz.pdf" | ||
|
||
input: | ||
- zip: | ||
type: file | ||
description: Gzipped file | ||
pattern: "*.{gzip}" | ||
|
||
output: | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- file: | ||
type: file | ||
description: File to compress | ||
pattern: "*" | ||
|
||
authors: | ||
- "@lrauschning" |
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,33 @@ | ||
nextflow_process { | ||
|
||
name "Test Process PIGZ_UNCOMPRESS" | ||
script "modules/nf-core/pigz/uncompress/main.nf" | ||
process "PIGZ_UNCOMPRESS" | ||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "pigz" | ||
tag "pigz/uncompress" | ||
|
||
test("Should run without failures") { | ||
|
||
when { | ||
params { | ||
outdir = "$outputDir" | ||
} | ||
process { | ||
""" | ||
input[0] = [ | ||
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert process.success | ||
assert snapshot(process.out).match() | ||
} | ||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,2 @@ | ||
pigz/uncompress: | ||
- modules/nf-core/pigz/uncompress/** |