From 6472f930fb52383ba72596240cc14054c57a7654 Mon Sep 17 00:00:00 2001 From: Sofia Stamouli Date: Fri, 30 Jun 2023 16:20:40 +0200 Subject: [PATCH] Solve conflicts --- conf/modules.config | 3 ++- nextflow.config | 12 ++++++------ nextflow_schema.json | 5 ++--- subworkflows/local/db_check.nf | 3 +-- subworkflows/local/profiling.nf | 29 +++++++++++++++++++---------- 5 files changed, 30 insertions(+), 22 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 88bf94ed..43b81682 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -665,7 +665,8 @@ process { path: { "${params.outdir}/kmcp/${meta.db_name}/" }, mode: params.publish_dir_mode, pattern: '*.{profile}' - + ] + } withName: GANON_CLASSIFY { ext.args = params.ganon_save_readclassifications ? { "${meta.db_params} --output-all --output-lca --output-unclassified" } : { "${meta.db_params}" } diff --git a/nextflow.config b/nextflow.config index e306fe70..197f64f7 100644 --- a/nextflow.config +++ b/nextflow.config @@ -152,6 +152,12 @@ params { motus_remove_ncbi_ids = false motus_save_mgc_read_counts = false + // kmcp + run_kmcp = false + kmcp_taxdump = null + kmcp_taxid = null + kmcp_mode = 3 // default kmcp profiling value + // ganon run_ganon = false ganon_report_type = 'reads' @@ -165,12 +171,6 @@ params { run_krona = false krona_taxonomy_directory = null - // kmcp - run_kmcp = false - kmcp_taxdump = null - kmcp_taxid = null - kmcp_mode = 3 // default kmcp profiling value - // profile standardisation run_profile_standardisation = false standardisation_taxpasta_format = 'tsv' diff --git a/nextflow_schema.json b/nextflow_schema.json index 74565653..20b4506e 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -493,7 +493,8 @@ "motus_remove_ncbi_ids": { "type": "boolean", "description": "Turn on removing NCBI taxonomic IDs.", - "fa_icon": "fas fa-address-card" + "fa_icon": "fas fa-address-card", + "help_text": "By default mOTUs will report species names rather than NCBI Taxon IDs. In nf-core/taxprofiler we prefer taxon IDs due to interoperatbility and comparability with the output of other classifiers and profilers. If you prefer to have just species names, you can specify this to remove the IDs.\n\n> Modifies tool parameter(s):\n- mOTUs: `-p` (removed from the default nf-core/taxprofiler command)" }, "run_kmcp": { "type": "boolean", @@ -519,8 +520,6 @@ "description": "Profiling mode.", "help_text": "Available values: \n0 (for pathogen detection)\n1 (higherrecall)\n2 (high recall)\n3 (default)\n4 (high precision)\n5 (higher precision)", "fa_icon": "fas fa-check-square" - "fa_icon": "fas fa-address-card", - "help_text": "By default mOTUs will report species names rather than NCBI Taxon IDs. In nf-core/taxprofiler we prefer taxon IDs due to interoperatbility and comparability with the output of other classifiers and profilers. If you prefer to have just species names, you can specify this to remove the IDs.\n\n> Modifies tool parameter(s):\n- mOTUs: `-p` (removed from the default nf-core/taxprofiler command)" }, "run_ganon": { "type": "boolean", diff --git a/subworkflows/local/db_check.nf b/subworkflows/local/db_check.nf index 63b6c465..80b0c971 100644 --- a/subworkflows/local/db_check.nf +++ b/subworkflows/local/db_check.nf @@ -62,9 +62,8 @@ def validate_db_rows(LinkedHashMap row) { if ( !row.keySet().containsAll(expected_headers) ) error("[nf-core/taxprofiler] ERROR: Invalid database input sheet - malformed column names. Please check input TSV. Column names should be: ${expected_headers.join(", ")}") // valid tools specified - def expected_tools = [ "bracken", "centrifuge", "diamond", "kaiju", "kmcp","kraken2", "krakenuniq", "malt", "metaphlan3", "motus" ] def expected_tools = [ "bracken", "centrifuge", "diamond", "kaiju", "kraken2", "krakenuniq", "malt", "metaphlan3", "motus", "ganon", "metaphlan", "kmcp" ] - + if ( !expected_tools.contains(row.tool) ) error("[nf-core/taxprofiler] ERROR: Invalid tool name. Please see documentation for all supported profilers. Error in: ${row}") // detect quotes in params diff --git a/subworkflows/local/profiling.nf b/subworkflows/local/profiling.nf index 1475850b..8f300541 100644 --- a/subworkflows/local/profiling.nf +++ b/subworkflows/local/profiling.nf @@ -353,20 +353,13 @@ workflow PROFILING { meta, reads, meta_db, db -> if ( meta['instrument_platform'] == 'OXFORD_NANOPORE' ) log.warn "[nf-core/taxprofiler] Kmcp is only suitable for short-read metagenomic profiling, with much lower sensitivity on long-read datasets. Skipping kmcp for sample ${meta.id}." meta_db['tool'] == 'kmcp' && meta['instrument_platform'] != 'OXFORD_NANOPORE' - if ( params.run_ganon ) { - - ch_input_for_ganonclassify = ch_input_for_profiling.ganon - .filter { - meta, reads, meta_db, db -> - if ( meta['instrument_platform'] == 'OXFORD_NANOPORE' ) log.warn "[nf-core/taxprofiler] Ganon has not been evaluated for Nanopore data. Skipping Ganon for sample ${meta.id}." - meta_db['tool'] == 'ganon' && meta['instrument_platform'] != 'OXFORD_NANOPORE' - } - .multiMap { + } + .multiMap { it -> reads: [ it[0] + it[2], it[1] ] db: it[3] } - + ch_input_for_kmcpcompute.db KMCP_COMPUTE (ch_input_for_kmcpcompute.db) KMCP_INDEX (KMCP_COMPUTE.out.outdir) @@ -377,6 +370,22 @@ workflow PROFILING { ch_raw_profiles = ch_raw_profiles.mix( KMCP_PROFILE.out.profile ) ch_multiqc_files = ch_multiqc_files.mix( KMCP_PROFILE.out.profile ) + } + + if ( params.run_ganon ) { + + ch_input_for_ganonclassify = ch_input_for_profiling.ganon + .filter { + meta, reads, meta_db, db -> + if ( meta['instrument_platform'] == 'OXFORD_NANOPORE' ) log.warn "[nf-core/taxprofiler] Ganon has not been evaluated for Nanopore data. Skipping Ganon for sample ${meta.id}." + meta_db['tool'] == 'ganon' && meta['instrument_platform'] != 'OXFORD_NANOPORE' + } + .multiMap { + it -> + reads: [ it[0] + it[2], it[1] ] + db: it[3] + } + ch_input_for_ganonclassify.reads GANON_CLASSIFY( ch_input_for_ganonclassify.reads, ch_input_for_ganonclassify.db )