Skip to content

Commit

Permalink
new module wisecondorx/gender (#3333)
Browse files Browse the repository at this point in the history
* new module wisecondorx/gender

* fix linting
  • Loading branch information
nvnieuwk committed Apr 26, 2023
1 parent c34a6e4 commit 9fc26b5
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 0 deletions.
47 changes: 47 additions & 0 deletions modules/nf-core/wisecondorx/gender/main.nf
Original file line number Diff line number Diff line change
@@ -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
"""
}
47 changes: 47 additions & 0 deletions modules/nf-core/wisecondorx/gender/meta.yml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**
Expand Down
31 changes: 31 additions & 0 deletions tests/modules/nf-core/wisecondorx/gender/main.nf
Original file line number Diff line number Diff line change
@@ -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
)
}
5 changes: 5 additions & 0 deletions tests/modules/nf-core/wisecondorx/gender/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

}
7 changes: 7 additions & 0 deletions tests/modules/nf-core/wisecondorx/gender/test.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 9fc26b5

Please sign in to comment.