From f442540571a628df90ad1f08a9b1f315de19fa4c Mon Sep 17 00:00:00 2001 From: d4straub Date: Fri, 20 Dec 2024 15:25:07 +0100 Subject: [PATCH] add TreeSE to report --- assets/report_template.Rmd | 33 ++++++++++++++++++++++++++------- modules/local/summary_report.nf | 2 ++ workflows/ampliseq.nf | 4 ++-- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/assets/report_template.Rmd b/assets/report_template.Rmd index 76119739..50d077b0 100644 --- a/assets/report_template.Rmd +++ b/assets/report_template.Rmd @@ -107,6 +107,7 @@ params: picrust_pathways: FALSE sbdi: FALSE phyloseq: FALSE + tse: FALSE --- @@ -1615,19 +1616,37 @@ but if you run nf-core/ampliseq with a sample metadata table (`--metadata`) any ")) ``` - + -```{r, eval = !isFALSE(params$phyloseq), results='asis'} +```{r, results='asis'} +any_robject <- !isFALSE(params$phyloseq) || !isFALSE(params$tse) +``` + +```{r, eval = !isFALSE(params$any_robject), results='asis'} cat(paste0(" -# Phyloseq +# R objects -[Phyloseq](https://doi.org/10.1371/journal.pone.0061217) -is a popular R package to analyse and visualize microbiom data. -The produced RDS files contain phyloseq objects and can be loaded directely into R and phyloseq. +Microbiome data can be analysed and visualized with certain R packages. For convenience, R objects in RDS format are provided. +")) + +if ( !isFALSE(params$phyloseq) ) { + cat(paste0(" +[Phyloseq](https://doi.org/10.1371/journal.pone.0061217) objects and can be loaded directely into R with package 'phyloseq'. The objects contain an ASV abundance table and a taxonomy table. If available, metadata and phylogenetic tree will also be included in the phyloseq object. The files can be found in folder [phyloseq](../phyloseq/). -")) + ")) +} + +if ( !isFALSE(params$tse) ) { + cat(paste0(" +[TreeSummarizedExperiment](https://doi.org/10.12688/f1000research.26669.2) (TreeSE, TSE) +objects can be loaded into R with package 'TreeSummarizedExperiment'. and contain an ASV abundance table, +a taxonomy table, and sequences. +If available, metadata and phylogenetic tree will also be included in the object. +The files can be found in folder [treesummarizedexperiment](../treesummarizedexperiment/). + ")) +} ``` diff --git a/modules/local/summary_report.nf b/modules/local/summary_report.nf index 309dcdf7..61c93733 100644 --- a/modules/local/summary_report.nf +++ b/modules/local/summary_report.nf @@ -58,6 +58,7 @@ process SUMMARY_REPORT { path(picrust_pathways) path(sbdi, stageAs: 'sbdi/*') path(phyloseq, stageAs: 'phyloseq/*') + path(tse, stageAs: 'tse/*') output: path "*.svg" , emit: svg, optional: true @@ -137,6 +138,7 @@ process SUMMARY_REPORT { ancombc_formula ? "ancombc_formula='"+ ancombc_formula.join(",") +"'" : "", sbdi ? "sbdi='"+ sbdi.join(",") +"'" : "", phyloseq ? "phyloseq='"+ phyloseq.join(",") +"'" : "", + tse ? "tse='"+ tse.join(",") +"'" : "", ] // groovy list to R named list string; findAll removes empty entries params_list_named_string = params_list_named.findAll().join(',').trim() diff --git a/workflows/ampliseq.nf b/workflows/ampliseq.nf index 10a34b0c..e7014263 100644 --- a/workflows/ampliseq.nf +++ b/workflows/ampliseq.nf @@ -1016,8 +1016,8 @@ workflow AMPLISEQ { run_qiime2 && params.ancombc_formula && params.metadata ? QIIME2_ANCOM.out.ancombc_formula.collect().ifEmpty( [] ) : [], params.picrust ? PICRUST.out.pathways.ifEmpty( [] ) : [], params.sbdiexport ? SBDIEXPORT.out.sbditables.mix(SBDIEXPORTREANNOTATE.out.sbdiannottables).collect().ifEmpty( [] ) : [], - !params.skip_taxonomy && !params.skip_phyloseq ? ROBJECT_WORKFLOW.out.phyloseq.map{info,rds -> [rds]}.collect().ifEmpty( [] ) : [] - //TODO: add treesummarizedexperiment + !params.skip_taxonomy && !params.skip_phyloseq ? ROBJECT_WORKFLOW.out.phyloseq.map{info,rds -> [rds]}.collect().ifEmpty( [] ) : [], + !params.skip_taxonomy && !params.skip_tse ? ROBJECT_WORKFLOW.out.tse.map{info,rds -> [rds]}.collect().ifEmpty( [] ) : [] ) ch_versions = ch_versions.mix(SUMMARY_REPORT.out.versions) }