From 9aba4d7cc4043a0e18fa76ec647c84d612215e73 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 28 Jul 2021 15:41:19 +0100 Subject: [PATCH 1/6] Fix bug removing summary reports --- modules/local/multiqc_illumina.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/local/multiqc_illumina.nf b/modules/local/multiqc_illumina.nf index db0d5b42..f1f15a15 100644 --- a/modules/local/multiqc_illumina.nf +++ b/modules/local/multiqc_illumina.nf @@ -67,11 +67,11 @@ process MULTIQC { multiqc_to_custom_csv.py --platform illumina ## Manually remove files that we don't want in the report - if grep -q skip_assembly workflow_summary_mqc.yaml; then + if grep -q ">skip_assembly<" workflow_summary_mqc.yaml; then rm -f *assembly_metrics_mqc.csv fi - if grep -q skip_variants workflow_summary_mqc.yaml; then + if grep -q ">skip_variants<" workflow_summary_mqc.yaml; then rm -f *variants_metrics_mqc.csv fi From f6a9fdf00d6f54253d3a826bc187b4d86e3b09bf Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 28 Jul 2021 16:19:49 +0100 Subject: [PATCH 2/6] Change ARTIC Guppyplex defaults when using --primer_set_version 1200 --- workflows/nanopore.nf | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/workflows/nanopore.nf b/workflows/nanopore.nf index 82f08c8a..9c44f683 100644 --- a/workflows/nanopore.nf +++ b/workflows/nanopore.nf @@ -92,9 +92,23 @@ def artic_minion_options = modules['nanopore_artic_minion'] artic_minion_options.args += params.artic_minion_caller == 'medaka' ? Utils.joinModuleArgs(['--medaka']) : '' artic_minion_options.args += params.artic_minion_aligner == 'bwa' ? Utils.joinModuleArgs(['--bwa']) : Utils.joinModuleArgs(['--minimap2']) +def artic_guppyplex_options = modules['nanopore_artic_guppyplex'] +if (params.primer_set_version == 1200) { + def args_split = artic_guppyplex_options.args.tokenize() + def min_idx = args_split.indexOf('--min-length') + def max_idx = args_split.indexOf('--max-length') + if (min_idx != -1) { + args_split[min_idx+1] = '250' + } + if (max_idx != -1) { + args_split[max_idx+1] = '1500' + } + artic_guppyplex_options.args = args_split.join(' ') +} + include { PYCOQC } from '../modules/nf-core/modules/pycoqc/main' addParams( options: modules['nanopore_pycoqc'] ) include { NANOPLOT } from '../modules/nf-core/modules/nanoplot/main' addParams( options: modules['nanopore_nanoplot'] ) -include { ARTIC_GUPPYPLEX } from '../modules/nf-core/modules/artic/guppyplex/main' addParams( options: modules['nanopore_artic_guppyplex'] ) +include { ARTIC_GUPPYPLEX } from '../modules/nf-core/modules/artic/guppyplex/main' addParams( options: artic_guppyplex_options ) include { ARTIC_MINION } from '../modules/nf-core/modules/artic/minion/main' addParams( options: artic_minion_options ) include { BCFTOOLS_STATS } from '../modules/nf-core/modules/bcftools/stats/main' addParams( options: modules['nanopore_bcftools_stats'] ) include { QUAST } from '../modules/nf-core/modules/quast/main' addParams( options: modules['nanopore_quast'] ) From 14bf3a0ed7bd6a87a3000910b5a952efa5454f7e Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 28 Jul 2021 16:58:34 +0100 Subject: [PATCH 3/6] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1107d012..eb16c8c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Updated pipeline template to [nf-core/tools 2.1](https://github.com/nf-core/tools/releases/tag/2.1) * Remove custom content to render Pangolin report in MultiQC as it was officially added as a module in [v1.11](https://github.com/ewels/MultiQC/pull/1458) * [[#212](https://github.com/nf-core/viralrecon/issues/212)] - Access to `PYCOQC.out` is undefined +* [[#229](https://github.com/nf-core/viralrecon/issues/229)] - ARTIC Guppyplex settings for 1200bp ARTIC primers with Nanopore data ### Software dependencies From 66ff1c2fef58859609f9ca1a96d2583b8b2a4e13 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 28 Jul 2021 19:01:07 +0100 Subject: [PATCH 4/6] Fix #226 --- conf/base.config | 20 +++++++++--------- conf/modules.config | 3 +++ modules/nf-core/modules/nextclade/main.nf | 25 ++++++++--------------- subworkflows/local/variants_bcftools.nf | 2 +- subworkflows/local/variants_ivar.nf | 2 +- workflows/nanopore.nf | 3 +-- 6 files changed, 25 insertions(+), 30 deletions(-) diff --git a/conf/base.config b/conf/base.config index 6dc15427..59d5e195 100644 --- a/conf/base.config +++ b/conf/base.config @@ -20,22 +20,22 @@ process { // Process-specific resource requirements withLabel:process_low { - cpus = { check_max( 2 * task.attempt, 'cpus' ) } - memory = { check_max( 12.GB * task.attempt, 'memory' ) } - time = { check_max( 4.h * task.attempt, 'time' ) } + cpus = { check_max( 2 * task.attempt, 'cpus' ) } + memory = { check_max( 12.GB * task.attempt, 'memory' ) } + time = { check_max( 4.h * task.attempt, 'time' ) } } withLabel:process_medium { - cpus = { check_max( 6 * task.attempt, 'cpus' ) } - memory = { check_max( 36.GB * task.attempt, 'memory' ) } - time = { check_max( 8.h * task.attempt, 'time' ) } + cpus = { check_max( 6 * task.attempt, 'cpus' ) } + memory = { check_max( 36.GB * task.attempt, 'memory' ) } + time = { check_max( 8.h * task.attempt, 'time' ) } } withLabel:process_high { - cpus = { check_max( 12 * task.attempt, 'cpus' ) } - memory = { check_max( 72.GB * task.attempt, 'memory' ) } - time = { check_max( 16.h * task.attempt, 'time' ) } + cpus = { check_max( 12 * task.attempt, 'cpus' ) } + memory = { check_max( 72.GB * task.attempt, 'memory' ) } + time = { check_max( 16.h * task.attempt, 'time' ) } } withLabel:process_long { - time = { check_max( 20.h * task.attempt, 'time' ) } + time = { check_max( 20.h * task.attempt, 'time' ) } } withLabel:process_high_memory { memory = { check_max( 200.GB * task.attempt, 'memory' ) } diff --git a/conf/modules.config b/conf/modules.config index 700bdb7d..82d3f090 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -102,6 +102,7 @@ params { publish_dir = "${params.artic_minion_caller}/pangolin" } 'nanopore_nextclade' { + publish_files = ['csv':''] publish_dir = "${params.artic_minion_caller}/nextclade" } 'nanopore_asciigenome' { @@ -298,6 +299,7 @@ params { publish_dir = 'variants/ivar/pangolin' } 'illumina_ivar_nextclade' { + publish_files = ['csv':''] publish_dir = 'variants/ivar/nextclade' } 'illumina_ivar_asciigenome' { @@ -369,6 +371,7 @@ params { publish_dir = 'variants/bcftools/pangolin' } 'illumina_bcftools_nextclade' { + publish_files = ['csv':''] publish_dir = 'variants/bcftools/nextclade' } 'illumina_bcftools_asciigenome' { diff --git a/modules/nf-core/modules/nextclade/main.nf b/modules/nf-core/modules/nextclade/main.nf index 24ca7309..8319f6b1 100644 --- a/modules/nf-core/modules/nextclade/main.nf +++ b/modules/nf-core/modules/nextclade/main.nf @@ -20,35 +20,28 @@ process NEXTCLADE { input: tuple val(meta), path(fasta) - val output_format output: - tuple val(meta), path("${prefix}.csv") , optional:true, emit: csv - tuple val(meta), path("${prefix}.json") , optional:true, emit: json - tuple val(meta), path("${prefix}.tree.json") , optional:true, emit: json_tree - tuple val(meta), path("${prefix}.tsv") , optional:true, emit: tsv + tuple val(meta), path("${prefix}.csv") , emit: csv + tuple val(meta), path("${prefix}.json") , emit: json + tuple val(meta), path("${prefix}.tree.json") , emit: json_tree + tuple val(meta), path("${prefix}.tsv") , emit: tsv tuple val(meta), path("${prefix}.clades.tsv"), optional:true, emit: tsv_clades path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def format = output_format - if (!(format in ['json', 'csv', 'tsv', 'tree', 'tsv-clades-only'])) { - format = 'json' - } - def extension = format - if (format in ['tsv-clades-only']) { - extension = '.clades.tsv' - } else if (format in ['tree']) { - extension = 'tree.json' - } """ nextclade \\ $options.args \\ --jobs $task.cpus \\ --input-fasta $fasta \\ - --output-${format} ${prefix}.${extension} + --output-json ${prefix}.json \\ + --output-csv ${prefix}.csv \\ + --output-tsv ${prefix}.tsv \\ + --output-tsv-clades-only ${prefix}.clades.tsv \\ + --output-tree ${prefix}.tree.json echo \$(nextclade --version 2>&1) > ${software}.version.txt """ diff --git a/subworkflows/local/variants_bcftools.nf b/subworkflows/local/variants_bcftools.nf index 091d5948..626659a9 100644 --- a/subworkflows/local/variants_bcftools.nf +++ b/subworkflows/local/variants_bcftools.nf @@ -79,7 +79,7 @@ workflow VARIANTS_BCFTOOLS { } if (!params.skip_nextclade) { - NEXTCLADE ( ch_consensus, 'csv' ) + NEXTCLADE ( ch_consensus ) ch_nextclade_report = NEXTCLADE.out.csv ch_nextclade_version = NEXTCLADE.out.version } diff --git a/subworkflows/local/variants_ivar.nf b/subworkflows/local/variants_ivar.nf index f37c2906..2d2748ef 100644 --- a/subworkflows/local/variants_ivar.nf +++ b/subworkflows/local/variants_ivar.nf @@ -92,7 +92,7 @@ workflow VARIANTS_IVAR { } if (!params.skip_nextclade) { - NEXTCLADE ( ch_consensus, 'csv' ) + NEXTCLADE ( ch_consensus ) ch_nextclade_report = NEXTCLADE.out.csv ch_nextclade_version = NEXTCLADE.out.version } diff --git a/workflows/nanopore.nf b/workflows/nanopore.nf index 9c44f683..5ebcfe19 100644 --- a/workflows/nanopore.nf +++ b/workflows/nanopore.nf @@ -387,8 +387,7 @@ workflow NANOPORE { ch_nextclade_multiqc = Channel.empty() if (!params.skip_nextclade) { NEXTCLADE ( - ARTIC_MINION.out.fasta, - 'csv' + ARTIC_MINION.out.fasta ) ch_software_versions = ch_software_versions.mix(NEXTCLADE.out.version.ifEmpty(null)) From 32a13ac6f2cc6decaae4b01ef3908c7c46504f12 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 28 Jul 2021 19:54:43 +0100 Subject: [PATCH 5/6] Re-install updated Nextclade module --- modules.json | 2 +- modules/nf-core/modules/nextclade/meta.yml | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/modules.json b/modules.json index bde8cd71..f2405bfc 100644 --- a/modules.json +++ b/modules.json @@ -82,7 +82,7 @@ "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d" }, "nextclade": { - "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d" + "git_sha": "29c847424034eb04765d7378fb384ad3094a66a6" }, "pangolin": { "git_sha": "e7e30b6da631ce5288151af4e46488ac6d294ff4" diff --git a/modules/nf-core/modules/nextclade/meta.yml b/modules/nf-core/modules/nextclade/meta.yml index 8e0eabd7..d321e08f 100644 --- a/modules/nf-core/modules/nextclade/meta.yml +++ b/modules/nf-core/modules/nextclade/meta.yml @@ -11,7 +11,7 @@ tools: documentation: None tool_dev_url: https://github.com/nextstrain/nextclade doi: "" - licence: ['MIT'] + licence: ["MIT"] input: - meta: @@ -23,11 +23,6 @@ input: type: file description: FASTA file containing one or more consensus sequences pattern: "*.{fasta,fa}" - - output_format: - type: string - description: | - String for output format supported by nextclade - i.e one of 'json', 'csv', 'tsv', 'tree', 'tsv-clades-only' output: - meta: From a9c51b74b775982d03f21503619a750e979712f3 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 28 Jul 2021 19:55:04 +0100 Subject: [PATCH 6/6] Update date in CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb16c8c2..9bd587a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [[2.2](https://github.com/nf-core/rnaseq/releases/tag/2.2)] - 2021-07-28 +## [[2.2](https://github.com/nf-core/rnaseq/releases/tag/2.2)] - 2021-07-29 ### Enhancements & fixes