From 36bcd675ae76a379a38165898a203f4915823f4f Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Tue, 13 Sep 2022 14:37:46 +0200 Subject: [PATCH] Update METAPHLAN3/MERGEMETAPHLANTABLES (#2041) * Update main.nf * Update meta.yml * Re-add logos as not staged in a way that works with MultiQC config files * Add meta to mergemetaphlan3 tables * Actually combine the data together --- modules/metaphlan3/mergemetaphlantables/main.nf | 6 +++--- modules/metaphlan3/mergemetaphlantables/meta.yml | 10 ++++++++++ tests/modules/metaphlan3/mergemetaphlantables/main.nf | 2 +- tests/modules/metaphlan3/mergemetaphlantables/test.yml | 6 +++--- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/modules/metaphlan3/mergemetaphlantables/main.nf b/modules/metaphlan3/mergemetaphlantables/main.nf index 6fd05e3a..7c37ecab 100644 --- a/modules/metaphlan3/mergemetaphlantables/main.nf +++ b/modules/metaphlan3/mergemetaphlantables/main.nf @@ -7,10 +7,10 @@ process METAPHLAN3_MERGEMETAPHLANTABLES { 'quay.io/biocontainers/metaphlan:3.0.12--pyhb7b1952_0' }" input: - path(profiles) + tuple val(meta), path(profiles) output: - tuple path("${prefix}.txt") , emit: txt + tuple val(meta), path("${prefix}.txt") , emit: txt path "versions.yml" , emit: versions when: @@ -18,7 +18,7 @@ process METAPHLAN3_MERGEMETAPHLANTABLES { script: def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "merged_abundance_table" + prefix = task.ext.prefix ?: "${meta.id}" """ merge_metaphlan_tables.py \\ $args \\ diff --git a/modules/metaphlan3/mergemetaphlantables/meta.yml b/modules/metaphlan3/mergemetaphlantables/meta.yml index c94be25c..365973ef 100644 --- a/modules/metaphlan3/mergemetaphlantables/meta.yml +++ b/modules/metaphlan3/mergemetaphlantables/meta.yml @@ -15,12 +15,22 @@ tools: licence: ["MIT License"] input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - profiles: type: file description: List of per-sample MetaPhlAn3 taxonomic abundance tables pattern: "*" 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 diff --git a/tests/modules/metaphlan3/mergemetaphlantables/main.nf b/tests/modules/metaphlan3/mergemetaphlantables/main.nf index dd99c6c3..6a158d6a 100644 --- a/tests/modules/metaphlan3/mergemetaphlantables/main.nf +++ b/tests/modules/metaphlan3/mergemetaphlantables/main.nf @@ -17,6 +17,6 @@ workflow test_metaphlan3_mergemetaphlantables { UNTAR ( db ) METAPHLAN3 ( input, UNTAR.out.untar.map{ it[1] } ) - METAPHLAN3_MERGEMETAPHLANTABLES ( METAPHLAN3.out.profile.map{it[1]}.collect() ) + METAPHLAN3_MERGEMETAPHLANTABLES ( METAPHLAN3.out.profile.map{ [[id:"test"], it[1]] }.groupTuple() ) } diff --git a/tests/modules/metaphlan3/mergemetaphlantables/test.yml b/tests/modules/metaphlan3/mergemetaphlantables/test.yml index 55690861..57b69aa5 100644 --- a/tests/modules/metaphlan3/mergemetaphlantables/test.yml +++ b/tests/modules/metaphlan3/mergemetaphlantables/test.yml @@ -1,8 +1,8 @@ - name: metaphlan3 mergemetaphlantables test_metaphlan3_mergemetaphlantables command: nextflow run ./tests/modules/metaphlan3/mergemetaphlantables -entry test_metaphlan3_mergemetaphlantables -c ./tests/config/nextflow.config -c ./tests/modules/metaphlan3/mergemetaphlantables/nextflow.config tags: - - metaphlan3 - metaphlan3/mergemetaphlantables + - metaphlan3 files: - - path: output/metaphlan3/merged_abundance_table.txt - contains: ["clade_name NCBI_tax_id "] + - path: output/metaphlan3/test.txt + contains: ["clade_name NCBI_tax_id"]