mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
New module: krakentools/kreport2krona (#1746)
* Add module definition for kreport2krona * Add metadata for kreport2krona module * Add tests for kreport2krona Co-authored-by: Robert A. Petit III <robbie.petit@gmail.com>
This commit is contained in:
parent
b689b8ed88
commit
8b2a473f58
6 changed files with 114 additions and 0 deletions
36
modules/krakentools/kreport2krona/main.nf
Normal file
36
modules/krakentools/kreport2krona/main.nf
Normal file
|
@ -0,0 +1,36 @@
|
|||
def VERSION = '1.2' // Version information not provided by tool on CLI
|
||||
|
||||
process KRAKENTOOLS_KREPORT2KRONA {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::krakentools=1.2" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/krakentools:1.2--pyh5e36f6f_0':
|
||||
'quay.io/biocontainers/krakentools:1.2--pyh5e36f6f_0' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(kreport)
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.txt"), emit: txt
|
||||
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}"
|
||||
"""
|
||||
kreport2krona.py \\
|
||||
-r ${kreport} \\
|
||||
-o ${prefix}.txt \\
|
||||
${args}
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
kreport2krona.py: ${VERSION}
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
41
modules/krakentools/kreport2krona/meta.yml
Normal file
41
modules/krakentools/kreport2krona/meta.yml
Normal file
|
@ -0,0 +1,41 @@
|
|||
name: krakentools_kreport2krona
|
||||
description: Takes a Kraken report file and prints out a krona-compatible TEXT file
|
||||
keywords:
|
||||
- kraken
|
||||
- krona
|
||||
- metagenomics
|
||||
- visualization
|
||||
tools:
|
||||
- krakentools:
|
||||
description: KrakenTools is a suite of scripts to be used for post-analysis of Kraken/KrakenUniq/Kraken2/Bracken results. Please cite the relevant paper if using KrakenTools with any of the listed programs.
|
||||
homepage: https://github.com/jenniferlu717/KrakenTools
|
||||
licence: ["GPL v3"]
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- kreport:
|
||||
type: file
|
||||
description: Kraken report
|
||||
pattern: "*.{txt,kreport}"
|
||||
|
||||
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"
|
||||
- krona:
|
||||
type: file
|
||||
description: Krona text-based input file converted from Kraken report
|
||||
pattern: "*.{txt,krona}"
|
||||
|
||||
authors:
|
||||
- "@MillironX"
|
|
@ -1146,6 +1146,10 @@ kraken2/kraken2:
|
|||
- modules/untar/**
|
||||
- tests/modules/kraken2/kraken2/**
|
||||
|
||||
krakentools/kreport2krona:
|
||||
- modules/krakentools/kreport2krona/**
|
||||
- tests/modules/krakentools/kreport2krona/**
|
||||
|
||||
krona/kronadb:
|
||||
- modules/krona/kronadb/**
|
||||
- tests/modules/krona/kronadb/**
|
||||
|
|
20
tests/modules/krakentools/kreport2krona/main.nf
Normal file
20
tests/modules/krakentools/kreport2krona/main.nf
Normal file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { UNTAR } from '../../../../modules/untar/main'
|
||||
include { KRAKEN2_KRAKEN2 } from '../../../../modules/kraken2/kraken2/main'
|
||||
include { KRAKENTOOLS_KREPORT2KRONA } from '../../../../modules/krakentools/kreport2krona/main'
|
||||
|
||||
workflow test_krakentools_kreport2krona {
|
||||
|
||||
input = Channel.of([ [ 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) ]
|
||||
])
|
||||
db = [ [], file(params.test_data['sarscov2']['genome']['kraken2_tar_gz'], checkIfExists: true) ]
|
||||
|
||||
UNTAR ( db )
|
||||
KRAKEN2_KRAKEN2 ( input, UNTAR.out.untar.map{ it[1] }, false, false )
|
||||
KRAKENTOOLS_KREPORT2KRONA ( KRAKEN2_KRAKEN2.out.report )
|
||||
}
|
5
tests/modules/krakentools/kreport2krona/nextflow.config
Normal file
5
tests/modules/krakentools/kreport2krona/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
8
tests/modules/krakentools/kreport2krona/test.yml
Normal file
8
tests/modules/krakentools/kreport2krona/test.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
- name: krakentools kreport2krona test_krakentools_kreport2krona
|
||||
command: nextflow run ./tests/modules/krakentools/kreport2krona -entry test_krakentools_kreport2krona -c ./tests/config/nextflow.config -c ./tests/modules/krakentools/kreport2krona/nextflow.config
|
||||
tags:
|
||||
- krakentools/kreport2krona
|
||||
- krakentools
|
||||
files:
|
||||
- path: output/krakentools/test.txt
|
||||
md5sum: c89a9db7acbdba9dea0fe246bcaa85c1
|
Loading…
Reference in a new issue