Skip to content

Commit

Permalink
new module: kaiju/mkfmi (nf-core#4125)
Browse files Browse the repository at this point in the history
* new module: kaiju/mkfmi

* local tests

* Update modules/nf-core/kaiju/mkfmi/main.nf

Co-authored-by: James A. Fellows Yates <[email protected]>

* Update modules/nf-core/kaiju/mkfmi/meta.yml

Co-authored-by: James A. Fellows Yates <[email protected]>

* Update modules/nf-core/kaiju/mkfmi/meta.yml

Co-authored-by: James A. Fellows Yates <[email protected]>

---------

Co-authored-by: James A. Fellows Yates <[email protected]>
  • Loading branch information
alxndrdiaz and jfy133 authored Oct 26, 2023
1 parent bb0fc44 commit 7365564
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 0 deletions.
36 changes: 36 additions & 0 deletions modules/nf-core/kaiju/mkfmi/main.nf
Original file line number Diff line number Diff line change
@@ -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
"""
}
44 changes: 44 additions & 0 deletions modules/nf-core/kaiju/mkfmi/meta.yml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**
Expand Down
15 changes: 15 additions & 0 deletions tests/modules/nf-core/kaiju/mkfmi/main.nf
Original file line number Diff line number Diff line change
@@ -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 )
}
9 changes: 9 additions & 0 deletions tests/modules/nf-core/kaiju/mkfmi/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
process {

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

withName: KAIJU_MKFMI {
ext.args = '-a ACDEFGHIKLMNPQRSTVWY'
}

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

0 comments on commit 7365564

Please sign in to comment.