Skip to content

Commit

Permalink
Update module: bakta/bakta (nf-core#4847)
Browse files Browse the repository at this point in the history
* Add nf-test + remove pytest files

* Apply changes from code review

* Fix main.test.nf

* Update process label to increase memory/fix diamond error

* Stub tests only

* Increase memory (for CI checks to succeed)

* Fix config, activate test

* Increase memory

* Increase memory

* Activate singularity profile

* Exclude conda tests due to DIAMOND memory issue on conda

* Skip conda

* Skip conda CI check of dependency baktadbdownload

---------

Co-authored-by: James A. Fellows Yates <[email protected]>
  • Loading branch information
2 people authored and adamrtalbot committed Feb 6, 2024
1 parent 72c1733 commit fec1ac8
Show file tree
Hide file tree
Showing 15 changed files with 283 additions and 67 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,10 @@ jobs:
tags: happy/sompy
- profile: conda
tags: backsub
- profile: conda
tags: bakta/bakta
- profile: conda
tags: bakta/baktadbdownload
- profile: conda
tags: bases2fastq
- profile: conda
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/bakta/bakta/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::bakta=1.8.2
- bioconda::bakta=1.9.2
4 changes: 2 additions & 2 deletions modules/nf-core/bakta/bakta/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process BAKTA_BAKTA {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/bakta:1.8.2--pyhdfd78af_0' :
'biocontainers/bakta:1.8.2--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/bakta:1.9.2--pyhdfd78af_0' :
'biocontainers/bakta:1.9.2--pyhdfd78af_0' }"

input:
tuple val(meta), path(fasta)
Expand Down
83 changes: 83 additions & 0 deletions modules/nf-core/bakta/bakta/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
nextflow_process {

name "Test Process BAKTA_BAKTA"
script "../main.nf"
config "./nextflow.config"
process "BAKTA_BAKTA"

tag "modules"
tag "modules_nfcore"
tag "bakta"
tag "bakta/bakta"
tag "bakta/baktadbdownload"

test("Bakta - bacteroides_fragilis - genome.fasta") {

setup {
run("BAKTA_BAKTADBDOWNLOAD") {
script "../../baktadbdownload/main.nf"
process {
"""
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['bacteroides_fragilis']['illumina']['test1_contigs_fa_gz'], checkIfExists: true)
]
input[1] = BAKTA_BAKTADBDOWNLOAD.out.db
input[2] = []
input[3] = []
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.embl.get(0).get(1)).text.contains("/translation=\"MKNTLKIAILLIAIISMGHWMPVKQVCDLNSLSLQNVEALANGET") },
{ assert path(process.out.faa.get(0).get(1)).text.contains("MKNTLKIAILLIAIISMGHWMPVKQVCDLNSLSLQNVEALANGETPNYTFCIGAGSVDCPIQHDKVKYVSQGFSLDY") },
{ assert path(process.out.ffn.get(0).get(1)).text.contains("ATGAAAAACACTTTAAAAATAGCTATTCTTCTTATTGCTATTATTTCTATGGGGCATTGGATGCCTGTAAAACAAGT") },
{ assert path(process.out.fna.get(0).get(1)).text.contains("TCTTTTTACTCATAATCTACTTTTATGATGTTAATTATTTTTTCCGTGTCTCTCTTTCGG") },
{ assert path(process.out.gbff.get(0).get(1)).text.contains("/translation=\"MKNTLKIAILLIAIISMGHWMPVKQVCDLNSLSLQNVEALANGET") },
{ assert path(process.out.gff.get(0).get(1)).text.contains("##sequence-region contig_1 1 2926") },
{ assert path(process.out.hypotheticals_tsv.get(0).get(1)).text.contains("#Annotated with Bakta") },
{ assert path(process.out.hypotheticals_faa.get(0).get(1)).text.contains("MKNLILVLGCFFFLISCQQTEKEKLEELVKNWNGKEVLL") },
{ assert path(process.out.tsv.get(0).get(1)).text.contains("SO:0001217, UniRef:UniRef50_A0A0I9S7A3") },
{ assert path(process.out.txt.get(0).get(1)).text.contains("Length: 1739120") },
{ assert snapshot(process.out.versions).match("versions") }
)
}

}

test("Bakta - stub") {

options "-stub"

when {
process {
"""
input[0] = [[id: 'stub'],file('stub')]
input[1] = []
input[2] = []
input[3] = []
"""
}
}

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

}

}
179 changes: 179 additions & 0 deletions modules/nf-core/bakta/bakta/tests/main.nf.test.snap

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

11 changes: 11 additions & 0 deletions modules/nf-core/bakta/bakta/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
process {

withName: 'BAKTA_BAKTADBDOWNLOAD' {
ext.args = "--type light"
}

withName: 'BAKTA_BAKTA' {
memory = 15.4.GB
}

}
2 changes: 2 additions & 0 deletions modules/nf-core/bakta/bakta/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bakta/bakta:
- "modules/nf-core/bakta/bakta/**"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
process {


withName: 'BAKTA_BAKTADBDOWNLOAD' {
ext.args = "--type light"
}

}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ atlasgeneannotationmanipulation/gtf2featureannotation:
authentict/deam2cont:
- modules/nf-core/authentict/deam2cont/**
- tests/modules/nf-core/authentict/deam2cont/**
bakta/bakta:
- modules/nf-core/bakta/bakta/**
- tests/modules/nf-core/bakta/bakta/**
bam2fastx/bam2fastq:
- modules/nf-core/bam2fastx/bam2fastq/**
- tests/modules/nf-core/bam2fastx/bam2fastq/**
Expand Down
15 changes: 0 additions & 15 deletions tests/modules/nf-core/bakta/bakta/main.nf

This file was deleted.

5 changes: 0 additions & 5 deletions tests/modules/nf-core/bakta/bakta/nextflow.config

This file was deleted.

15 changes: 0 additions & 15 deletions tests/modules/nf-core/bakta/bakta/test.yml

This file was deleted.

9 changes: 0 additions & 9 deletions tests/modules/nf-core/bakta/baktadbdownload/main.nf

This file was deleted.

8 changes: 0 additions & 8 deletions tests/modules/nf-core/bakta/baktadbdownload/nextflow.config

This file was deleted.

8 changes: 0 additions & 8 deletions tests/modules/nf-core/bakta/baktadbdownload/test.yml

This file was deleted.

0 comments on commit fec1ac8

Please sign in to comment.