diff --git a/modules/nf-core/muse/call/environment.yml b/modules/nf-core/muse/call/environment.yml new file mode 100644 index 00000000000..5bc34c10360 --- /dev/null +++ b/modules/nf-core/muse/call/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::muse=2.1.2" diff --git a/modules/nf-core/muse/call/main.nf b/modules/nf-core/muse/call/main.nf new file mode 100644 index 00000000000..b4559761ab0 --- /dev/null +++ b/modules/nf-core/muse/call/main.nf @@ -0,0 +1,50 @@ +process MUSE_CALL { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/9f/9f0ebb574ef5eed2a6e034f1b2feea6c252d1ab0c8bc5135a669059aa1f4d2ca/data': + 'community.wave.seqera.io/library/muse:6637291dcbb0bdb8' }" + + input: + tuple val(meta), path(tumor_bam), path(tumor_bai), path(normal_bam), path(normal_bai) + tuple val(meta2), path(reference) + + output: + tuple val(meta), path("*.MuSE.txt"), emit: txt + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + MuSE \\ + call \\ + $args \\ + -f $reference \\ + -O ${prefix} \\ + -n $task.cpus \\ + $tumor_bam \\ + $normal_bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + MuSE: \$( MuSE --version | sed -e "s/MuSE, version //g" ) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.MuSE.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + MuSE: \$( MuSE --version | sed -e "s/MuSE, version //g" ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/muse/call/meta.yml b/modules/nf-core/muse/call/meta.yml new file mode 100644 index 00000000000..6733677dbdc --- /dev/null +++ b/modules/nf-core/muse/call/meta.yml @@ -0,0 +1,72 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "muse_call" +description: pre-filtering and calculating position-specific summary statistics using + the Markov substitution model +keywords: + - variant calling + - somatic + - wgs + - wxs + - vcf +tools: + - "MuSE": + description: "Somatic point mutation caller based on Markov substitution model + for molecular evolution" + homepage: "https://bioinformatics.mdanderson.org/public-software/muse/" + documentation: "https://github.com/wwylab/MuSE" + tool_dev_url: "https://github.com/wwylab/MuSE" + doi: "10.1101/gr.278456.123" + licence: ["https://github.com/danielfan/MuSE/blob/master/LICENSE"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - tumor_bam: + type: file + description: Sorted tumor BAM file + pattern: "*.bam" + - tumor_bai: + type: file + description: Index file for the tumor BAM file + pattern: "*.bai" + - normal_bam: + type: file + description: Sorted matched normal BAM file + pattern: "*.bam" + - normal_bai: + type: file + description: Index file for the normal BAM file + pattern: "*.bai" + - - meta2: + type: map + description: | + Groovy Map containing reference information. + e.g. `[ id:'test' ]` + - reference: + type: file + description: reference genome file + pattern: ".fasta" +output: + - txt: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*.MuSE.txt": + type: file + description: position-specific summary statistics + pattern: "*.MuSE.txt" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@famosab" +maintainers: + - "@famosab" diff --git a/modules/nf-core/muse/call/tests/main.nf.test b/modules/nf-core/muse/call/tests/main.nf.test new file mode 100644 index 00000000000..b5e441ec32d --- /dev/null +++ b/modules/nf-core/muse/call/tests/main.nf.test @@ -0,0 +1,72 @@ +nextflow_process { + + name "Test Process MUSE_CALL" + script "../main.nf" + process "MUSE_CALL" + + tag "modules" + tag "modules_nfcore" + tag "muse" + tag "muse/call" + + test("human - bam") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) + ] + input[1] = [ + [ id:'reference' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("human - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) + ] + input[1] = [ + [ id:'reference' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/muse/call/tests/main.nf.test.snap b/modules/nf-core/muse/call/tests/main.nf.test.snap new file mode 100644 index 00000000000..ead8906a9ce --- /dev/null +++ b/modules/nf-core/muse/call/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "human - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.MuSE.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,de7c8f535f5b17473ed6aab68f1d70c1" + ], + "txt": [ + [ + { + "id": "test" + }, + "test.MuSE.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,de7c8f535f5b17473ed6aab68f1d70c1" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-29T14:30:48.292828" + }, + "human - bam": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.MuSE.txt:md5,3a38ee9131a217cc56199bd4a6b18e1d" + ] + ], + "1": [ + "versions.yml:md5,de7c8f535f5b17473ed6aab68f1d70c1" + ], + "txt": [ + [ + { + "id": "test" + }, + "test.MuSE.txt:md5,3a38ee9131a217cc56199bd4a6b18e1d" + ] + ], + "versions": [ + "versions.yml:md5,de7c8f535f5b17473ed6aab68f1d70c1" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-29T14:30:32.522553" + } +} \ No newline at end of file diff --git a/modules/nf-core/muse/call/tests/tags.yml b/modules/nf-core/muse/call/tests/tags.yml new file mode 100644 index 00000000000..4e04a91a4af --- /dev/null +++ b/modules/nf-core/muse/call/tests/tags.yml @@ -0,0 +1,2 @@ +muse/call: + - "modules/nf-core/muse/call/**"