diff --git a/modules/meryl/unionsum/main.nf b/modules/meryl/unionsum/main.nf new file mode 100644 index 00000000..98baa870 --- /dev/null +++ b/modules/meryl/unionsum/main.nf @@ -0,0 +1,35 @@ +process MERYL_UNIONSUM { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::meryl=1.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/meryl:1.3--h87f3376_1': + 'quay.io/biocontainers/meryl:1.3--h87f3376_1' }" + + input: + tuple val(meta), path(meryl_dbs) + + output: + tuple val(meta), path("*.unionsum.meryldb"), emit: meryl_db + 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}" + """ + meryl union-sum \\ + threads=$task.cpus \\ + $args \\ + output ${prefix}.unionsum.meryldb \\ + $meryl_dbs + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + meryl: \$( meryl --version |& sed 's/meryl //' ) + END_VERSIONS + """ +} diff --git a/modules/meryl/unionsum/meta.yml b/modules/meryl/unionsum/meta.yml new file mode 100644 index 00000000..cea7f0f6 --- /dev/null +++ b/modules/meryl/unionsum/meta.yml @@ -0,0 +1,41 @@ +name: "meryl_unionsum" +description: A genomic k-mer counter (and sequence utility) with nice features. +keywords: + - k-mer + - unionsum +tools: + - "meryl": + description: "A genomic k-mer counter (and sequence utility) with nice features. " + homepage: "https://github.com/marbl/meryl" + documentation: "https://meryl.readthedocs.io/en/latest/quick-start.html" + tool_dev_url: "https://github.com/marbl/meryl" + doi: "" + licence: "['GPL']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - meryl_dbs: + type: directory + description: Meryl k-mer databases + +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" + - meryl_db: + type: directory + description: A Meryl k-mer database that is the union sum of the input databases + pattern: "*.unionsum.meryldb" + +authors: + - "@mahesh-panchal" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 19ea8eb4..9afe83fd 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1222,6 +1222,10 @@ meryl/histogram: - modules/meryl/histogram/** - tests/modules/meryl/histogram/** +meryl/unionsum: + - modules/meryl/unionsum/** + - tests/modules/meryl/unionsum/** + metabat2/jgisummarizebamcontigdepths: - modules/metabat2/jgisummarizebamcontigdepths/** - tests/modules/metabat2/jgisummarizebamcontigdepths/** diff --git a/tests/modules/meryl/unionsum/main.nf b/tests/modules/meryl/unionsum/main.nf new file mode 100644 index 00000000..6dd40c82 --- /dev/null +++ b/tests/modules/meryl/unionsum/main.nf @@ -0,0 +1,31 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MERYL_COUNT } from '../../../../modules/meryl/count/main.nf' +include { MERYL_UNIONSUM } from '../../../../modules/meryl/unionsum/main.nf' + +workflow test_meryl_unionsum_single_end { + + input = [ + [ id:'test', single_end: true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + + MERYL_COUNT ( input ) + MERYL_UNIONSUM ( MERYL_COUNT.out.meryl_db ) +} + +workflow test_meryl_unionsum_paired_end { + + input = [ + [ id:'test', single_end: false ], // meta map + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + ] + ] + + MERYL_COUNT ( input ) + MERYL_UNIONSUM ( MERYL_COUNT.out.meryl_db ) +} diff --git a/tests/modules/meryl/unionsum/nextflow.config b/tests/modules/meryl/unionsum/nextflow.config new file mode 100644 index 00000000..6d899c50 --- /dev/null +++ b/tests/modules/meryl/unionsum/nextflow.config @@ -0,0 +1,6 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + ext.args = 'k=21' + +} diff --git a/tests/modules/meryl/unionsum/test.yml b/tests/modules/meryl/unionsum/test.yml new file mode 100644 index 00000000..10a1a155 --- /dev/null +++ b/tests/modules/meryl/unionsum/test.yml @@ -0,0 +1,17 @@ +- name: meryl unionsum test_meryl_unionsum_single_end + command: nextflow run tests/modules/meryl/unionsum -entry test_meryl_unionsum_single_end -c tests/config/nextflow.config + tags: + - meryl + - meryl/unionsum + files: + - path: output/meryl/versions.yml + md5sum: 7de859c6d3a29d72f6c9c976609d0913 + +- name: meryl unionsum test_meryl_unionsum_paired_end + command: nextflow run tests/modules/meryl/unionsum -entry test_meryl_unionsum_paired_end -c tests/config/nextflow.config + tags: + - meryl + - meryl/unionsum + files: + - path: output/meryl/versions.yml + md5sum: a16decdec014ccb9bdab69a4a1d30818