-
Notifications
You must be signed in to change notification settings - Fork 716
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added gt/stat * Fixed typo in pattern
- Loading branch information
Showing
6 changed files
with
212 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: "gt_stat" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- "bioconda::genometools-genometools=1.6.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,46 @@ | ||
process GT_STAT { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/genometools-genometools:1.6.5--py310h3db02ab_0': | ||
'biocontainers/genometools-genometools:1.6.5--py310h3db02ab_0' }" | ||
|
||
input: | ||
tuple val(meta), path(gff3) | ||
|
||
output: | ||
tuple val(meta), path("${prefix}.yml") , emit: stats | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
gt \\ | ||
stat \\ | ||
$args \\ | ||
$gff3 \\ | ||
> ${prefix}.yml | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
genometools: \$(gt --version | head -1 | sed 's/gt (GenomeTools) //') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.yml | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
genometools: \$(gt --version | head -1 | sed 's/gt (GenomeTools) //') | ||
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,46 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "gt_stat" | ||
description: "GenomeTools gt-stat utility to show statistics about features contained in GFF3 files" | ||
keywords: | ||
- genome | ||
- gff3 | ||
- annotation | ||
- statistics | ||
- stats | ||
tools: | ||
- "gt": | ||
description: "The GenomeTools genome analysis system" | ||
homepage: "https://genometools.org/index.html" | ||
documentation: "https://genometools.org/documentation.html" | ||
tool_dev_url: "https://github.com/genometools/genometools" | ||
doi: "10.1109/TCBB.2013.68" | ||
licence: ["ISC"] | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test' ]` | ||
- gff3: | ||
type: file | ||
description: Input gff3 file | ||
pattern: "*.{gff,gff3}" | ||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test' ]` | ||
- stats: | ||
type: file | ||
description: Stats file in yaml format | ||
pattern: "*.yml" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@GallVp" | ||
maintainers: | ||
- "@GallVp" |
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,62 @@ | ||
nextflow_process { | ||
|
||
name "Test Process GT_STAT" | ||
script "../main.nf" | ||
process "GT_STAT" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "gt" | ||
tag "gt/stat" | ||
|
||
test("sarscov2-gff3") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = Channel.of( | ||
"##gff-version 3" + | ||
file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true).text.toLowerCase() | ||
) | ||
.collectFile(name: 'sample.gff3', newLine: true) | ||
.map { file -> [ [ id:'test' ], file ] } | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() }, | ||
{ assert path(process.out.stats[0][1]).text.contains("cdss: 12") } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("sarscov2-gff3-stub") { | ||
|
||
options '-stub' | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id: 'test' ], | ||
file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert process.out.stats != null }, // md5sum for empty files not allowed by nf-core/tools 2.14.0 | ||
{ assert snapshot(process.out.versions).match("stub_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,47 @@ | ||
{ | ||
"sarscov2-gff3": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.yml:md5,ebba7831ddbf916b8bbea675ba8693b5" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,a184b50afb2ad6dd2d3d37b0a211dd71" | ||
], | ||
"stats": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.yml:md5,ebba7831ddbf916b8bbea675ba8693b5" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,a184b50afb2ad6dd2d3d37b0a211dd71" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-05-09T19:29:08.925383" | ||
}, | ||
"stub_versions": { | ||
"content": [ | ||
[ | ||
"versions.yml:md5,a184b50afb2ad6dd2d3d37b0a211dd71" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-05-09T19:29:12.808817" | ||
} | ||
} |
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 @@ | ||
gt/stat: | ||
- "modules/nf-core/gt/stat/**" |