From fd5aea0b76c1e5b908191f212382a55a57cee316 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 14 Jun 2022 16:30:37 +0200 Subject: [PATCH] Add FastK/Histex (#1776) --- modules/fastk/histex/main.nf | 35 ++++++++++++++++++ modules/fastk/histex/meta.yml | 42 ++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 +++ tests/modules/fastk/histex/main.nf | 17 +++++++++ tests/modules/fastk/histex/nextflow.config | 8 +++++ tests/modules/fastk/histex/test.yml | 8 +++++ 6 files changed, 114 insertions(+) create mode 100644 modules/fastk/histex/main.nf create mode 100644 modules/fastk/histex/meta.yml create mode 100644 tests/modules/fastk/histex/main.nf create mode 100644 tests/modules/fastk/histex/nextflow.config create mode 100644 tests/modules/fastk/histex/test.yml diff --git a/modules/fastk/histex/main.nf b/modules/fastk/histex/main.nf new file mode 100644 index 00000000..b1acd070 --- /dev/null +++ b/modules/fastk/histex/main.nf @@ -0,0 +1,35 @@ +process FASTK_HISTEX { + tag "$meta.id" + label 'process_low' + + if (params.enable_conda) { + error "Conda environments cannot be used when using the FastK tool. Please use docker or singularity containers." + } + container 'ghcr.io/nbisweden/fastk_genescopefk_merquryfk:1.0' + + input: + tuple val(meta), path(histogram) + + output: + tuple val(meta), path("*.hist"), emit: hist + 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}" + def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' + """ + Histex \\ + $args \\ + $histogram \\ + > ${prefix}.hist + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastk: $FASTK_VERSION + END_VERSIONS + """ +} diff --git a/modules/fastk/histex/meta.yml b/modules/fastk/histex/meta.yml new file mode 100644 index 00000000..fab381d3 --- /dev/null +++ b/modules/fastk/histex/meta.yml @@ -0,0 +1,42 @@ +name: "fastk_histex" +description: A fast K-mer counter for high-fidelity shotgun datasets +keywords: + - k-mer + - histogram +tools: + - "fastk": + description: "A fast K-mer counter for high-fidelity shotgun datasets" + homepage: "https://github.com/thegenemyers/FASTK" + documentation: "" + tool_dev_url: "https://github.com/thegenemyers/FASTK" + doi: "" + licence: "https://github.com/thegenemyers/FASTK/blob/master/LICENSE" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - histogram: + type: file + description: A FastK histogram file + pattern: "*.hist" + +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" + - hist: + type: file + description: A formatted histogram file + pattern: "*.hist" + +authors: + - "@mahesh-panchal" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 0e82d01a..f98e8ec9 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -679,6 +679,10 @@ fastk/fastk: - modules/fastk/fastk/** - tests/modules/fastk/fastk/** +fastk/histex: + - modules/fastk/histex/** + - tests/modules/fastk/histex/** + fastp: - modules/fastp/** - tests/modules/fastp/** diff --git a/tests/modules/fastk/histex/main.nf b/tests/modules/fastk/histex/main.nf new file mode 100644 index 00000000..74b46378 --- /dev/null +++ b/tests/modules/fastk/histex/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { FASTK_FASTK } from '../../../../modules/fastk/fastk/main.nf' +include { FASTK_HISTEX } from '../../../../modules/fastk/histex/main.nf' + +workflow test_fastk_histex { + + input = [ + [ id:'test' , single_end: true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + + FASTK_FASTK ( input ) + FASTK_HISTEX ( FASTK_FASTK.out.hist ) +} diff --git a/tests/modules/fastk/histex/nextflow.config b/tests/modules/fastk/histex/nextflow.config new file mode 100644 index 00000000..038a0897 --- /dev/null +++ b/tests/modules/fastk/histex/nextflow.config @@ -0,0 +1,8 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: 'FASTK_FASTK' { + publishDir = [ enabled: false ] + } +} diff --git a/tests/modules/fastk/histex/test.yml b/tests/modules/fastk/histex/test.yml new file mode 100644 index 00000000..8348af8f --- /dev/null +++ b/tests/modules/fastk/histex/test.yml @@ -0,0 +1,8 @@ +- name: fastk histex test_fastk_histex + command: nextflow run ./tests/modules/fastk/histex -entry test_fastk_histex -c ./tests/config/nextflow.config -c ./tests/modules/fastk/histex/nextflow.config + tags: + - fastk/histex + - fastk + files: + - path: output/fastk/test.hist + md5sum: e3f0c9e7641a46525123312008e4ae86