From 30e64becaa1e6c807a09a49a6d3d457ff3cf7251 Mon Sep 17 00:00:00 2001 From: Mei Wu <25568561+projectoriented@users.noreply.github.com> Date: Tue, 11 Jan 2022 22:31:37 +0100 Subject: [PATCH] ucsc/wigtobigwig: add meta map (#1199) * add meta info * updated meta.yml * Apply suggestions from code review * Update test.yml Co-authored-by: Harshil Patel --- modules/ucsc/wigtobigwig/main.nf | 11 ++++++----- modules/ucsc/wigtobigwig/meta.yml | 6 ++++++ tests/modules/ucsc/wigtobigwig/main.nf | 3 ++- tests/modules/ucsc/wigtobigwig/test.yml | 2 ++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/ucsc/wigtobigwig/main.nf b/modules/ucsc/wigtobigwig/main.nf index 4c596c9a..6a1847b6 100644 --- a/modules/ucsc/wigtobigwig/main.nf +++ b/modules/ucsc/wigtobigwig/main.nf @@ -1,7 +1,7 @@ def VERSION = '377' // Version information not provided by tool on CLI process UCSC_WIGTOBIGWIG { - tag '$wig' + tag "$meta.id" label 'process_medium' conda (params.enable_conda ? "bioconda::ucsc-wigtobigwig=377" : null) @@ -10,21 +10,22 @@ process UCSC_WIGTOBIGWIG { 'quay.io/biocontainers/ucsc-wigtobigwig:377--h0b8a92a_2' }" input: - path wig + tuple val(meta), path(wig) path sizes output: - path "*.bw" , emit: bw - path "versions.yml", emit: versions + tuple val(meta), path("*.bw"), emit: bw + path "versions.yml" , emit: versions script: def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ wigToBigWig \\ $args \\ $wig \\ $sizes \\ - ${wig.getSimpleName()}.bw + ${prefix}.bw cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/ucsc/wigtobigwig/meta.yml b/modules/ucsc/wigtobigwig/meta.yml index 4723ff2b..5ca94bb4 100644 --- a/modules/ucsc/wigtobigwig/meta.yml +++ b/modules/ucsc/wigtobigwig/meta.yml @@ -15,6 +15,11 @@ tools: licence: ['varies; see http://genome.ucsc.edu/license'] input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - wig: type: file description: wig file @@ -35,3 +40,4 @@ output: authors: - "@jianhong" + - "@projectoriented" diff --git a/tests/modules/ucsc/wigtobigwig/main.nf b/tests/modules/ucsc/wigtobigwig/main.nf index 614d4150..2abbe5b2 100644 --- a/tests/modules/ucsc/wigtobigwig/main.nf +++ b/tests/modules/ucsc/wigtobigwig/main.nf @@ -6,7 +6,8 @@ include { UCSC_WIGTOBIGWIG } from '../../../../modules/ucsc/wigtobigwig/main.nf' workflow test_ucsc_wigtobigwig { - input = file(params.test_data['sarscov2']['illumina']['test_wig_gz'], checkIfExists: true) + input = [ [ id:'test', single_end:false ], // meta map, + file(params.test_data['sarscov2']['illumina']['test_wig_gz'], checkIfExists: true) ] sizes = file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true) diff --git a/tests/modules/ucsc/wigtobigwig/test.yml b/tests/modules/ucsc/wigtobigwig/test.yml index 08d4bce4..ea1e12b0 100644 --- a/tests/modules/ucsc/wigtobigwig/test.yml +++ b/tests/modules/ucsc/wigtobigwig/test.yml @@ -6,3 +6,5 @@ files: - path: output/ucsc/test.bw md5sum: b64af7003665dc51fae958216b06ed95 + - path: output/ucsc/versions.yml + md5sum: 7e14421c65faf5165389f34806acdb12