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

add nf-test to samtools/faidx - #3936 #5177

Merged
merged 4 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/nf-core/samtools/faidx/environment.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: samtools_faidx

channels:
- conda-forge
- bioconda
- defaults

dependencies:
- bioconda::samtools=1.19.2
- bioconda::htslib=1.19.1
- bioconda::samtools=1.19.2
4 changes: 4 additions & 0 deletions modules/nf-core/samtools/faidx/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ output:
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fa:
type: file
description: FASTA file
pattern: "*.{fa}"
- fai:
type: file
description: FASTA index file
Expand Down
123 changes: 123 additions & 0 deletions modules/nf-core/samtools/faidx/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "samtools"
tag "samtools/faidx"

test("test_samtools_faidx") {

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]

input[1] = [[],[]]
"""
}
}

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

test("test_samtools_faidx_bgzip") {

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta_gz'], checkIfExists: true) ]

input[1] = [[],[]]
"""
}
}

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

test("test_samtools_faidx_fasta") {

config "./nextflow.config"

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]

input[1] = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) ]
"""
}
}

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

test("test_samtools_faidx_stub_fasta") {

config "./nextflow2.config"

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]

input[1] = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) ]
"""
}
}

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

test("test_samtools_faidx_stub_fai") {

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]

input[1] = [[],[]]
"""
}
}

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

}
249 changes: 249 additions & 0 deletions modules/nf-core/samtools/faidx/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading