Skip to content

Commit

Permalink
Dp24 windowmasker (nf-core#4924)
Browse files Browse the repository at this point in the history
* Adding updated modules and nf-tests

* Remove pytest folders and edut the pytest file

* reverting convert to 2.14

* reverting convert to 2.15

* Forgot the conda environmrnt
  • Loading branch information
DLBPointon authored and jennylsmith committed Mar 20, 2024
1 parent 8e78842 commit e982959
Show file tree
Hide file tree
Showing 30 changed files with 520 additions and 184 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/windowmasker/convert/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::blast=2.13.0
- bioconda::blast=2.15.0
24 changes: 12 additions & 12 deletions modules/nf-core/windowmasker/convert/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process WINDOWMASKER_CONVERT {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/blast:2.13.0--hf3cf87c_0':
'biocontainers/blast:2.13.0--hf3cf87c_0' }"
'https://depot.galaxyproject.org/singularity/blast:2.15.0--pl5321h6f7f691_1':
'biocontainers/blast:2.15.0--pl5321h6f7f691_1' }"

input:
tuple val(meta), path(counts)
Expand All @@ -18,11 +18,11 @@ process WINDOWMASKER_CONVERT {
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def outfmt = args.contains('-sformat binary') ? 'binary' :
args.contains('-sformat oascii') ? 'oascii' :
args.contains('-sformat obinary') ? 'obinary' :
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def outfmt = args.contains('-sformat binary') ? 'binary' :
args.contains('-sformat oascii') ? 'oascii' :
args.contains('-sformat obinary') ? 'obinary' :
'ascii'
output = "${prefix}.${outfmt}"
"""
Expand All @@ -38,11 +38,11 @@ process WINDOWMASKER_CONVERT {
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def outfmt = args.contains('-sformat binary') ? 'binary' :
args.contains('-sformat oascii') ? 'oascii' :
args.contains('-sformat obinary') ? 'obinary' :
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def outfmt = args.contains('-sformat binary') ? 'binary' :
args.contains('-sformat oascii') ? 'oascii' :
args.contains('-sformat obinary') ? 'obinary' :
'ascii'
output = "${prefix}.${outfmt}"
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: WINDOWMASKER_CONVERT {
ext.args = '-sformat binary'
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: WINDOWMASKER_CONVERT {
ext.args = '-sformat oascii'
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: WINDOWMASKER_CONVERT {
ext.args = '-sformat obinary'
}
}
105 changes: 105 additions & 0 deletions modules/nf-core/windowmasker/convert/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "windowmasker"
tag "windowmasker/convert"
tag "windowmasker/mkcounts"

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

test("sarscov2_fasta_binary") {
config "./convert_binary.config"
when {
process {
"""
input[0] = WINDOWMASKER_MKCOUNTS.out.counts
"""
}
}

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

}

test("sarscov2_fasta_obinary") {
config "./convert_obinary.config"
when {
process {
"""
input[0] = WINDOWMASKER_MKCOUNTS.out.counts
"""
}
}

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

}

test("sarscov2_fasta_oascii") {
config "./convert_oascii.config"
when {
process {
"""
input[0] = WINDOWMASKER_MKCOUNTS.out.counts
"""
}
}

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

}

test("sarscov2_fasta_stub") {

options '-stub'

when {
process {
"""
input[0] = [
[id: "test" ],
[ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]
]
"""
}
}
then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}
}
118 changes: 118 additions & 0 deletions modules/nf-core/windowmasker/convert/tests/main.nf.test.snap

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

2 changes: 2 additions & 0 deletions modules/nf-core/windowmasker/convert/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
windowmasker/convert:
- "modules/nf-core/windowmasker/convert/**"
2 changes: 1 addition & 1 deletion modules/nf-core/windowmasker/mkcounts/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::blast=2.14.0
- bioconda::blast=2.15.0
8 changes: 4 additions & 4 deletions modules/nf-core/windowmasker/mkcounts/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process WINDOWMASKER_MKCOUNTS {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/blast:2.14.0--h7d5a4b4_1':
'biocontainers/blast:2.14.0--h7d5a4b4_1' }"
'https://depot.galaxyproject.org/singularity/blast:2.15.0--pl5321h6f7f691_1':
'biocontainers/blast:2.15.0--pl5321h6f7f691_1' }"

input:
tuple val(meta), path(ref)
Expand All @@ -21,11 +21,11 @@ process WINDOWMASKER_MKCOUNTS {
def args = task.ext.args ?: ""
def prefix = task.ext.prefix ?: "${meta.id}"

def memory = 3072
def memory = 3072
if (!task.memory) {
log.info '[WINDOWMASKER: MK_COUNTS] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
memory = (task.memory.toMega()).intValue()
memory = (task.memory.toMega()).intValue()
}

"""
Expand Down
59 changes: 59 additions & 0 deletions modules/nf-core/windowmasker/mkcounts/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "windowmasker"
tag "windowmasker/mkcounts"

test("sarscov2_fasta") {

when {
params {
// define parameters here. Example:
// outdir = "tests/results"
}
process {
"""
input[0] = [
[id: "test" ],
[ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]
]
"""
}
}

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

}
test("sarscov2_fasta_stub") {

options '-stub'

when {
process {
"""
input[0] = [
[id: "test" ],
[ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)]
]
"""
}
}
then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

}
Loading

0 comments on commit e982959

Please sign in to comment.