1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-25 16:59:54 +00:00

Standardise mOTUs table merge

This commit is contained in:
James Fellows Yates 2022-09-16 08:36:34 +02:00
parent d9795a4fdc
commit 4e7857e2ed
4 changed files with 24 additions and 10 deletions

View file

@ -418,6 +418,8 @@ process {
}
withName: MOTUS_MERGE {
ext.args = { params.generate_biom_output ? "-B" : "" }
ext.prefix = { "motus_${meta.id}_combined_reports" }
publishDir = [
path: { "${params.outdir}/motus/" },
mode: params.publish_dir_mode

View file

@ -99,7 +99,7 @@
},
"metaphlan3/metaphlan3": {
"branch": "master",
"git_sha": "940d7fe9d63962e0e2ba0987e2893fb0aff832e3"
"git_sha": "978087354eb72ac1f6e18a3f790fad9bc4d05840"
},
"minimap2/align": {
"branch": "master",
@ -107,11 +107,11 @@
},
"minimap2/index": {
"branch": "master",
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
"git_sha": "73e062cf5e0ef346f65d73009b1b656299359fc5"
},
"motus/merge": {
"branch": "master",
"git_sha": "b02e648c221e1da17cb589eefe297e61ec9e9c49"
"git_sha": "8372df6fb2a7638adacae070860685373be61e1f"
},
"motus/profile": {
"branch": "master",

View file

@ -1,6 +1,7 @@
VERSION = '3.0.1'
process MOTUS_MERGE {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::motus=3.0.1" : null)
@ -9,14 +10,14 @@ process MOTUS_MERGE {
'quay.io/biocontainers/motus:3.0.1--pyhdfd78af_0' }"
input:
path input
tuple val(meta), path(input)
path db // to stop docker saying it can't find it... would have to have the module in upstream steps anyway
path profile_version_yml, stageAs: 'profile_version.yml'
val biom_format
output:
path("*.txt") , optional: true, emit: txt
path("*.biom"), optional: true, emit: biom
tuple val(meta), path("*.txt") , optional: true, emit: txt
tuple val(meta), path("*.biom"), optional: true, emit: biom
path "versions.yml" , emit: versions
when:
@ -24,16 +25,16 @@ process MOTUS_MERGE {
script:
def args = task.ext.args ?: ''
def prefix = 'motus_merged'
def prefix = task.ext.prefix ?: "${meta.id}"
def cmd_input = input.size() > 1 ? "-i ${input.join(',')}" : input.isDirectory() ? "-d ${input}" : "-i ${input}"
def output = biom_format ? "-B -o ${prefix}.biom" : "-o ${prefix}.txt"
def suffix = task.ext.args?.contains("-B") ? "biom" : "txt"
"""
motus \\
merge \\
-db $db \\
${cmd_input} \\
$args \\
${output}
-o ${prefix}.${suffix}
## Take version from the mOTUs/profile module output, as cannot reconstruct
## version without having database staged in this directory.

View file

@ -96,10 +96,21 @@ workflow STANDARDISATION_PROFILES {
ch_multiqc_files = ch_multiqc_files.mix( KRAKENTOOLS_COMBINEKREPORTS.out.txt )
ch_versions = ch_versions.mix( KRAKENTOOLS_COMBINEKREPORTS.out.versions )
// mOTUs
// mOTUs has a 'single' database, and cannot create custom ones.
// Therefore removing db info here, and publish merged at root mOTUs results
// directory
MOTUS_MERGE ( ch_input_profiles.motus.map{it[1]}.collect(), ch_input_databases.motus.map{it[1]}, motu_version, params.generate_biom_output )
ch_profiles_for_motus = ch_input_profiles.motus
.map { [it[0]['db_name'], it[1]] }
.groupTuple()
.map {
[[id:it[0]], it[1]]
}
MOTUS_MERGE ( ch_profiles_for_motus, ch_input_databases.motus.map{it[1]}, motu_version, [] )
if ( params.generate_biom_output ) {
ch_standardised_tables = ch_standardised_tables.mix ( MOTUS_MERGE.out.biom )
} else {