-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add crabz skeleton * feat: update `environment.yml` * feat: add crabz version * feat: add `crabz` to `container` * fix: update label * feat: update `CRABZ_COMPRESS` process * WIP: add `CRABZ_DECOMPRESS` process * fix: stub run * fix: update file paths * fix: update snapshot * fix: tool name * fix: remove unused `--quiet` flag
- Loading branch information
Showing
12 changed files
with
477 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,9 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
name: "crabz_compress" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- conda-forge::crabz=0.9.0 |
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,49 @@ | ||
process CRABZ_COMPRESS { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/crabz:0.9.0': | ||
'biocontainers/crabz:0.9.0' }" | ||
|
||
input: | ||
tuple val(meta), path(file) | ||
|
||
output: | ||
tuple val(meta), path("*.gz"), emit: archive | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${file}" | ||
""" | ||
crabz \\ | ||
$args \\ | ||
-p $task.cpus \\ | ||
-o ${prefix}.gz \\ | ||
$file | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
crabz: \$(crabz --version |& sed 's/[^:]*://') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${file}" | ||
""" | ||
echo "" | gzip > ${prefix}.gz | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
crabz: \$(crabz --version |& sed 's/[^:]*://') | ||
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,50 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "crabz_compress" | ||
description: Compress files with crabz | ||
keywords: | ||
- compression | ||
- gzip | ||
- zlib | ||
tools: | ||
- crabz: | ||
description: "Like pigz, but rust" | ||
homepage: "https://github.com/sstadick/crabz" | ||
documentation: "https://github.com/sstadick/crabz" | ||
tool_dev_url: "https://github.com/sstadick/crabz" | ||
licence: ["MIT"] | ||
|
||
input: | ||
# Only when we have meta | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- file: | ||
type: file | ||
description: File to be compressed | ||
pattern: "*.*" | ||
|
||
output: | ||
#Only when we have meta | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- archive: | ||
type: file | ||
description: The compressed file | ||
pattern: "*.gz" | ||
|
||
authors: | ||
- "@camlloyd" | ||
maintainers: | ||
- "@camlloyd" |
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,61 @@ | ||
nextflow_process { | ||
|
||
name "Test Process CRABZ_COMPRESS" | ||
script "../main.nf" | ||
process "CRABZ_COMPRESS" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "crabz" | ||
tag "crabz/compress" | ||
|
||
test("sarscov2 - genome - fasta") { | ||
|
||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test'], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("sarscov2 - genome - fasta - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test'], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ 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 @@ | ||
crabz/compress: | ||
- "modules/nf-core/crabz/compress/**" |
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 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
name: "crabz_decompress" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- conda-forge::crabz=0.9.0 |
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,47 @@ | ||
process CRABZ_DECOMPRESS { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/crabz:0.9.0': | ||
'biocontainers/crabz:0.9.0' }" | ||
|
||
input: | ||
tuple val(meta), path(archive) | ||
|
||
output: | ||
tuple val(meta), path("*.*"), emit: file | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${archive}" | ||
""" | ||
crabz \\ | ||
$args \\ | ||
-p $task.cpus \\ | ||
-o ${prefix} \\ | ||
$archive | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
crabz: \$(crabz --version |& sed 's/[^:]*://') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${archive}" | ||
""" | ||
touch ${prefix} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
crabz: \$(crabz --version |& sed 's/[^:]*://') | ||
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,50 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "crabz_decompress" | ||
description: Decompress files with crabz | ||
keywords: | ||
- decompression | ||
- gzip | ||
- zlib | ||
tools: | ||
- crabz: | ||
description: "Like pigz, but rust" | ||
homepage: "https://github.com/sstadick/crabz" | ||
documentation: "https://github.com/sstadick/crabz" | ||
tool_dev_url: "https://github.com/sstadick/crabz" | ||
licence: ["MIT"] | ||
|
||
input: | ||
# Only when we have meta | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- archive: | ||
type: file | ||
description: File to be decompressed | ||
pattern: "*.gz" | ||
|
||
output: | ||
#Only when we have meta | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- file: | ||
type: file | ||
description: The decompressed file | ||
pattern: "*.*" | ||
|
||
authors: | ||
- "@camlloyd" | ||
maintainers: | ||
- "@camlloyd" |
Oops, something went wrong.