Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CONCOCT module(s): conda build bump, stub, and nf-test #5869

Merged
merged 9 commits into from
Jun 25, 2024
21 changes: 19 additions & 2 deletions modules/nf-core/concoct/concoct/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ process CONCOCT_CONCOCT {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/concoct:1.1.0--py311h245ed52_4':
'biocontainers/concoct:1.1.0--py311h245ed52_4' }"
'https://depot.galaxyproject.org/singularity/concoct:1.1.0--py312h245ed52_6':
'biocontainers/concoct:1.1.0--py312h245ed52_6' }"

input:
tuple val(meta), path(coverage_file), path(fasta)
Expand Down Expand Up @@ -39,4 +39,21 @@ process CONCOCT_CONCOCT {
concoct: \$(echo \$(concoct --version 2>&1) | sed 's/concoct //g' )
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_args.txt
touch ${prefix}_clustering_gt1000.csv
touch ${prefix}_log.txt
touch ${prefix}_original_data_gt1000.csv
touch ${prefix}_PCA_components_data_gt1000.csv
touch ${prefix}_PCA_transformed_data_gt1000.csv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
concoct: \$(echo \$(concoct --version 2>&1) | sed 's/concoct //g' )
END_VERSIONS
"""
}
4 changes: 2 additions & 2 deletions modules/nf-core/concoct/concoct/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ tools:
documentation: "https://concoct.readthedocs.io/en/latest/index.html"
tool_dev_url: "https://github.com/BinPro/CONCOCT"
doi: "10.1038/nmeth.3103"
licence: "['FreeBSD']"
licence: ["FreeBSD"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- coverage:
- coverage_file:
type: file
description: Subcontig coverage TSV table (typically generated with concoct_coverage_table.py)
pattern: "*.tsv"
Expand Down
105 changes: 105 additions & 0 deletions modules/nf-core/concoct/concoct/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
nextflow_process {

name "Test Process CONCOCT_CONCOCT"
script "../main.nf"
process "CONCOCT_CONCOCT"

tag "modules"
tag "modules_nfcore"
tag "concoct"
tag "concoct/concoct"
tag "concoct/cutupfasta"
tag "concoct/concoctcoveragetable"

setup {
run("CONCOCT_CUTUPFASTA") {
script "../../cutupfasta/main.nf"
process {
"""
input[0] = [
[id: 'test', single_end: false],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = true
"""
}
}

run("CONCOCT_CONCOCTCOVERAGETABLE") {
script "../../concoctcoveragetable/main.nf"
process {
"""
ch_bam_input = Channel
.fromList([
[
[ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
],
[
file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true),
file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true)
]
]
])


input[0] = CONCOCT_CUTUPFASTA.out.bed.join( ch_bam_input )
"""
}
}
}

test("sarscov2 - bam") {

when {
process {
"""
ch_input_for_concoctconcoct = CONCOCT_CONCOCTCOVERAGETABLE.out.tsv
.join(CONCOCT_CUTUPFASTA.out.fasta)

input[0] = ch_input_for_concoctconcoct
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.args_txt,
process.out.clustering_csv,
process.out.original_data_csv,
process.out.pca_components_csv,
process.out.pca_transformed_csv,
process.out.versions,
file(process.out.log_txt[0][1]).readLines().last().contains("CONCOCT Finished, the log shows how it went.")
).match() }
)
}

}

test("sarscov2 - bam - stub") {

options "-stub"

when {
process {
"""
input[0] = [ [id: 'test'], [], [] ]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
173 changes: 173 additions & 0 deletions modules/nf-core/concoct/concoct/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
{
"sarscov2 - bam - stub": {
SPPearce marked this conversation as resolved.
Show resolved Hide resolved
"content": [
{
"0": [
[
{
"id": "test"
},
"test_args.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test"
},
"test_clustering_gt1000.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
[
{
"id": "test"
},
"test_log.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"3": [
[
{
"id": "test"
},
"test_original_data_gt1000.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"4": [
[
{
"id": "test"
},
"test_PCA_components_data_gt1000.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"5": [
[
{
"id": "test"
},
"test_PCA_transformed_data_gt1000.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"6": [
"versions.yml:md5,ed583fb0862e060844ceffee6bf0eeb7"
],
"args_txt": [
[
{
"id": "test"
},
"test_args.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"clustering_csv": [
[
{
"id": "test"
},
"test_clustering_gt1000.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"log_txt": [
[
{
"id": "test"
},
"test_log.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"original_data_csv": [
[
{
"id": "test"
},
"test_original_data_gt1000.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"pca_components_csv": [
[
{
"id": "test"
},
"test_PCA_components_data_gt1000.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"pca_transformed_csv": [
[
{
"id": "test"
},
"test_PCA_transformed_data_gt1000.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,ed583fb0862e060844ceffee6bf0eeb7"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-24T08:39:53.759611572"
},
"sarscov2 - bam": {
"content": [
[
[
{
"id": "test",
"single_end": false
},
"test_args.txt:md5,277d8a15f732ae1bd4d6839fd768113e"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test_clustering_gt1000.csv:md5,8cb3e6901075bf07966d08e1816762ce"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test_original_data_gt1000.csv:md5,7474c6a670a608c2c9c9b9edde724074"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test_PCA_components_data_gt1000.csv:md5,e69fd8a810563e62cb0c3998842b3659"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test_PCA_transformed_data_gt1000.csv:md5,558a35f720a9bfa54cbf7cdf099fd367"
]
],
[
"versions.yml:md5,ed583fb0862e060844ceffee6bf0eeb7"
],
true
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-21T20:25:56.619830843"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/concoct/concoct/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
concoct/concoct:
- "modules/nf-core/concoct/concoct/**"
17 changes: 1 addition & 16 deletions modules/nf-core/concoct/concoctcoveragetable/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,7 @@ nextflow_process {
when {
process {
"""
ch_bam_input = Channel
.fromList([
[
[ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
],
[
file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true),
file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true)
]
]
])

input[0] = CONCOCT_CUTUPFASTA.out.bed.join( ch_bam_input )
input[0] = [ [id:'test'], [], [] ,[] ]
"""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,34 @@
"content": [
{
"0": [

[
{
"id": "test"
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [

"versions.yml:md5,156a9a23e05b34188d03d52b39fae343"
],
"tsv": [

[
{
"id": "test"
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [

"versions.yml:md5,156a9a23e05b34188d03d52b39fae343"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-21T16:02:03.884676509"
"timestamp": "2024-06-24T08:41:27.166202038"
},
"sarscov2 - bam": {
"content": [
Expand Down
Loading
Loading