Skip to content

Commit 5daf5a8

Browse files
authored
Merge pull request #370 from drpatelh/fixes
Fix #368
2 parents 6b23e8c + e5d5293 commit 5daf5a8

17 files changed

+85
-58
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Special thanks to the following for their code contributions to the release:
1111

1212
- [Friederike Hanssen](https://github.com/FriederikeHanssen)
1313
- [Hugo Tavares](https://github.com/tavareshugo)
14+
- [James Fellows Yates](https://github.com/jfy133)
15+
- [Jessica Wu](https://github.com/wutron)
1416
- [Matthew Wells](https://github.com/mattheww95)
1517
- [Maxime Garcia](https://github.com/maxulysse)
1618
- [Phil Ewels](https://github.com/ewels)
@@ -30,6 +32,7 @@ Thank you to everyone else that has contributed by reporting bugs, enhancements
3032
- [[#348](https://github.com/nf-core/viralrecon/issues/348)] - Document full parameters of iVar consensus
3133
- [[#349](https://github.com/nf-core/viralrecon/issues/349)] - ERROR in Script plasmidID
3234
- [[#356](https://github.com/nf-core/viralrecon/issues/356)] - Add NEB SARS-CoV-2 primers
35+
- [[#368](https://github.com/nf-core/viralrecon/issues/368)] - Incorrect depth from ivar variants reported in variants long table
3336
- Updated pipeline template to [nf-core/tools 2.7.2](https://github.com/nf-core/tools/releases/tag/2.7.2)
3437
- Add `tower.yml` for Report rendering in Nextflow Tower
3538
- Use `--skip_plasmidid` by default

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ A number of improvements were made to the pipeline recently, mainly with regard
102102
103103
4. Start running your own analysis!
104104

105+
> - Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration except for parameters; see [docs](https://nf-co.re/usage/configuration#custom-configuration-files).
106+
105107
- Typical command for Illumina shotgun analysis:
106108

107109
```bash

bin/ivar_variants_to_vcf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def parse_ivar_line(line):
126126
QUAL = "."
127127

128128
## Determine FILTER field
129-
INFO = f"DP={line[11]}"
129+
INFO = f"DP={int(float(line[11]))}"
130130
pass_test = line[13]
131131

132132
return (

conf/modules_illumina.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
========================================================================================
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
Config file for defining DSL2 per module options and publishing paths
4-
========================================================================================
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
Available keys to override module options:
66
ext.args = Additional arguments appended to command in module.
77
ext.args2 = Second set of arguments appended to command in module (multi-tool modules).

conf/modules_nanopore.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
========================================================================================
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
Config file for defining DSL2 per module options and publishing paths
4-
========================================================================================
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
Available keys to override module options:
66
ext.args = Additional arguments appended to command in module.
77
ext.args2 = Second set of arguments appended to command in module (multi-tool modules).

conf/test_full_nanopore.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
========================================================================================
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
Nextflow config file for running full-size tests
4-
========================================================================================
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
Defines input files and everything required to run a full size pipeline test.
66

77
Use as follows:

conf/test_full_sispa.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
========================================================================================
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
Nextflow config file for running full-size tests
4-
========================================================================================
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
Defines input files and everything required to run a full size pipeline test.
66

77
Use as follows:

conf/test_nanopore.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
========================================================================================
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
Nextflow config file for running minimal tests
4-
========================================================================================
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
Defines input files and everything required to run a fast and simple pipeline test.
66

77
Use as follows:

conf/test_sispa.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
========================================================================================
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
Nextflow config file for running minimal tests
4-
========================================================================================
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
Defines input files and everything required to run a fast and simple pipeline test.
66

77
Use as follows:

docs/usage.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
> _Documentation of pipeline parameters is generated automatically from the pipeline schema and can no longer be found in markdown files._
66
7+
## Pipeline parameters
8+
9+
Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration except for parameters; see [docs](https://nf-co.re/usage/configuration#custom-configuration-files).
10+
711
## Samplesheet format
812

913
### Illumina

lib/NfcoreTemplate.groovy

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ class NfcoreTemplate {
3232
}
3333
}
3434

35+
//
36+
// Warn if using custom configs to provide pipeline parameters
37+
//
38+
public static void warnParamsProvidedInConfig(workflow, log) {
39+
if (workflow.configFiles.size() > 1) {
40+
log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
41+
" Multiple config files detected!\n" +
42+
" Please provide pipeline parameters via the CLI or Nextflow '-params-file' option.\n" +
43+
" Custom config files including those provided by the '-c' Nextflow option can be\n" +
44+
" used to provide any configuration except for parameters.\n\n" +
45+
" Docs: https://nf-co.re/usage/configuration#custom-configuration-files\n" +
46+
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
47+
}
48+
}
49+
3550
//
3651
// Generate version string
3752
//

lib/Utils.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ class Utils {
3333
}
3434

3535
if (channels_missing | channel_priority_violation) {
36-
log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
36+
log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
3737
" There is a problem with your Conda configuration!\n\n" +
3838
" You will need to set-up the conda-forge and bioconda channels correctly.\n" +
3939
" Please refer to https://bioconda.github.io/\n" +
4040
" The observed channel order is \n" +
4141
" ${channels}\n" +
4242
" but the following channel order is required:\n" +
4343
" ${required_channels_in_order}\n" +
44-
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
44+
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
4545
}
4646
}
4747
}

lib/WorkflowCommons.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ class WorkflowCommons {
99
//
1010
private static void genomeExistsError(params, log) {
1111
if (params.genomes && params.genome && !params.genomes.containsKey(params.genome)) {
12-
log.error "=============================================================================\n" +
12+
log.error "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
1313
" Genome '${params.genome}' not found in any config files provided to the pipeline.\n" +
1414
" Currently, the available genome keys are:\n" +
1515
" ${params.genomes.keySet().join(", ")}\n" +
16-
"============================================================================="
16+
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
1717
System.exit(1)
1818
}
1919
}
@@ -74,14 +74,14 @@ class WorkflowCommons {
7474
)
7575
}
7676
if (total != (left + right)) {
77-
log.warn "=============================================================================\n" +
77+
log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
7878
" Please check the name field (column 4) in the file supplied via --primer_bed.\n\n" +
7979
" All of the values in that column do not end with those supplied by:\n" +
8080
" --primer_left_suffix : $primer_left_suffix\n" +
8181
" --primer_right_suffix: $primer_right_suffix\n\n" +
8282
" This information is required to collapse the primer intervals into amplicons\n" +
8383
" for the coverage plots generated by the pipeline.\n" +
84-
"==================================================================================="
84+
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
8585
}
8686
}
8787

@@ -121,13 +121,13 @@ class WorkflowCommons {
121121
def intersect = bed_contigs.intersect(fai_contigs)
122122
if (intersect.size() != bed_contigs.size()) {
123123
def diff = bed_contigs.minus(intersect).sort()
124-
log.error "=============================================================================\n" +
124+
log.error "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
125125
" Contigs in primer BED file do not match those in the reference genome:\n\n" +
126126
" ${diff.join('\n ')}\n\n" +
127127
" Please check:\n" +
128128
" - Primer BED file supplied with --primer_bed\n" +
129129
" - Genome FASTA file supplied with --fasta\n" +
130-
"============================================================================="
130+
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
131131
System.exit(1)
132132
}
133133
}

lib/WorkflowIllumina.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ class WorkflowIllumina {
7575
if (line.contains('>')) {
7676
count++
7777
if (count > 1) {
78-
log.warn "=============================================================================\n" +
78+
log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
7979
" This pipeline does not officially support multi-fasta genome files!\n\n" +
8080
" The parameters and processes are tailored for viral genome analysis.\n" +
8181
" Please amend the '--fasta' parameter.\n" +
82-
"==================================================================================="
82+
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
8383
break
8484
}
8585
}
@@ -118,12 +118,12 @@ class WorkflowIllumina {
118118
if (name.contains(name_prefix)) {
119119
count++
120120
if (count > 1) {
121-
log.warn "=============================================================================\n" +
121+
log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
122122
" Found '${name_prefix}' in the name field of the primer BED file!\n" +
123123
" This suggests that you have used the SWIFT/SNAP protocol to prep your samples.\n" +
124124
" If so, please set '--ivar_trim_offset 5' as suggested in the issue below:\n" +
125125
" https://github.com/nf-core/viralrecon/issues/170\n" +
126-
"==================================================================================="
126+
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
127127
break
128128
}
129129
}

lib/WorkflowMain.groovy

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class WorkflowMain {
6262
// Print parameter summary log to screen
6363
log.info paramsSummaryLog(workflow, params, log)
6464

65+
// Warn about using custom configs to provide pipeline parameters
66+
NfcoreTemplate.warnParamsProvidedInConfig(workflow, log)
67+
6568
// Validate workflow parameters via the JSON schema
6669
if (params.validate_params) {
6770
NfcoreSchema.validateParameters(workflow, params, log)
@@ -105,7 +108,7 @@ class WorkflowMain {
105108
" - https://github.com/nf-core/configs/blob/master/conf/pipeline/viralrecon/genomes.config\n\n" +
106109
" If you would still like to blame us please come and find us on nf-core Slack:\n" +
107110
" - https://nf-co.re/viralrecon#contributions-and-support\n" +
108-
"============================================================================="
111+
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
109112
if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) {
110113
def genome_map = params.genomes[ params.genome ]
111114
if (primer_set) {
@@ -117,7 +120,7 @@ class WorkflowMain {
117120
if (genome_map.containsKey(primer_set_version)) {
118121
genome_map = genome_map[ primer_set_version ]
119122
} else {
120-
log.error "=============================================================================\n" +
123+
log.error "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
121124
" --primer_set_version '${primer_set_version}' not found!\n\n" +
122125
" Currently, the available primer set version keys are: ${genome_map.keySet().join(", ")}\n\n" +
123126
" Please check:\n" +
@@ -128,7 +131,7 @@ class WorkflowMain {
128131
System.exit(1)
129132
}
130133
} else {
131-
log.error "=============================================================================\n" +
134+
log.error "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
132135
" --primer_set '${primer_set}' not found!\n\n" +
133136
" Currently, the available primer set keys are: ${genome_map.keySet().join(", ")}\n\n" +
134137
" Please check:\n" +
@@ -138,7 +141,7 @@ class WorkflowMain {
138141
System.exit(1)
139142
}
140143
} else {
141-
log.error "=============================================================================\n" +
144+
log.error "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
142145
" Genome '${params.genome}' does not contain any primer sets!\n\n" +
143146
" Please check:\n" +
144147
" - The value provided to --genome (currently '${params.genome}')\n" +

workflows/illumina.nf

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
========================================================================================
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
VALIDATE INPUTS
4-
========================================================================================
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
*/
66

77
def valid_params = [
@@ -34,9 +34,9 @@ def variant_caller = params.variant_caller
3434
if (!variant_caller) { variant_caller = params.protocol == 'amplicon' ? 'ivar' : 'bcftools' }
3535

3636
/*
37-
========================================================================================
37+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3838
CONFIG FILES
39-
========================================================================================
39+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4040
*/
4141

4242
ch_multiqc_config = file("$projectDir/assets/multiqc_config_illumina.yml", checkIfExists: true)
@@ -47,9 +47,9 @@ ch_blast_outfmt6_header = file("$projectDir/assets/headers/blast_outfmt6_hea
4747
ch_ivar_variants_header_mqc = file("$projectDir/assets/headers/ivar_variants_header_mqc.txt", checkIfExists: true)
4848

4949
/*
50-
========================================================================================
50+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5151
IMPORT LOCAL MODULES/SUBWORKFLOWS
52-
========================================================================================
52+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5353
*/
5454

5555
//
@@ -77,9 +77,9 @@ include { BAM_TRIM_PRIMERS_IVAR } from '../subworkflows/local/bam_trim_primers
7777
include { FASTQ_TRIM_FASTP_FASTQC } from '../subworkflows/local/fastq_trim_fastp_fastqc'
7878

7979
/*
80-
========================================================================================
80+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8181
IMPORT NF-CORE MODULES/SUBWORKFLOWS
82-
========================================================================================
82+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8383
*/
8484

8585
//
@@ -97,12 +97,12 @@ include { MOSDEPTH as MOSDEPTH_AMPLICON } from '../modules/nf-core/mosdepth/main
9797
// SUBWORKFLOW: Consisting entirely of nf-core/modules
9898
//
9999
include { FASTQ_ALIGN_BOWTIE2 } from '../subworkflows/nf-core/fastq_align_bowtie2/main'
100-
include { BAM_MARKDUPLICATES_PICARD } from '../subworkflows/nf-core/bam_markduplicates_picard'
100+
include { BAM_MARKDUPLICATES_PICARD } from '../subworkflows/nf-core/bam_markduplicates_picard/main'
101101

102102
/*
103-
========================================================================================
103+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104104
RUN MAIN WORKFLOW
105-
========================================================================================
105+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106106
*/
107107

108108
// Info required for completion email and summary
@@ -645,9 +645,9 @@ workflow ILLUMINA {
645645
}
646646

647647
/*
648-
========================================================================================
648+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
649649
COMPLETION EMAIL AND SUMMARY
650-
========================================================================================
650+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
651651
*/
652652

653653
workflow.onComplete {
@@ -658,7 +658,7 @@ workflow.onComplete {
658658
}
659659

660660
/*
661-
========================================================================================
661+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
662662
THE END
663-
========================================================================================
663+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
664664
*/

0 commit comments

Comments
 (0)