Skip to content

Commit

Permalink
BBMAP/repair snapshot added
Browse files Browse the repository at this point in the history
  • Loading branch information
tm4zza committed Dec 19, 2024
1 parent 14dcd6b commit dd2a11a
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 31 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/bbmap/repair/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::bbmap=39.10"
- "bioconda::bbmap=39.13"
18 changes: 7 additions & 11 deletions modules/nf-core/bbmap/repair/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ process BBMAP_REPAIR {
label 'process_single'
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/bbmap:39.10--h92535d8_0':
'biocontainers/bbmap:39.10--h92535d8_0' }"
'https://depot.galaxyproject.org/singularity/bbmap:39.13--he5f24ec_1':
'biocontainers/bbmap:39.13--he5f24ec_1' }"

input:
tuple val(meta), path(reads)
Expand All @@ -21,10 +21,10 @@ process BBMAP_REPAIR {

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def in_reads = ( interleave ) ? "in=${reads[0]}" : "in=${reads[0]} in2=${reads[1]}"
def out_reads = ( interleave ) ? "out=${prefix}_repaired.fastq.gz outs=${prefix}_singleton.fastq.gz"
: "out=${prefix}_1_repaired.fastq.gz out2=${prefix}_2_repaired.fastq.gz outs=${prefix}_singleton.fastq.gz"
prefix = task.ext.prefix ?: "${meta.id}"
in_reads = ( interleave ) ? "in=${reads[0]}" : "in=${reads[0]} in2=${reads[1]}"
out_reads = ( interleave ) ? "out=${prefix}_repaired.fastq.gz outs=${prefix}_singleton.fastq.gz"
: "out=${prefix}_1_repaired.fastq.gz out2=${prefix}_2_repaired.fastq.gz outs=${prefix}_singleton.fastq.gz"
"""
maxmem=\$(echo \"$task.memory\"| sed 's/ GB/g/g')
repair.sh \\
Expand All @@ -42,11 +42,7 @@ process BBMAP_REPAIR {
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def in_reads = ( args.interleave ) ? "in=${reads[0]}" : "in=${reads[0]} in2=${reads[1]}"
def out_reads = ( args.interleave ) ? "out=${prefix}_repaired.fastq.gz outs=${prefix}_singleton.fastq.gz"
: "out=${prefix}_1_repaired.fastq.gz out2=${prefix}_2_repaired.fastq.gz outs=${prefix}_singleton.fastq.gz"
prefix = task.ext.prefix ?: "${meta.id}"
"""
echo "" | gzip > ${prefix}_1_repaired.fastq.gz
echo "" | gzip > ${prefix}_2_repaired.fastq.gz
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/bbmap/repair/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ tools:
- repair:
description: Repair.sh is a tool that re-pairs reads that became disordered or had some mates eliminated
tools.
homepage: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/
documentation: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/
homepage: https://jgi.doe.gov/data-and-tools/software-tools/bbtools/
documentation: https://jgi.doe.gov/data-and-tools/software-tools/bbtools/bb-tools-user-guide/
licence: ["UC-LBL license (see package)"]
identifier: biotools:bbmap

Expand Down
33 changes: 16 additions & 17 deletions modules/nf-core/bbmap/repair/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ nextflow_process {
tag "bbmap/repair"

test("sarscov2_illumina_paired - fastq_gz") {

config "./nextflow.config"

when {
params {
module_args = 'qin=33'
}
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
Expand All @@ -25,23 +27,23 @@ nextflow_process {
"""
}
}

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

}

test("sarscov2_illumina_interleaved - fastq_gz") {

config "./nextflow.config"

when {
params {
module_args = 'qin=33'
}
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true)]
Expand All @@ -50,24 +52,24 @@ nextflow_process {
"""
}
}

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

}

test("sarscov2_illumina_paired - fastq_gz - stub") {

config "./nextflow.config"
options "-stub"

when {
params {
module_args = 'qin=33'
}
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
Expand All @@ -77,24 +79,24 @@ nextflow_process {
"""
}
}

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

}

test("sarscov2_illumina_interleaved - fastq_gz - stub") {

config "./nextflow.config"
options "-stub"

when {
params {
module_args = 'qin=33'
}
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true)]
Expand All @@ -103,14 +105,11 @@ nextflow_process {
"""
}
}

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

}

}
156 changes: 156 additions & 0 deletions modules/nf-core/bbmap/repair/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"sarscov2_illumina_paired - fastq_gz": {
"content": [
[
"versions.yml:md5,006e8f2167df95a778b428413ed9d859"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-12-19T11:01:18.284624712"
},
"sarscov2_illumina_interleaved - fastq_gz - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
[
"test_1_repaired.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"test_2_repaired.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
]
],
"1": [
[
{
"id": "test",
"single_end": false
},
"test_singleton.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"2": [
"versions.yml:md5,006e8f2167df95a778b428413ed9d859"
],
"3": [
"test.repair.sh.log:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"log": [
"test.repair.sh.log:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"repaired": [
[
{
"id": "test",
"single_end": false
},
[
"test_1_repaired.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"test_2_repaired.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
]
],
"singleton": [
[
{
"id": "test",
"single_end": false
},
"test_singleton.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"versions": [
"versions.yml:md5,006e8f2167df95a778b428413ed9d859"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-12-19T11:02:01.385727451"
},
"sarscov2_illumina_interleaved - fastq_gz": {
"content": [
[
"versions.yml:md5,006e8f2167df95a778b428413ed9d859"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-12-19T11:01:32.752620818"
},
"sarscov2_illumina_paired - fastq_gz - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
[
"test_1_repaired.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"test_2_repaired.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
]
],
"1": [
[
{
"id": "test",
"single_end": false
},
"test_singleton.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"2": [
"versions.yml:md5,006e8f2167df95a778b428413ed9d859"
],
"3": [
"test.repair.sh.log:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"log": [
"test.repair.sh.log:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"repaired": [
[
{
"id": "test",
"single_end": false
},
[
"test_1_repaired.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"test_2_repaired.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
]
],
"singleton": [
[
{
"id": "test",
"single_end": false
},
"test_singleton.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"versions": [
"versions.yml:md5,006e8f2167df95a778b428413ed9d859"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-12-19T11:01:47.341193946"
}
}
6 changes: 6 additions & 0 deletions modules/nf-core/bbmap/repair/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
process {
withName: BBMAP_REPAIR {
ext.args = params.module_args
cpus = { 2 * task.attempt }
}
}

0 comments on commit dd2a11a

Please sign in to comment.