diff --git a/modules/sexdeterrmine/main.nf b/modules/sexdeterrmine/main.nf new file mode 100644 index 00000000..f8754764 --- /dev/null +++ b/modules/sexdeterrmine/main.nf @@ -0,0 +1,38 @@ +process SEXDETERRMINE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::sexdeterrmine=1.1.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sexdeterrmine:1.1.2--hdfd78af_1': + 'quay.io/biocontainers/sexdeterrmine:1.1.2--hdfd78af_1' }" + + input: + tuple val(meta), path(depth) + path(sample_list_file) + + output: + tuple val(meta), path("*.json"), emit: json + tuple val(meta), path("*.tsv") , emit: tsv + 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}" + def sample_list = sample_list_file ? '-f ${sample_list_file}' : '' + """ + sexdeterrmine \\ + -I $depth \\ + $sample_list \\ + $args \\ + > ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sexdeterrmine: \$(echo \$(sexdeterrmine --version 2>&1)) + END_VERSIONS + """ +} diff --git a/modules/sexdeterrmine/meta.yml b/modules/sexdeterrmine/meta.yml new file mode 100644 index 00000000..6e24c817 --- /dev/null +++ b/modules/sexdeterrmine/meta.yml @@ -0,0 +1,48 @@ +name: "sexdeterrmine" +description: Calculate the relative coverage on the Gonosomes vs Autosomes from the output of samtools depth, with error bars. +keywords: + - "sex determination" + - "genetic sex" + - "relative coverage" +tools: + - "sexdeterrmine": + description: "A python script carry out calculate the relative coverage of X and Y chromosomes, and their associated error bars, out of capture data." + homepage: "https://github.com/TCLamnidis/Sex.DetERRmine" + documentation: "https://github.com/TCLamnidis/Sex.DetERRmine/README.md" + tool_dev_url: "https://github.com/TCLamnidis/Sex.DetERRmine" + doi: "https://doi.org/10.1038/s41467-018-07483-5" + licence: "['GPL v3']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + # + - depth: + type: file + description: output from samtools depth (with header) + pattern: "*" + +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" + - json: + type: file + description: JSON formatted table of relative coverages on the X and Y, with associated error bars. + pattern: "*.json" + - tsv: + type: file + description: TSV table of relative coverages on the X and Y, with associated error bars. + pattern: "*.tsv" + +authors: + - "@TCLamnidis" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a1a969e7..60c2d46d 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1703,6 +1703,10 @@ seqwish/induce: - modules/seqwish/induce/** - tests/modules/seqwish/induce/** +sexdeterrmine: + - modules/sexdeterrmine/** + - tests/modules/sexdeterrmine/** + shovill: - modules/shovill/** - tests/modules/shovill/** diff --git a/tests/modules/sexdeterrmine/main.nf b/tests/modules/sexdeterrmine/main.nf new file mode 100644 index 00000000..c9d869f5 --- /dev/null +++ b/tests/modules/sexdeterrmine/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SAMTOOLS_DEPTH } from '../../../modules/samtools/depth/main.nf' +include { SEXDETERRMINE } from '../../../modules/sexdeterrmine/main.nf' + +workflow test_sexdeterrmine { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true) ] + + SAMTOOLS_DEPTH ( input ) + SEXDETERRMINE ( SAMTOOLS_DEPTH.out.tsv, [] ) +} diff --git a/tests/modules/sexdeterrmine/nextflow.config b/tests/modules/sexdeterrmine/nextflow.config new file mode 100644 index 00000000..763d7ad6 --- /dev/null +++ b/tests/modules/sexdeterrmine/nextflow.config @@ -0,0 +1,8 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName:SAMTOOLS_DEPTH { + ext.args = "-aa -H" + } +} diff --git a/tests/modules/sexdeterrmine/test.yml b/tests/modules/sexdeterrmine/test.yml new file mode 100644 index 00000000..5eca8a30 --- /dev/null +++ b/tests/modules/sexdeterrmine/test.yml @@ -0,0 +1,12 @@ +## TODO nf-core: Please run the following command to build this file: +# nf-core modules create-test-yml sexdeterrmine +- name: "sexdeterrmine" + command: nextflow run ./tests/modules/sexdeterrmine -entry test_sexdeterrmine -c ./tests/config/nextflow.config -c ./tests/modules/sexdeterrmine/nextflow.config + tags: + - "sexdeterrmine" + # + files: + - path: "output/sexdeterrmine/test.bam" + md5sum: e667c7caad0bc4b7ac383fd023c654fc + - path: output/sexdeterrmine/versions.yml + md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b