Skip to content

Commit

Permalink
add TreeSE to report
Browse files Browse the repository at this point in the history
  • Loading branch information
d4straub committed Dec 20, 2024
1 parent c7a322d commit f442540
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
33 changes: 26 additions & 7 deletions assets/report_template.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ params:
picrust_pathways: FALSE
sbdi: FALSE
phyloseq: FALSE
tse: FALSE
---

<!-- Load libraries -->
Expand Down Expand Up @@ -1615,19 +1616,37 @@ but if you run nf-core/ampliseq with a sample metadata table (`--metadata`) any
"))
```

<!-- Section on PHYLOSEQ results -->
<!-- Section on exported R objects -->

```{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/).
"))
}
```

<!-- Section on methods -->
Expand Down
2 changes: 2 additions & 0 deletions modules/local/summary_report.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions workflows/ampliseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit f442540

Please sign in to comment.