diff --git a/CHANGELOG.md b/CHANGELOG.md index eb08ca31..e15d3a35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed `nextflow.hopper.config` `symlinkDir` - Removed serotypefinder from saureus workflow - Fixed jasen running only on the first row/sample in csv +- Fixed channel problem by changing `Channel.of([])` to `Channel.value([])` ### Changed diff --git a/configs/nextflow.base.config b/configs/nextflow.base.config index 8d518180..07e4df4b 100644 --- a/configs/nextflow.base.config +++ b/configs/nextflow.base.config @@ -5,6 +5,7 @@ params { pointfinderDb = "${root}/assets/pointfinder_db" serotypefinderDb = "${root}/assets/serotypefinder_db" virulencefinderDb = "${root}/assets/virulencefinder_db" + mlstBlastDb = "${root}/assets/mlst_db/blast" pubMlstDb = "${root}/assets/mlst_db/pubmlst" krakenDb = "/filepath/to/kraken_db" //edit if useKraken = true workDir = "/filepath/to/workdir" //edit @@ -32,7 +33,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/staphylococcus_aureus/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/staphylococcus_aureus/bed/GCF_000012045.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/staphylococcus_aureus/alleles_rereffed/Staphylococcus_aureus.trn" @@ -51,7 +51,6 @@ profiles { // params.chewbbacaDb = "${params.root}/assets/cgmlst/escherichia_coli/alleles_rereffed" // params.coreLociBed = "${params.root}/assets/cgmlst/escherichia_coli/bed/GCF_000005845.2.bed" // params.trainingFile = "${params.root}/assets/cgmlst/escherichia_coli/alleles_rereffed/Escherichia_coli.trn" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/wgmlst/escherichia_coli/alleles/ecoli_INNUENDO_wgMLST" params.coreLociBed = "${params.root}/assets/wgmlst/escherichia_coli/bed/GCF_000005845.2.bed" params.shigapassDb = "${params.root}/assets/ShigaPass/SCRIPT/ShigaPass_DataBases" @@ -68,7 +67,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/bed/GCF_000240185.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/alleles_rereffed/Klebsiella_pneumoniae.trn" @@ -99,7 +97,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/streptococcus_pyogenes/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/streptococcus_pyogenes/bed/GCF_900475035.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/streptococcus_pyogenes/alleles_rereffed/Streptococcus_pyogenes.trn" @@ -115,7 +112,6 @@ profiles { params.referenceGenome = null params.referenceGenomeIdx = null params.referenceGenomeGff = null - params.mlstBlastDb = null params.chewbbacaDb = "${params.root}/assets/cgmlst/streptococcus/alleles_rereffed" params.shigapassDb = null params.coreLociBed = null diff --git a/configs/nextflow.ci.config b/configs/nextflow.ci.config index e9db8eda..f0ec8517 100644 --- a/configs/nextflow.ci.config +++ b/configs/nextflow.ci.config @@ -5,6 +5,7 @@ params { pointfinderDb = "${root}/assets/pointfinder_db" serotypefinderDb = "${root}/assets/serotypefinder_db" virulencefinderDb = "${root}/assets/virulencefinder_db" + mlstBlastDb = "${root}/assets/mlst_db/blast" pubMlstDb = "${root}/assets/mlst_db/pubmlst" krakenDb = "/tmp/jsn" //edit if useKraken = true workDir = "/tmp/jsn" //edit @@ -36,7 +37,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/staphylococcus_aureus/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/staphylococcus_aureus/bed/GCF_000012045.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/staphylococcus_aureus/alleles_rereffed/Staphylococcus_aureus.trn" @@ -55,7 +55,6 @@ profiles { // params.chewbbacaDb = "${params.root}/assets/cgmlst/escherichia_coli/alleles_rereffed" // params.coreLociBed = "${params.root}/assets/cgmlst/escherichia_coli/bed/GCF_000005845.2.bed" // params.trainingFile = "${params.root}/assets/cgmlst/escherichia_coli/alleles_rereffed/Escherichia_coli.trn" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/wgmlst/escherichia_coli/alleles/ecoli_INNUENDO_wgMLST" params.coreLociBed = "${params.root}/assets/wgmlst/escherichia_coli/bed/GCF_000005845.2.bed" params.shigapassDb = "${params.root}/assets/ShigaPass/SCRIPT/ShigaPass_DataBases" @@ -72,7 +71,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/bed/GCF_000240185.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/alleles_rereffed/Klebsiella_pneumoniae.trn" @@ -103,7 +101,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/streptococcus_pyogenes/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/streptococcus_pyogenes/bed/GCF_900475035.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/streptococcus_pyogenes/alleles_rereffed/Streptococcus_pyogenes.trn" @@ -119,7 +116,6 @@ profiles { params.referenceGenome = null params.referenceGenomeIdx = null params.referenceGenomeGff = null - params.mlstBlastDb = null params.chewbbacaDb = "${params.root}/assets/cgmlst/streptococcus/alleles_rereffed" params.shigapassDb = null params.coreLociBed = null diff --git a/configs/nextflow.dev.config b/configs/nextflow.dev.config index 08c8fa79..46463b36 100644 --- a/configs/nextflow.dev.config +++ b/configs/nextflow.dev.config @@ -8,6 +8,7 @@ params { pointfinderDb = "${root}/assets/pointfinder_db" serotypefinderDb = "${root}/assets/serotypefinder_db" virulencefinderDb = "${root}/assets/virulencefinder_db" + mlstBlastDb = "${root}/assets/mlst_db/blast" pubMlstDb = "${root}/assets/mlst_db/pubmlst" krakenDb = "/fs1/resources/ref/micro/krakenstd" // INPUT & OUTPUT // @@ -45,7 +46,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/staphylococcus_aureus/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/staphylococcus_aureus/bed/GCF_000012045.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/staphylococcus_aureus/alleles_rereffed/Staphylococcus_aureus.trn" @@ -65,7 +65,6 @@ profiles { // params.chewbbacaDb = "${params.root}/assets/cgmlst/escherichia_coli/alleles_rereffed" // params.coreLociBed = "${params.root}/assets/cgmlst/escherichia_coli/bed/GCF_000005845.2.bed" // params.trainingFile = "${params.root}/assets/cgmlst/escherichia_coli/alleles_rereffed/Escherichia_coli.trn" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/wgmlst/escherichia_coli/alleles/ecoli_INNUENDO_wgMLST" params.shigapassDb = "${params.root}/assets/ShigaPass/SCRIPT/ShigaPass_DataBases" params.coreLociBed = "${params.root}/assets/wgmlst/escherichia_coli/bed/GCF_000005845.2.bed" @@ -83,7 +82,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/bed/GCF_000240185.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/alleles_rereffed/Klebsiella_pneumoniae.trn" @@ -115,7 +113,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_000006785.2.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_000006785.2.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_000006785.2.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/streptococcus_pyogenes/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/streptococcus_pyogenes/bed/GCF_000006785.2.bed" params.trainingFile = "${params.root}/assets/cgmlst/streptococcus_pyogenes/alleles_rereffed/Streptococcus_pyogenes.trn" @@ -131,7 +128,6 @@ profiles { params.referenceGenome = null params.referenceGenomeIdx = null params.referenceGenomeGff = null - params.mlstBlastDb = null params.chewbbacaDb = "${params.root}/assets/cgmlst/streptococcus/alleles_rereffed" params.shigapassDb = null params.coreLociBed = null diff --git a/configs/nextflow.hopper.config b/configs/nextflow.hopper.config index b9d7d717..b1ccb459 100644 --- a/configs/nextflow.hopper.config +++ b/configs/nextflow.hopper.config @@ -8,6 +8,7 @@ params { pointfinderDb = "${root}/assets/pointfinder_db" serotypefinderDb = "${root}/assets/serotypefinder_db" virulencefinderDb = "${root}/assets/virulencefinder_db" + mlstBlastDb = "${root}/assets/mlst_db/blast" pubMlstDb = "${root}/assets/mlst_db/pubmlst" krakenDb = "/fs1/resources/ref/micro/krakenstd" // INPUT & OUTPUT // @@ -44,7 +45,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/staphylococcus_aureus/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/staphylococcus_aureus/bed/GCF_000012045.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/staphylococcus_aureus/alleles_rereffed/Staphylococcus_aureus.trn" @@ -64,7 +64,6 @@ profiles { // params.chewbbacaDb = "${params.root}/assets/cgmlst/escherichia_coli/alleles_rereffed" // params.coreLociBed = "${params.root}/assets/cgmlst/escherichia_coli/bed/GCF_000005845.2.bed" // params.trainingFile = "${params.root}/assets/cgmlst/escherichia_coli/alleles_rereffed/Escherichia_coli.trn" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/wgmlst/escherichia_coli/alleles/ecoli_INNUENDO_wgMLST" params.coreLociBed = "${params.root}/assets/wgmlst/escherichia_coli/bed/GCF_000005845.2.bed" params.shigapassDb = "${params.root}/assets/ShigaPass/SCRIPT/ShigaPass_DataBases" @@ -82,7 +81,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/bed/GCF_000240185.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/alleles_rereffed/Klebsiella_pneumoniae.trn" @@ -115,7 +113,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/streptococcus_pyogenes/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/streptococcus_pyogenes/bed/GCF_900475035.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/streptococcus_pyogenes/alleles_rereffed/Streptococcus_pyogenes.trn" @@ -131,7 +128,6 @@ profiles { params.referenceGenome = null params.referenceGenomeIdx = null params.referenceGenomeGff = null - params.mlstBlastDb = null params.chewbbacaDb = "${params.root}/assets/cgmlst/streptococcus/alleles_rereffed" params.shigapassDb = null params.coreLociBed = null diff --git a/configs/nextflow.ngp.config b/configs/nextflow.ngp.config index 28911fc9..5fc87289 100644 --- a/configs/nextflow.ngp.config +++ b/configs/nextflow.ngp.config @@ -2,10 +2,11 @@ params { penv = "OpenMP" root = "/gms-apps/pipelines/jasen" //edit amrfinderDb = "${root}/assets/amrfinder_db/latest" - resfinderDb = "${params.root}/assets/resfinder_db" - pointfinderDb = "${params.root}/assets/pointfinder_db" + resfinderDb = "${root}/assets/resfinder_db" + pointfinderDb = "${root}/assets/pointfinder_db" serotypefinderDb = "${root}/assets/serotypefinder_db" - virulencefinderDb = "${params.root}/assets/virulencefinder_db" + virulencefinderDb = "${root}/assets/virulencefinder_db" + mlstBlastDb = "${root}/assets/mlst_db/blast" pubMlstDb = "${root}/assets/mlst_db/pubmlst" krakenDb = "/gms-home/isasyl/code/JASEN" //edit if useKraken = true workDir = "/gms-apps/pipelines/jasen/trash" //edit @@ -58,7 +59,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/staphylococcus_aureus/GCF_000012045.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/staphylococcus_aureus/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/staphylococcus_aureus/bed/GCF_000012045.1.bed" params.trainingFile = "${params.root}/assets/prodigal_training_files/Staphylococcus_aureus.trn" @@ -77,7 +77,6 @@ profiles { // params.chewbbacaDb = "${params.root}/assets/cgmlst/escherichia_coli/alleles_rereffed" // params.coreLociBed = "${params.root}/assets/cgmlst/escherichia_coli/bed/GCF_000005845.2.bed" // params.trainingFile = "${params.root}/assets/cgmlst/escherichia_coli/alleles_rereffed/Escherichia_coli.trn" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/wgmlst/escherichia_coli/alleles/ecoli_INNUENDO_wgMLST" params.coreLociBed = "${params.root}/assets/wgmlst/escherichia_coli/bed/GCF_000005845.2.bed" params.shigapassDb = "${params.root}/assets/ShigaPass/SCRIPT/ShigaPass_DataBases" @@ -94,7 +93,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/klebsiella_pneumoniae/GCF_000240185.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/bed/GCF_000240185.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/klebsiella_pneumoniae/alleles_rereffed/Klebsiella_pneumoniae.trn" @@ -125,7 +123,6 @@ profiles { params.referenceGenome = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_900475035.1.gff" - params.mlstBlastDb = "${params.root}/assets/mlst_db/blast" params.chewbbacaDb = "${params.root}/assets/cgmlst/streptococcus_pyogenes/alleles_rereffed" params.coreLociBed = "${params.root}/assets/cgmlst/streptococcus_pyogenes/bed/GCF_900475035.1.bed" params.trainingFile = "${params.root}/assets/cgmlst/streptococcus_pyogenes/alleles_rereffed/Streptococcus_pyogenes.trn" @@ -141,7 +138,6 @@ profiles { params.referenceGenome = null params.referenceGenomeIdx = null params.referenceGenomeGff = null - params.mlstBlastDb = null params.chewbbacaDb = "${params.root}/assets/cgmlst/streptococcus/alleles_rereffed" params.shigapassDb = null params.coreLociBed = null diff --git a/workflows/bacterial_base.nf b/workflows/bacterial_base.nf index 55ff0091..18a7caa9 100644 --- a/workflows/bacterial_base.nf +++ b/workflows/bacterial_base.nf @@ -106,16 +106,16 @@ workflow CALL_BACTERIAL_BASE { ch_versions = ch_versions.mix(spades_iontorrent.out.versions) emit: - assembly = ch_assembly // channel: [ val(meta), path(fasta)] - reads_w_meta = ch_reads_w_meta // channel: [ val(meta), path(meta)] - bam = bwa_mem_ref.out.bam // channel: [ val(meta), path(bam)] - bai = samtools_index_ref.out.bai // channel: [ val(meta), path(bai)] - metadata = save_analysis_metadata.out.meta // channel: [ val(meta), path(json)] - qc = post_align_qc.out.qc // channel: [ val(meta), path(fasta)] - quast = quast.out.qc // channel: [ val(meta), path(qc)] - reads = ch_reads // channel: [ val(meta), path(json)] - ska_build = ska_build.out.skf // channel: [ val(meta), path(skf)] - seqrun_meta = ch_seqrun_meta // channel: [ val(meta), val(json), val(json)] - sourmash = sourmash.out.signature // channel: [ val(meta), path(signature)] - versions = ch_versions // channel: [ versions.yml ] + assembly = ch_assembly // channel: [ val(meta), path(fasta)] + reads_w_meta = ch_reads_w_meta // channel: [ val(meta), path(meta)] + bam = bwa_mem_ref.out.bam // channel: [ val(meta), path(bam)] + bai = samtools_index_ref.out.bai // channel: [ val(meta), path(bai)] + metadata = save_analysis_metadata.out.meta // channel: [ val(meta), path(json)] + qc = post_align_qc.out.qc // channel: [ val(meta), path(fasta)] + quast = quast.out.qc // channel: [ val(meta), path(qc)] + reads = ch_reads // channel: [ val(meta), path(json)] + ska_build = ska_build.out.skf // channel: [ val(meta), path(skf)] + seqrun_meta = ch_seqrun_meta // channel: [ val(meta), val(json), val(json)] + sourmash = sourmash.out.signature // channel: [ val(meta), path(signature)] + versions = ch_versions // channel: [ versions.yml ] } diff --git a/workflows/escherichia_coli.nf b/workflows/escherichia_coli.nf index 84f34e41..7775d976 100644 --- a/workflows/escherichia_coli.nf +++ b/workflows/escherichia_coli.nf @@ -46,7 +46,7 @@ workflow CALL_ESCHERICHIA_COLI { shigapassDb = file(params.shigapassDb, checkIfExists: true) virulencefinderDb = file(params.virulencefinderDb, checkIfExists: true) // schemas and values - targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([]) + targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.value([]) main: ch_versions = Channel.empty() diff --git a/workflows/klebsiella_pneumoniae.nf b/workflows/klebsiella_pneumoniae.nf index 00ed38bc..230aec0f 100644 --- a/workflows/klebsiella_pneumoniae.nf +++ b/workflows/klebsiella_pneumoniae.nf @@ -44,7 +44,7 @@ workflow CALL_KLEBSIELLA_PNEUMONIAE { serotypefinderDb = file(params.serotypefinderDb, checkIfExists: true) virulencefinderDb = file(params.virulencefinderDb, checkIfExists: true) // schemas and values - targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([]) + targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.value([]) main: ch_versions = Channel.empty() diff --git a/workflows/mycobacterium_tuberculosis.nf b/workflows/mycobacterium_tuberculosis.nf index df48d4a0..f0633c7c 100644 --- a/workflows/mycobacterium_tuberculosis.nf +++ b/workflows/mycobacterium_tuberculosis.nf @@ -34,7 +34,7 @@ workflow CALL_MYCOBACTERIUM_TUBERCULOSIS { tbdbBedIdx = file(params.tbdbBedIdx, checkIfExists: true) tbGradingRulesBed = file(params.tbGradingRulesBed, checkIfExists: true) // schemas and values - targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([]) + targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.value([]) main: ch_versions = Channel.empty() diff --git a/workflows/staphylococcus_aureus.nf b/workflows/staphylococcus_aureus.nf index 562d6197..f3b6c93d 100644 --- a/workflows/staphylococcus_aureus.nf +++ b/workflows/staphylococcus_aureus.nf @@ -42,7 +42,7 @@ workflow CALL_STAPHYLOCOCCUS_AUREUS { pointfinderDb = file(params.pointfinderDb, checkIfExists: true) virulencefinderDb = file(params.virulencefinderDb, checkIfExists: true) // schemas and values - targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([]) + targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.value([]) main: ch_versions = Channel.empty() diff --git a/workflows/streptococcus.nf b/workflows/streptococcus.nf index 4e258cdb..52ab560e 100644 --- a/workflows/streptococcus.nf +++ b/workflows/streptococcus.nf @@ -32,28 +32,28 @@ workflow CALL_STREPTOCOCCUS { inputSamples = file(params.csv, checkIfExists: true) // load references - referenceGenome = params.referenceGenome ? file(params.referenceGenome, checkIfExists: true) : Channel.of([]) - referenceGenomeDir = params.referenceGenome ? file(referenceGenome.getParent(), checkIfExists: true) : Channel.of([]) - referenceGenomeGff = params.referenceGenomeGff ? file(params.referenceGenomeGff, checkIfExists: true) : Channel.of([]) - referenceGenomeIdx = params.referenceGenomeIdx ? file(params.referenceGenomeIdx, checkIfExists: true) : Channel.of([]) + referenceGenome = params.referenceGenome ? file(params.referenceGenome, checkIfExists: true) : Channel.value([]) + referenceGenomeDir = params.referenceGenome ? file(referenceGenome.getParent(), checkIfExists: true) : Channel.value([]) + referenceGenomeGff = params.referenceGenomeGff ? file(params.referenceGenomeGff, checkIfExists: true) : Channel.value([]) + referenceGenomeIdx = params.referenceGenomeIdx ? file(params.referenceGenomeIdx, checkIfExists: true) : Channel.value([]) // databases amrfinderDb = file(params.amrfinderDb, checkIfExists: true) chewbbacaDb = file(params.chewbbacaDb, checkIfExists: true) - coreLociBed = params.coreLociBed ? file(params.coreLociBed, checkIfExists: true) : Channel.of([]) - krakenDb = params.krakenDb ? file(params.krakenDb, checkIfExists: true) : Channel.of([]) - mlstBlastDb = params.mlstBlastDb ? file(params.mlstBlastDb, checkIfExists: true) : Channel.of([]) + coreLociBed = params.coreLociBed ? file(params.coreLociBed, checkIfExists: true) : Channel.value([]) + krakenDb = params.krakenDb ? file(params.krakenDb, checkIfExists: true) : Channel.value([]) + mlstBlastDb = params.mlstBlastDb ? file(params.mlstBlastDb, checkIfExists: true) : Channel.value([]) pointfinderDb = file(params.pointfinderDb, checkIfExists: true) - pubMlstDb = params.pubMlstDb ? file(params.pubMlstDb, checkIfExists: true) : Channel.of([]) + pubMlstDb = params.pubMlstDb ? file(params.pubMlstDb, checkIfExists: true) : Channel.value([]) resfinderDb = file(params.resfinderDb, checkIfExists: true) serotypefinderDb = file(params.serotypefinderDb, checkIfExists: true) - shigapassDb = params.shigapassDb ? file(params.shigapassDb, checkIfExists: true) : Channel.of([]) - trainingFile = params.trainingFile ? file(params.trainingFile, checkIfExists: true) : Channel.of([]) + shigapassDb = params.shigapassDb ? file(params.shigapassDb, checkIfExists: true) : Channel.value([]) + trainingFile = params.trainingFile ? file(params.trainingFile, checkIfExists: true) : Channel.value([]) virulencefinderDb = file(params.virulencefinderDb, checkIfExists: true) // schemas and values - mlstScheme = params.mlstScheme ? params.mlstScheme : Channel.of([]) - species = params.species ? params.species : Channel.of([]) - speciesDir = params.speciesDir ? params.speciesDir : Channel.of([]) - targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([]) + mlstScheme = params.mlstScheme ? params.mlstScheme : Channel.value([]) + species = params.species ? params.species : Channel.value([]) + speciesDir = params.speciesDir ? params.speciesDir : Channel.value([]) + targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.value([]) main: ch_versions = Channel.empty() @@ -80,7 +80,7 @@ workflow CALL_STREPTOCOCCUS { reads: tuple(id, reads) bai: bai } - .set { bwa_mem_dedup_ch } + .set{ bwa_mem_dedup_ch } bwa_mem_dedup(bwa_mem_dedup_ch.reads, bwa_mem_dedup_ch.bai) samtools_index_assembly(bwa_mem_dedup.out.bam) @@ -92,7 +92,7 @@ workflow CALL_STREPTOCOCCUS { assembly: tuple(id, fasta) mapping: tuple(bam, bai) } - .set { freebayes_ch } + .set{ freebayes_ch } // VARIANT CALLING freebayes(freebayes_ch.assembly, freebayes_ch.mapping) @@ -124,56 +124,46 @@ workflow CALL_STREPTOCOCCUS { resfinder(ch_reads, species, resfinderDb, pointfinderDb) virulencefinder(ch_reads, params.useVirulenceDbs, virulencefinderDb) - ch_reads.map { sampleID, reads -> [ sampleID, [] ] }.set{ ch_empty } - - ch_amrfinderplus = amrfinderplus.out.output.concat(ch_empty).first() - ch_chewbbaca = chewbbaca_split_results.out.output.concat(ch_empty).first() - ch_emmtyper = emmtyper.out.tsv.concat(ch_empty).first() - ch_mlst = mlst.out.json.concat(ch_empty).first() - ch_quast = ch_quast.concat(ch_empty).first() - ch_qc = ch_qc.concat(ch_empty).first() - ch_ref_bam = ch_ref_bam.concat(ch_empty).first() - ch_ref_bai = ch_ref_bai.concat(ch_empty).first() - ch_resfinder = resfinder.out.json.concat(ch_empty).first() - ch_resfinder_meta = resfinder.out.meta.concat(ch_empty).first() - ch_serotypefinder = serotypefinder.out.json.concat(ch_empty).first() - ch_serotypefinder_meta = serotypefinder.out.meta.concat(ch_empty).first() - ch_shigapass = shigapass.out.csv.concat(ch_empty).first() - ch_virulencefinder = virulencefinder.out.json.concat(ch_empty).first() - ch_virulencefinder_meta = virulencefinder.out.meta.concat(ch_empty).first() + ch_reads.map{ sampleID, reads -> [ sampleID, [] ] }.set{ ch_empty } ch_quast - .join(ch_qc) - .join(ch_mlst) - .join(ch_chewbbaca) - .join(ch_amrfinderplus) - .join(ch_resfinder) - .join(ch_resfinder_meta) - .join(ch_serotypefinder) - .join(ch_serotypefinder_meta) - .join(ch_virulencefinder) - .join(ch_virulencefinder_meta) - .join(ch_shigapass) - .join(ch_emmtyper) - .join(ch_ref_bam) - .join(ch_ref_bai) + .join(ch_empty) + .join(mlst.out.json) + .join(chewbbaca_split_results.out.output) + .join(amrfinderplus.out.output) + .join(resfinder.out.json) + .join(resfinder.out.meta) + .join(ch_empty) + .join(ch_empty) + .join(virulencefinder.out.json) + .join(virulencefinder.out.meta) + .join(ch_empty) + .join(emmtyper.out.tsv) + .join(ch_empty) + .join(ch_empty) .join(ch_metadata) .join(ch_empty) .join(ch_empty) .join(ch_empty) .set{ combinedOutput } - kraken(ch_reads, krakenDb) - bracken(kraken.out.report, krakenDb) - brackenOutput = bracken.out.output ? bracken.out.output : ch_empty - - combinedOutput.join(bracken.out.output).set{ combinedOutput } - create_analysis_result(combinedOutput, referenceGenome, referenceGenomeIdx, referenceGenomeGff) + if ( params.useKraken ) { + krakenDb = file(params.krakenDb, checkIfExists: true) + kraken(ch_reads, krakenDb) + bracken(kraken.out.report, krakenDb).output + combinedOutput.join(bracken.out.output).set{ combinedOutput } + create_analysis_result(combinedOutput, referenceGenome, referenceGenomeIdx, referenceGenomeGff) + ch_versions = ch_versions.mix(kraken.out.versions) + ch_versions = ch_versions.mix(bracken.out.versions) + } else { + combinedOutput.join(ch_empty).set{ combinedOutput } + create_analysis_result(combinedOutput, referenceGenome, referenceGenomeIdx, referenceGenomeGff) + } create_yaml(create_analysis_result.out.json.join(ch_sourmash).join(ch_ska), speciesDir) ch_quast - .join(ch_qc) + .join(ch_empty) .join(chewbbaca_split_results.out.output) .set{ cdmInput } diff --git a/workflows/streptococcus_pyogenes.nf b/workflows/streptococcus_pyogenes.nf index e9af0367..025ab3d8 100644 --- a/workflows/streptococcus_pyogenes.nf +++ b/workflows/streptococcus_pyogenes.nf @@ -28,26 +28,26 @@ workflow CALL_STREPTOCOCCUS_PYOGENES { inputSamples = file(params.csv, checkIfExists: true) // load references - referenceGenome = params.referenceGenome ? file(params.referenceGenome, checkIfExists: true) : Channel.of([]) - referenceGenomeDir = params.referenceGenome ? file(referenceGenome.getParent(), checkIfExists: true) : Channel.of([]) - referenceGenomeGff = params.referenceGenomeGff ? file(params.referenceGenomeGff, checkIfExists: true) : Channel.of([]) - referenceGenomeIdx = params.referenceGenomeIdx ? file(params.referenceGenomeIdx, checkIfExists: true) : Channel.of([]) + referenceGenome = params.referenceGenome ? file(params.referenceGenome, checkIfExists: true) : Channel.value([]) + referenceGenomeDir = params.referenceGenome ? file(referenceGenome.getParent(), checkIfExists: true) : Channel.value([]) + referenceGenomeGff = params.referenceGenomeGff ? file(params.referenceGenomeGff, checkIfExists: true) : Channel.value([]) + referenceGenomeIdx = params.referenceGenomeIdx ? file(params.referenceGenomeIdx, checkIfExists: true) : Channel.value([]) // databases amrfinderDb = file(params.amrfinderDb, checkIfExists: true) chewbbacaDb = file(params.chewbbacaDb, checkIfExists: true) - coreLociBed = params.coreLociBed ? file(params.coreLociBed, checkIfExists: true) : Channel.of([]) - krakenDb = params.krakenDb ? file(params.krakenDb, checkIfExists: true) : Channel.of([]) - mlstBlastDb = params.mlstBlastDb ? file(params.mlstBlastDb, checkIfExists: true) : Channel.of([]) + coreLociBed = params.coreLociBed ? file(params.coreLociBed, checkIfExists: true) : Channel.value([]) + krakenDb = params.krakenDb ? file(params.krakenDb, checkIfExists: true) : Channel.value([]) + mlstBlastDb = params.mlstBlastDb ? file(params.mlstBlastDb, checkIfExists: true) : Channel.value([]) pointfinderDb = file(params.pointfinderDb, checkIfExists: true) - pubMlstDb = params.pubMlstDb ? file(params.pubMlstDb, checkIfExists: true) : Channel.of([]) + pubMlstDb = params.pubMlstDb ? file(params.pubMlstDb, checkIfExists: true) : Channel.value([]) resfinderDb = file(params.resfinderDb, checkIfExists: true) - trainingFile = params.trainingFile ? file(params.trainingFile, checkIfExists: true) : Channel.of([]) + trainingFile = params.trainingFile ? file(params.trainingFile, checkIfExists: true) : Channel.value([]) virulencefinderDb = file(params.virulencefinderDb, checkIfExists: true) // schemas and values - mlstScheme = params.mlstScheme ? params.mlstScheme : Channel.of([]) - species = params.species ? params.species : Channel.of([]) - speciesDir = params.speciesDir ? params.speciesDir : Channel.of([]) - targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([]) + mlstScheme = params.mlstScheme ? params.mlstScheme : Channel.value([]) + species = params.species ? params.species : Channel.value([]) + speciesDir = params.speciesDir ? params.speciesDir : Channel.value([]) + targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.value([]) main: ch_versions = Channel.empty() @@ -139,12 +139,18 @@ workflow CALL_STREPTOCOCCUS_PYOGENES { .join(ch_empty) .set{ combinedOutput } - kraken(ch_reads, krakenDb) - bracken(kraken.out.report, krakenDb) - brackenOutput = bracken.out.output ? bracken.out.output : ch_empty - - combinedOutput.join(bracken.out.output).set{ combinedOutput } - create_analysis_result(combinedOutput, referenceGenome, referenceGenomeIdx, referenceGenomeGff) + if ( params.useKraken ) { + krakenDb = file(params.krakenDb, checkIfExists: true) + kraken(ch_reads, krakenDb) + bracken(kraken.out.report, krakenDb).output + combinedOutput.join(bracken.out.output).set{ combinedOutput } + create_analysis_result(combinedOutput, referenceGenome, referenceGenomeIdx, referenceGenomeGff) + ch_versions = ch_versions.mix(kraken.out.versions) + ch_versions = ch_versions.mix(bracken.out.versions) + } else { + combinedOutput.join(ch_empty).set{ combinedOutput } + create_analysis_result(combinedOutput, referenceGenome, referenceGenomeIdx, referenceGenomeGff) + } create_yaml(create_analysis_result.out.json.join(ch_sourmash).join(ch_ska), speciesDir)