From 7365564c402cbd01e9407810730efd10039997a3 Mon Sep 17 00:00:00 2001 From: Alexander Ramos Date: Thu, 26 Oct 2023 09:52:08 -0600 Subject: [PATCH] new module: kaiju/mkfmi (#4125) * new module: kaiju/mkfmi * local tests * Update modules/nf-core/kaiju/mkfmi/main.nf Co-authored-by: James A. Fellows Yates * Update modules/nf-core/kaiju/mkfmi/meta.yml Co-authored-by: James A. Fellows Yates * Update modules/nf-core/kaiju/mkfmi/meta.yml Co-authored-by: James A. Fellows Yates --------- Co-authored-by: James A. Fellows Yates --- modules/nf-core/kaiju/mkfmi/main.nf | 36 +++++++++++++++ modules/nf-core/kaiju/mkfmi/meta.yml | 44 +++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/nf-core/kaiju/mkfmi/main.nf | 15 +++++++ .../nf-core/kaiju/mkfmi/nextflow.config | 9 ++++ tests/modules/nf-core/kaiju/mkfmi/test.yml | 9 ++++ 6 files changed, 117 insertions(+) create mode 100644 modules/nf-core/kaiju/mkfmi/main.nf create mode 100644 modules/nf-core/kaiju/mkfmi/meta.yml create mode 100644 tests/modules/nf-core/kaiju/mkfmi/main.nf create mode 100644 tests/modules/nf-core/kaiju/mkfmi/nextflow.config create mode 100644 tests/modules/nf-core/kaiju/mkfmi/test.yml diff --git a/modules/nf-core/kaiju/mkfmi/main.nf b/modules/nf-core/kaiju/mkfmi/main.nf new file mode 100644 index 00000000000..bd9bad6abaa --- /dev/null +++ b/modules/nf-core/kaiju/mkfmi/main.nf @@ -0,0 +1,36 @@ +process KAIJU_MKFMI { + tag "$meta.id" + label 'process_high' + + conda "bioconda::kaiju=1.9.2" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/kaiju:1.9.2--h5b5514e_0': + 'biocontainers/kaiju:1.9.2--h5b5514e_0' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*.fmi"), emit: fmi + 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}" + """ + kaiju-mkbwt \\ + $args \\ + -n $task.cpus \\ + -o ${prefix} \\ + ${fasta} + kaiju-mkfmi ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' )) + END_VERSIONS + """ +} diff --git a/modules/nf-core/kaiju/mkfmi/meta.yml b/modules/nf-core/kaiju/mkfmi/meta.yml new file mode 100644 index 00000000000..fe06f3588f9 --- /dev/null +++ b/modules/nf-core/kaiju/mkfmi/meta.yml @@ -0,0 +1,44 @@ +name: "kaiju_mkfmi" +description: Make Kaiju FMI-index file from a protein FASTA file +keywords: + - classify + - metagenomics + - fastq + - taxonomic profiling + - database + - index +tools: + - "kaiju": + description: "Fast and sensitive taxonomic classification for metagenomics" + homepage: "https://bioinformatics-centre.github.io/kaiju/" + documentation: "https://github.com/bioinformatics-centre/kaiju/blob/master/README.md" + tool_dev_url: "https://github.com/bioinformatics-centre/kaiju" + doi: "10.1038/ncomms11257" + licence: ["GNU GPL v3"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - fasta: + type: file + description: Uncompressed Protein FASTA file (mandatory) + pattern: "*.{fa,faa,fasta}" +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" + - fmi: + type: file + description: Kaiju FM-index file + pattern: "*.{fmi}" + +authors: + - "@alxndrdiaz" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index db925b6837d..6579d98ebe5 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1936,6 +1936,10 @@ kaiju/kaiju2table: - modules/nf-core/kaiju/kaiju2table/** - tests/modules/nf-core/kaiju/kaiju2table/** +kaiju/mkfmi: + - modules/nf-core/kaiju/mkfmi/** + - tests/modules/nf-core/kaiju/mkfmi/** + kalign/align: - modules/nf-core/kalign/align/** - tests/modules/nf-core/kalign/align/** diff --git a/tests/modules/nf-core/kaiju/mkfmi/main.nf b/tests/modules/nf-core/kaiju/mkfmi/main.nf new file mode 100644 index 00000000000..488268969c1 --- /dev/null +++ b/tests/modules/nf-core/kaiju/mkfmi/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { KAIJU_MKFMI } from '../../../../../modules/nf-core/kaiju/mkfmi/main.nf' + +workflow test_kaiju_mkfmi { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['proteome_fasta'], checkIfExists: true) + ] + + KAIJU_MKFMI ( input ) +} diff --git a/tests/modules/nf-core/kaiju/mkfmi/nextflow.config b/tests/modules/nf-core/kaiju/mkfmi/nextflow.config new file mode 100644 index 00000000000..cfcf98872bc --- /dev/null +++ b/tests/modules/nf-core/kaiju/mkfmi/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: KAIJU_MKFMI { + ext.args = '-a ACDEFGHIKLMNPQRSTVWY' + } + +} \ No newline at end of file diff --git a/tests/modules/nf-core/kaiju/mkfmi/test.yml b/tests/modules/nf-core/kaiju/mkfmi/test.yml new file mode 100644 index 00000000000..8c44efce1af --- /dev/null +++ b/tests/modules/nf-core/kaiju/mkfmi/test.yml @@ -0,0 +1,9 @@ +- name: kaiju mkfmi test_kaiju_mkfmi + command: nextflow run ./tests/modules/nf-core/kaiju/mkfmi -entry test_kaiju_mkfmi -c ./tests/config/nextflow.config + tags: + - kaiju/mkfmi + - kaiju + files: + - path: output/kaiju/test.fmi + md5sum: 05615794180a9c2e739a9bf1c24c99d5 + - path: output/kaiju/versions.yml