Skip to content

Commit

Permalink
Added nf-test for pirate (#6560)
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp authored Sep 5, 2024
1 parent 8b74c80 commit e942cbf
Show file tree
Hide file tree
Showing 8 changed files with 175 additions and 126 deletions.
4 changes: 3 additions & 1 deletion modules/nf-core/pirate/environment.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: pirate

channels:
- conda-forge
- bioconda
- defaults

dependencies:
- bioconda::pirate=1.0.4
- bioconda::perl-bioperl=1.7.2
- bioconda::pirate=1.0.4
12 changes: 12 additions & 0 deletions modules/nf-core/pirate/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,16 @@ process PIRATE {
pirate: \$( echo \$( PIRATE --version 2>&1) | sed 's/PIRATE //' )
END_VERSIONS
"""

stub:
"""
mkdir results
touch results/PIRATE.gene_families.ordered.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
pirate: \$( echo \$( PIRATE --version 2>&1) | sed 's/PIRATE //' )
END_VERSIONS
"""
}
70 changes: 70 additions & 0 deletions modules/nf-core/pirate/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "pirate"

test("test-pirate") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test1.gff', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test2.gff', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test3.gff', checkIfExists: true)
]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{
assert snapshot(
process.out.results[0][1].collect { file(it).name },
process.out.aln,
process.out.versions
).match()
}
)
}
}

test("test-pirate-stub") {
options '-stub'

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test1.gff', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test2.gff', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test3.gff', checkIfExists: true)
]
]
"""
}
}

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

}
90 changes: 90 additions & 0 deletions modules/nf-core/pirate/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"test-pirate": {
"content": [
[
"PIRATE.gene_families.ordered.tsv",
"PIRATE.gene_families.tsv",
"PIRATE.genomes_per_allele.tsv",
"PIRATE.log",
"PIRATE.pangenome_summary.txt",
"PIRATE.unique_alleles.tsv",
"binary_presence_absence.fasta",
"binary_presence_absence.nwk",
"cluster_alleles.tab",
"co-ords",
"genome2loci.tab",
"genome_list.txt",
"link_clusters.log",
"loci_list.tab",
"loci_paralog_categories.tab",
"modified_gffs",
"pan_sequences.fasta",
"pangenome.connected_blocks.tsv",
"pangenome.edges",
"pangenome.gfa",
"pangenome.order.tsv",
"pangenome.reversed.tsv",
"pangenome.syntenic_blocks.tsv",
"pangenome.temp",
"pangenome_iterations",
"pangenome_log.txt",
"paralog_clusters.tab",
"representative_sequences.faa",
"representative_sequences.ffn",
"split_groups.log"
],
[

],
[
"versions.yml:md5,2f5a68c53da1146ee3000263ea61d769"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T16:38:56.92857"
},
"test-pirate-stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"PIRATE.gene_families.ordered.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [

],
"2": [
"versions.yml:md5,2f5a68c53da1146ee3000263ea61d769"
],
"aln": [

],
"results": [
[
{
"id": "test",
"single_end": false
},
"PIRATE.gene_families.ordered.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,2f5a68c53da1146ee3000263ea61d769"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T16:18:13.292321"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,6 @@ picard/collectrnaseqmetrics:
picard/filtersamreads:
- modules/nf-core/picard/filtersamreads/**
- tests/modules/nf-core/picard/filtersamreads/**
pirate:
- modules/nf-core/pirate/**
- tests/modules/nf-core/pirate/**
plink/exclude:
- modules/nf-core/plink/exclude/**
- tests/modules/nf-core/plink/exclude/**
Expand Down
19 changes: 0 additions & 19 deletions tests/modules/nf-core/pirate/main.nf

This file was deleted.

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

This file was deleted.

98 changes: 0 additions & 98 deletions tests/modules/nf-core/pirate/test.yml

This file was deleted.

0 comments on commit e942cbf

Please sign in to comment.