Skip to content

Commit

Permalink
Update dragmap + add nf-test (#4379)
Browse files Browse the repository at this point in the history
* new module picard/scatterintervalsbyns

* update annotsv to 3.3.6

* update installannotations

* update dragmap modules + add nf-test

* fix singularity container

* add human test + stubs

* fix tests

* update mulled containers + conda env

* fix tests

* chore: Remove pytest-workflow tests

---------

Co-authored-by: Edmund Miller <[email protected]>
  • Loading branch information
nvnieuwk and edmundmiller authored Dec 7, 2023
1 parent 9b1b7a7 commit 8f0bec8
Show file tree
Hide file tree
Showing 16 changed files with 483 additions and 170 deletions.
6 changes: 3 additions & 3 deletions modules/nf-core/dragmap/align/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
- bioconda
- defaults
dependencies:
- dragmap=1.2.1
- dragmap=1.3.0
# renovate: datasource=conda depName=bioconda/samtools
- samtools=1.15.1
- pigz=2.3.4
- samtools=1.18
- pigz=2.8
18 changes: 16 additions & 2 deletions modules/nf-core/dragmap/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process DRAGMAP_ALIGN {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:5ebebbc128cd624282eaa37d2c7fe01505a91a69-0':
'biocontainers/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:5ebebbc128cd624282eaa37d2c7fe01505a91a69-0' }"
'https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:7eed251370ac7f3537c3d9472cdb2f9f5d8da1c5-0':
'biocontainers/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:7eed251370ac7f3537c3d9472cdb2f9f5d8da1c5-0' }"

input:
tuple val(meta) , path(reads)
Expand Down Expand Up @@ -43,4 +43,18 @@ process DRAGMAP_ALIGN {
pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.bam
touch ${prefix}.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
dragmap: \$(echo \$(dragen-os --version 2>&1))
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' )
END_VERSIONS
"""
}
276 changes: 276 additions & 0 deletions modules/nf-core/dragmap/align/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
nextflow_process {

name "Test Process DRAGMAP_ALIGN"
script "../main.nf"
process "DRAGMAP_ALIGN"
tag "modules"
tag "modules_nfcore"
tag "dragmap"
tag "dragmap/align"

test("sarscov2 - fastq, hashtable, false") {

setup {
run("DRAGMAP_HASHTABLE") {
script "../../hashtable/main.nf"
process {
"""
input[0] = [
[id:'test'],
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
]
input[1] = DRAGMAP_HASHTABLE.out.hashmap
input[2] = false //sort
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
file(process.out.versions[0]).name
).match() }
)
}

}

test("sarscov2 - fastq, hashtable, true") {

setup {
run("DRAGMAP_HASHTABLE") {
script "../../hashtable/main.nf"
process {
"""
input[0] = [
[id:'test'],
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
]
input[1] = DRAGMAP_HASHTABLE.out.hashmap
input[2] = true //sort
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
file(process.out.versions[0]).name
).match() }
)
}

}

test("sarscov2 - [fastq1, fastq2], hashtable, false") {

setup {
run("DRAGMAP_HASHTABLE") {
script "../../hashtable/main.nf"
process {
"""
input[0] = [
[id:'test'],
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)
]
]
input[1] = DRAGMAP_HASHTABLE.out.hashmap
input[2] = false //sort
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
file(process.out.versions[0]).name
).match() }
)
}

}

test("sarscov2 - [fastq1, fastq2], hashtable, true") {

setup {
run("DRAGMAP_HASHTABLE") {
script "../../hashtable/main.nf"
process {
"""
input[0] = [
[id:'test'],
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)
]
]
input[1] = DRAGMAP_HASHTABLE.out.hashmap
input[2] = true //sort
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
file(process.out.versions[0]).name
).match() }
)
}

}

test("homo_sapiens - [fastq1, fastq2], hashtable, true") {

setup {
run("DRAGMAP_HASHTABLE") {
script "../../hashtable/main.nf"
process {
"""
input[0] = [
[id:'test'],
file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true)
]
]
input[1] = DRAGMAP_HASHTABLE.out.hashmap
input[2] = true //sort
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
file(process.out.versions[0]).name
).match() }
)
}

}

test("sarscov2 - [fastq1, fastq2], hashtable, true - stub") {

options "-stub"
setup {
run("DRAGMAP_HASHTABLE") {
script "../../hashtable/main.nf"
process {
"""
input[0] = [
[id:'test'],
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)
]
]
input[1] = DRAGMAP_HASHTABLE.out.hashmap
input[2] = true //sort
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).name,
file(process.out.versions[0]).name
).match() }
)
}

}

}
Loading

0 comments on commit 8f0bec8

Please sign in to comment.