diff --git a/modules/nf-core/wisecondorx/gender/main.nf b/modules/nf-core/wisecondorx/gender/main.nf new file mode 100644 index 00000000000..97b14211c6b --- /dev/null +++ b/modules/nf-core/wisecondorx/gender/main.nf @@ -0,0 +1,47 @@ +process WISECONDORX_GENDER { + tag "$meta.id" + label 'process_low' + + // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + conda "bioconda::wisecondorx=1.2.5" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/wisecondorx:1.2.5--pyh5e36f6f_0': + 'quay.io/biocontainers/wisecondorx:1.2.5--pyh5e36f6f_0' }" + + input: + tuple val(meta), path(npz) + tuple val(meta2), path(reference) + + output: + tuple val(meta), stdout , emit: gender + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def VERSION = '1.2.5' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + + """ + WisecondorX gender \\ + ${npz} \\ + ${reference} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + wisecondorx: ${VERSION} + END_VERSIONS + """ + + stub: + def VERSION = '1.2.5' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + + """ + echo male + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + wisecondorx: ${VERSION} + END_VERSIONS + """ +} diff --git a/modules/nf-core/wisecondorx/gender/meta.yml b/modules/nf-core/wisecondorx/gender/meta.yml new file mode 100644 index 00000000000..0c66eb931e9 --- /dev/null +++ b/modules/nf-core/wisecondorx/gender/meta.yml @@ -0,0 +1,47 @@ +name: "wisecondorx_gender" +description: Returns the gender of a .npz resulting from convert, based on a Gaussian mixture model trained during the newref phase +keywords: + - copy number analysis + - gender determination + - npz +tools: + - "wisecondorx": + description: "WIthin-SamplE COpy Number aberration DetectOR, including sex chromosomes" + homepage: "https://github.com/CenterForMedicalGeneticsGhent/WisecondorX" + documentation: "https://github.com/CenterForMedicalGeneticsGhent/WisecondorX" + tool_dev_url: "https://github.com/CenterForMedicalGeneticsGhent/WisecondorX" + doi: "10.1093/nar/gky1263" + licence: "['Attribution-NonCommercial-ShareAlike CC BY-NC-SA']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - npz: + type: file + description: Single sample NPZ file (from which to determine the gender) + pattern: "*.npz" + - reference: + type: file + description: Reference NPZ file + pattern: "*.npz" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - gender: + type: string + description: The gender of the input NPZ file + pattern: "(fe)?male" + +authors: + - "@nvnieuwk" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 48978559c5a..8b04a4d88ae 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -3765,6 +3765,10 @@ wisecondorx/convert: - modules/nf-core/wisecondorx/convert/** - tests/modules/nf-core/wisecondorx/convert/** +wisecondorx/gender: + - modules/nf-core/wisecondorx/gender/** + - tests/modules/nf-core/wisecondorx/gender/** + wisecondorx/newref: - modules/nf-core/wisecondorx/newref/** - tests/modules/nf-core/wisecondorx/newref/** diff --git a/tests/modules/nf-core/wisecondorx/gender/main.nf b/tests/modules/nf-core/wisecondorx/gender/main.nf new file mode 100644 index 00000000000..7a690fc5023 --- /dev/null +++ b/tests/modules/nf-core/wisecondorx/gender/main.nf @@ -0,0 +1,31 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { WISECONDORX_GENDER } from '../../../../../modules/nf-core/wisecondorx/gender/main.nf' +include { WISECONDORX_CONVERT } from '../../../../../modules/nf-core/wisecondorx/convert/main.nf' + +workflow test_wisecondorx_gender { + + input = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam_bai'], checkIfExists: true) + ]) + + WISECONDORX_CONVERT( + input, + [[], []], + [[], []] + ) + + reference = [ + [ id: "reference" ], + file("reference.npz") + ] + + WISECONDORX_GENDER( + WISECONDORX_CONVERT.out.npz, + reference + ) +} diff --git a/tests/modules/nf-core/wisecondorx/gender/nextflow.config b/tests/modules/nf-core/wisecondorx/gender/nextflow.config new file mode 100644 index 00000000000..50f50a7a357 --- /dev/null +++ b/tests/modules/nf-core/wisecondorx/gender/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/nf-core/wisecondorx/gender/test.yml b/tests/modules/nf-core/wisecondorx/gender/test.yml new file mode 100644 index 00000000000..74a7765f430 --- /dev/null +++ b/tests/modules/nf-core/wisecondorx/gender/test.yml @@ -0,0 +1,7 @@ +- name: "wisecondorx gender" + command: nextflow run ./tests/modules/nf-core/wisecondorx/gender -entry test_wisecondorx_gender -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/wisecondorx/gender/nextflow.config -stub + tags: + - "wisecondorx" + - "wisecondorx/gender" + files: + - path: "output/wisecondorx/versions.yml"