Skip to content

Commit

Permalink
Ported arcashla/extract to nf-test (#6225)
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp authored Aug 21, 2024
1 parent fb387b1 commit 480a8e6
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 74 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/arcashla/extract/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tools:
documentation: "https://github.com/RabadanLab/arcasHLA"
tool_dev_url: "https://github.com/RabadanLab/arcasHLA"
doi: "10.1093/bioinformatics/btz474"
licence: "['GPL v3']"
licence: ["GPL v3"]
input:
- meta:
type: map
Expand Down
72 changes: 72 additions & 0 deletions modules/nf-core/arcashla/extract/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "arcashla"
tag "arcashla/extract"

test("test-arcashla-extract") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert file(process.out.log[0]).text.contains('Converting bam to fastq') },
{ assert snapshot(
process.out.extracted_reads_fastq[0][1].collect { file(it).name },
process.out.intermediate_bam[0][1].collect { bam(it).getReadsMD5() },
file(process.out.intermediate_sam[0][1]).name,
bam(process.out.intermediate_sorted_bam[0][1]).getReadsMD5(),
process.out.versions
).match()
}
)
}
}

test("test-arcashla-extract-single-end") {

when {
process {
"""
input[0] = [
[ id:'test_single_end', single_end:true ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test3.single_end.markduplicates.sorted.bam', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert file(process.out.log[0]).text.contains('Converting bam to fastq') },
{ assert snapshot(
file(process.out.extracted_reads_fastq[0][1]).name,
process.out.intermediate_bam[0][1].collect { bam(it).getReadsMD5() },
file(process.out.intermediate_sam[0][1]).name,
bam(process.out.intermediate_sorted_bam[0][1]).getReadsMD5(),
process.out.versions
).match()
}
)
}
}

}
43 changes: 43 additions & 0 deletions modules/nf-core/arcashla/extract/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"test-arcashla-extract-single-end": {
"content": [
"test3.single_end.markduplicates.sorted.extracted.fq.gz",
[
"c7f49f93d2aebb68f128b85c6b6a36c0",
"13f0c075d7bfddcf19a48669bb69ae4c"
],
"test3.single_end.markduplicates.sorted.hla.sam",
"13f0c075d7bfddcf19a48669bb69ae4c",
[
"versions.yml:md5,bad529c7a165615b9641e7780cc13160"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-21T12:36:32.699685"
},
"test-arcashla-extract": {
"content": [
[
"test.paired_end.sorted.extracted.1.fq.gz",
"test.paired_end.sorted.extracted.2.fq.gz"
],
[
"ef014d5b0cd0903595da255cdce79662",
"ef014d5b0cd0903595da255cdce79662"
],
"test.paired_end.sorted.hla.sam",
"ef014d5b0cd0903595da255cdce79662",
[
"versions.yml:md5,bad529c7a165615b9641e7780cc13160"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-21T12:30:28.486246"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/arcashla/extract/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: ARCASHLA_EXTRACT {
ext.args = '--unmapped --keep_files'
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ amps:
angsd/contamination:
- modules/nf-core/angsd/contamination/**
- tests/modules/nf-core/angsd/contamination/**
arcashla/extract:
- modules/nf-core/arcashla/extract/**
- tests/modules/nf-core/arcashla/extract/**
arriba/arriba:
- modules/nf-core/arriba/arriba/**
- tests/modules/nf-core/arriba/arriba/**
Expand Down
27 changes: 0 additions & 27 deletions tests/modules/nf-core/arcashla/extract/main.nf

This file was deleted.

9 changes: 0 additions & 9 deletions tests/modules/nf-core/arcashla/extract/nextflow.config

This file was deleted.

34 changes: 0 additions & 34 deletions tests/modules/nf-core/arcashla/extract/test.yml

This file was deleted.

0 comments on commit 480a8e6

Please sign in to comment.