Add krakentools/combinekreports (#2018)

* Add krakentools_combinekreports

* Update test.yml

* Update main.nf

* Update tests/modules/krakentools/combinekreports/test.yml

* Prettier

* Update modules/krakentools/combinekreports/main.nf

Co-authored-by: Robert A. Petit III <robbie.petit@gmail.com>

Co-authored-by: Robert A. Petit III <robbie.petit@gmail.com>
This commit is contained in:
James A. Fellows Yates 2022-09-06 19:32:30 +02:00 committed by GitHub
parent 04dfb65335
commit fe3e18eaee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 108 additions and 0 deletions

View file

@ -0,0 +1,34 @@
process KRAKENTOOLS_COMBINEKREPORTS {
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:
path kreports
output:
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 ?: "kreports_combined.txt"
def VERSION = '1.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
combine_kreports.py \\
-r ${kreports} \\
-o ${prefix} \\
${args}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
combine_kreports.py: ${VERSION}
END_VERSIONS
"""
}

View file

@ -0,0 +1,33 @@
name: krakentools_combinekreports
description: Takes a Kraken report file and prints out a krona-compatible TEXT file
keywords:
- kraken
- krakentools
- metagenomics
- table
- combining
- merging
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:
- kreports:
type: file
description: List of kraken-style report files
pattern: "*.{txt,kreport}"
output:
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- txt:
type: file
description: Combined kreport file of all input files
pattern: "*.txt"
authors:
- "@jfy133"

View file

@ -1302,6 +1302,10 @@ kraken2/kraken2:
- modules/untar/** - modules/untar/**
- tests/modules/kraken2/kraken2/** - tests/modules/kraken2/kraken2/**
krakentools/combinekreports:
- modules/krakentools/combinekreports/**
- tests/modules/krakentools/combinekreports/**
krakentools/kreport2krona: krakentools/kreport2krona:
- modules/krakentools/kreport2krona/** - modules/krakentools/kreport2krona/**
- tests/modules/krakentools/kreport2krona/** - tests/modules/krakentools/kreport2krona/**

View file

@ -0,0 +1,23 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { UNTAR } from '../../../../modules/untar/main'
include { KRAKEN2_KRAKEN2 } from '../../../../modules/kraken2/kraken2/main'
include { KRAKENTOOLS_COMBINEKREPORTS } from '../../../../modules/krakentools/combinekreports/main.nf'
workflow test_krakentools_combinekreports {
input = Channel.of(
[[ id:'test', single_end:false ], [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]],
[[ id:'test2', single_end:false ], [ 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_COMBINEKREPORTS ( KRAKEN2_KRAKEN2.out.report.map{ [ it[1] ] }.collect().dump() )
}

View file

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

View file

@ -0,0 +1,9 @@
- name: krakentools combinekreports test_krakentools_combinekreports
command: nextflow run ./tests/modules/krakentools/combinekreports -entry test_krakentools_combinekreports -c ./tests/config/nextflow.config -c ./tests/modules/krakentools/combinekreports/nextflow.config
tags:
- krakentools/combinekreports
- krakentools
files:
- path: output/krakentools/kreports_combined.txt
contains:
- "#Number of Samples: 2"