diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b3fc94..485d14a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Added` +- [#700](https://github.com/nf-core/ampliseq/pull/700) - Optional `--save_intermediates` to publish QIIME2 data objects (.qza) and visualisation objects (.qzv) + ### `Changed` ### `Fixed` diff --git a/conf/modules.config b/conf/modules.config index 7b28c7e9..b159d8d0 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -664,10 +664,10 @@ process { withName: 'QIIME2_INASV_BPAVG' { publishDir = [ - path: { "${params.outdir}/qiime2/input" }, + path: { "${params.outdir}/qiime2/barplot_average" }, mode: params.publish_dir_mode, pattern: "*.qza", - enabled: false + enabled: params.save_intermediates ] } @@ -758,25 +758,55 @@ process { withName: QIIME2_ALPHARAREFACTION { publishDir = [ - path: { "${params.outdir}/qiime2" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + [ + path: { "${params.outdir}/qiime2" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') || filename.endsWith('.qzv') ? null : filename } + ], + [ + path: { "${params.outdir}/qiime2/alpha-rarefaction" }, + mode: params.publish_dir_mode, + pattern: "*.qzv", + enabled: params.save_intermediates + ] ] } withName: 'QIIME2_DIVERSITY_CORE|QIIME2_DIVERSITY_ALPHA|QIIME2_DIVERSITY_BETA|QIIME2_DIVERSITY_BETAORD' { publishDir = [ - path: { "${params.outdir}/qiime2/diversity" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') || filename.endsWith('.qza') ? null : filename } + [ + path: { "${params.outdir}/qiime2/diversity" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') || filename.endsWith('.qza') || filename.endsWith('.qzv') ? null : filename } + ], + [ + path: { "${params.outdir}/qiime2/diversity/qza_qzv" }, + mode: params.publish_dir_mode, + pattern: "*{.qza,.qzv}", + enabled: params.save_intermediates + ], + [ + path: { "${params.outdir}/qiime2/diversity/qza_qzv" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.endsWith('.qza') ? filename : null }, + enabled: params.save_intermediates + ] ] } withName: QIIME2_DIVERSITY_ADONIS { publishDir = [ - path: { "${params.outdir}/qiime2/diversity/beta_diversity" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + [ + path: { "${params.outdir}/qiime2/diversity/beta_diversity" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') || filename.endsWith('.qzv') ? null : filename } + ], + [ + path: { "${params.outdir}/qiime2/diversity/beta_diversity/adonis" }, + mode: params.publish_dir_mode, + pattern: "*.qzv", + enabled: params.save_intermediates + ] ] } diff --git a/modules/local/qiime2_alphararefaction.nf b/modules/local/qiime2_alphararefaction.nf index 23dfe602..d5313174 100644 --- a/modules/local/qiime2_alphararefaction.nf +++ b/modules/local/qiime2_alphararefaction.nf @@ -11,6 +11,7 @@ process QIIME2_ALPHARAREFACTION { output: path("alpha-rarefaction/*"), emit: rarefaction + path("*.qzv") , emit: qzv path "versions.yml" , emit: versions when: diff --git a/modules/local/qiime2_diversity_adonis.nf b/modules/local/qiime2_diversity_adonis.nf index 0672aa4f..946a0512 100644 --- a/modules/local/qiime2_diversity_adonis.nf +++ b/modules/local/qiime2_diversity_adonis.nf @@ -9,6 +9,7 @@ process QIIME2_DIVERSITY_ADONIS { output: path("adonis/*") , emit: html + path("*.qzv") , emit: qzv path "versions.yml" , emit: versions when: diff --git a/modules/local/qiime2_diversity_alpha.nf b/modules/local/qiime2_diversity_alpha.nf index 743ed518..ba755d51 100644 --- a/modules/local/qiime2_diversity_alpha.nf +++ b/modules/local/qiime2_diversity_alpha.nf @@ -9,6 +9,7 @@ process QIIME2_DIVERSITY_ALPHA { output: path("alpha_diversity/*"), emit: alpha + path("*.qzv") , emit: qzv path "versions.yml" , emit: versions when: diff --git a/modules/local/qiime2_diversity_beta.nf b/modules/local/qiime2_diversity_beta.nf index c48b6b4c..eef3cdf2 100644 --- a/modules/local/qiime2_diversity_beta.nf +++ b/modules/local/qiime2_diversity_beta.nf @@ -9,6 +9,7 @@ process QIIME2_DIVERSITY_BETA { output: path("beta_diversity/*"), emit: beta + path("*.qzv") , emit: qzv path "versions.yml" , emit: versions when: diff --git a/modules/local/qiime2_diversity_betaord.nf b/modules/local/qiime2_diversity_betaord.nf index 658cf765..9e54b544 100644 --- a/modules/local/qiime2_diversity_betaord.nf +++ b/modules/local/qiime2_diversity_betaord.nf @@ -9,6 +9,7 @@ process QIIME2_DIVERSITY_BETAORD { output: path("beta_diversity/*"), emit: beta + path("*.qzv") , emit: qzv path "versions.yml" , emit: versions when: diff --git a/nextflow.config b/nextflow.config index b65af8c8..f9a659c0 100644 --- a/nextflow.config +++ b/nextflow.config @@ -22,58 +22,59 @@ params { metadata = null // Other options - trunc_qmin = 25 - trunc_rmin = 0.75 - trunclenf = null - trunclenr = null - max_ee = 2 - max_len = null - ignore_failed_filtering = false - min_len = 50 - metadata_category = null - metadata_category_barplot = null - double_primer = false - retain_untrimmed = false - cutadapt_min_overlap = 3 - cutadapt_max_error_rate = 0.1 - exclude_taxa = "mitochondria,chloroplast" - min_frequency = 1 - min_samples = 1 - multiple_sequencing_runs = false - single_end = false - sample_inference = "independent" - illumina_novaseq = false - illumina_pe_its = false - concatenate_reads = false - cut_its = "none" - its_partial = 0 - picrust = false - sbdiexport = false - addsh = false - tax_agglom_min = 2 - tax_agglom_max = 6 - min_read_counts = 1 - ignore_failed_trimming = false - ignore_empty_input_files = false - qiime_adonis_formula = null - seed = 100 - filter_ssu = null - min_len_asv = null - max_len_asv = null - filter_codons = null - orf_start = 1 - orf_end = null - stop_codons = "TAA,TAG" - pplace_tree = null - pplace_aln = null - pplace_model = null - pplace_alnmethod = 'hmmer' - pplace_taxonomy = null - pplace_name = null - diversity_rarefaction_depth = 500 - ancom_sample_min_count = 1 - vsearch_cluster = null - vsearch_cluster_id= 0.97 + save_intermediates = false + trunc_qmin = 25 + trunc_rmin = 0.75 + trunclenf = null + trunclenr = null + max_ee = 2 + max_len = null + ignore_failed_filtering = false + min_len = 50 + metadata_category = null + metadata_category_barplot = null + double_primer = false + retain_untrimmed = false + cutadapt_min_overlap = 3 + cutadapt_max_error_rate = 0.1 + exclude_taxa = "mitochondria,chloroplast" + min_frequency = 1 + min_samples = 1 + multiple_sequencing_runs = false + single_end = false + sample_inference = "independent" + illumina_novaseq = false + illumina_pe_its = false + concatenate_reads = false + cut_its = "none" + its_partial = 0 + picrust = false + sbdiexport = false + addsh = false + tax_agglom_min = 2 + tax_agglom_max = 6 + min_read_counts = 1 + ignore_failed_trimming = false + ignore_empty_input_files = false + qiime_adonis_formula = null + seed = 100 + filter_ssu = null + min_len_asv = null + max_len_asv = null + filter_codons = null + orf_start = 1 + orf_end = null + stop_codons = "TAA,TAG" + pplace_tree = null + pplace_aln = null + pplace_model = null + pplace_alnmethod = 'hmmer' + pplace_taxonomy = null + pplace_name = null + diversity_rarefaction_depth= 500 + ancom_sample_min_count = 1 + vsearch_cluster = null + vsearch_cluster_id = 0.97 // Report options report_template = "${projectDir}/assets/report_template.Rmd" diff --git a/nextflow_schema.json b/nextflow_schema.json index 938690d4..efa73e92 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -57,6 +57,11 @@ "description": "The output directory where the results will be saved. You have to use absolute paths to storage on Cloud infrastructure.", "fa_icon": "fas fa-folder-open" }, + "save_intermediates": { + "type": "boolean", + "description": "Save intermediate results such as QIIME2's qza and qzv files", + "fa_icon": "fas fa-folder-open" + }, "email": { "type": "string", "description": "Email address for completion summary.",