diff --git a/modules/nf-core/arcashla/extract/meta.yml b/modules/nf-core/arcashla/extract/meta.yml index 3575e782051..6a85aad0f79 100644 --- a/modules/nf-core/arcashla/extract/meta.yml +++ b/modules/nf-core/arcashla/extract/meta.yml @@ -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 diff --git a/modules/nf-core/arcashla/extract/tests/main.nf.test b/modules/nf-core/arcashla/extract/tests/main.nf.test new file mode 100644 index 00000000000..273bece876f --- /dev/null +++ b/modules/nf-core/arcashla/extract/tests/main.nf.test @@ -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() + } + ) + } + } + +} diff --git a/modules/nf-core/arcashla/extract/tests/main.nf.test.snap b/modules/nf-core/arcashla/extract/tests/main.nf.test.snap new file mode 100644 index 00000000000..775118756f8 --- /dev/null +++ b/modules/nf-core/arcashla/extract/tests/main.nf.test.snap @@ -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" + } +} \ No newline at end of file diff --git a/modules/nf-core/arcashla/extract/tests/nextflow.config b/modules/nf-core/arcashla/extract/tests/nextflow.config new file mode 100644 index 00000000000..f54ca35c7ce --- /dev/null +++ b/modules/nf-core/arcashla/extract/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: ARCASHLA_EXTRACT { + ext.args = '--unmapped --keep_files' + } +} diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index c14ed3ba3a5..d56754160c9 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -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/** diff --git a/tests/modules/nf-core/arcashla/extract/main.nf b/tests/modules/nf-core/arcashla/extract/main.nf deleted file mode 100644 index 2a5cf7aecf2..00000000000 --- a/tests/modules/nf-core/arcashla/extract/main.nf +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { ARCASHLA_EXTRACT } from '../../../../../modules/nf-core/arcashla/extract/main.nf' - -workflow test_arcashla_extract { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) - ] - - ARCASHLA_EXTRACT ( input ) - -} - -workflow test_arcashla_extract_single_end { - - input = [ - [ id:'test_single_end', single_end:true ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test3_single_end_markduplicates_sorted_bam'], checkIfExists: true) - ] - - ARCASHLA_EXTRACT ( input ) - -} diff --git a/tests/modules/nf-core/arcashla/extract/nextflow.config b/tests/modules/nf-core/arcashla/extract/nextflow.config deleted file mode 100644 index dc21bcd317c..00000000000 --- a/tests/modules/nf-core/arcashla/extract/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: ARCASHLA_EXTRACT { - ext.args = '--unmapped --keep_files' - } - -} diff --git a/tests/modules/nf-core/arcashla/extract/test.yml b/tests/modules/nf-core/arcashla/extract/test.yml deleted file mode 100644 index 5b2cf790db3..00000000000 --- a/tests/modules/nf-core/arcashla/extract/test.yml +++ /dev/null @@ -1,34 +0,0 @@ -- name: arcashla extract test_arcashla_extract - command: nextflow run ./tests/modules/nf-core/arcashla/extract -entry test_arcashla_extract -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/arcashla/extract/nextflow.config - tags: - - arcashla - - arcashla/extract - files: - - path: output/arcashla/test.paired_end.sorted.extracted.1.fq.gz - contains: - - "testN:2775/1" - - path: output/arcashla/test.paired_end.sorted.extracted.2.fq.gz - contains: - - "testN:2775/2" - - path: output/arcashla/test.log - contains: - - "Converting bam to fastq" - - path: output/arcashla/versions.yml - md5sum: ce48fa53589827141f681ccb16a2a011 - - path: output/arcashla/temp_files - -- name: arcashla extract test_arcashla_extract single end - command: nextflow run ./tests/modules/nf-core/arcashla/extract -entry test_arcashla_extract_single_end -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/arcashla/extract/nextflow.config - tags: - - arcashla - - arcashla/extract - files: - - path: output/arcashla/test3.single_end.markduplicates.sorted.extracted.fq.gz - contains: - - "K00233:65:HKTTVBBXX:5:1101:5609:21518" - - path: output/arcashla/test_single_end.log - contains: - - "Converting bam to fastq" - - path: output/arcashla/versions.yml - md5sum: 36b48f49c345df8cb1d30bfe130e6218 - - path: output/arcashla/temp_files