Skip to content

Commit

Permalink
Merge pull request #619 from d4straub/add_phyloseq_output
Browse files Browse the repository at this point in the history
add SBDI export and phyloseq output to summary report
  • Loading branch information
d4straub authored Aug 18, 2023
2 parents a6e5d22 + 671d54f commit 8a537f0
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Added`

- [#558](https://github.com/nf-core/ampliseq/pull/558) - Pipeline summary report
- [#558](https://github.com/nf-core/ampliseq/pull/558),[#619](https://github.com/nf-core/ampliseq/pull/619) - Pipeline summary report
- [#615](https://github.com/nf-core/ampliseq/pull/615) - Phyloseq R object creation

### `Changed`

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ nf-core/ampliseq was originally written by Daniel Straub ([@d4straub](https://gi

We thank the following people for their extensive assistance in the development of this pipeline (in alphabetical order):

- [Adam Bennett](https://github.com/a4000)
- [Diego Brambilla](https://github.com/DiegoBrambilla)
- [Emelie Nilsson](https://github.com/emnilsson)
- [Jeanette Tångrot](https://github.com/jtangrot)
Expand Down
37 changes: 35 additions & 2 deletions assets/report_template.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ params:
diversity_indices_beta: FALSE
diversity_indices_adonis: ""
picrust_pathways: FALSE
sbdi: FALSE
phyloseq: FALSE
---

<!-- Load libraries -->
Expand Down Expand Up @@ -1379,11 +1381,11 @@ for (folder in ancom) {
}
```

<!-- Subsection on PICRUSt2 results -->
<!-- Section on PICRUSt2 results -->

```{r, eval = !isFALSE(params$picrust_pathways), results='asis'}
cat(paste0("
## PICRUSt2
# PICRUSt2
[PICRUSt2](https://pubmed.ncbi.nlm.nih.gov/32483366/) (Phylogenetic Investigation of Communities by Reconstruction of Unobserved States)
is a software for predicting functional abundances based only on marker gene sequences.
Expand All @@ -1394,6 +1396,37 @@ see `METACYC_path_abun_unstrat_descrip.tsv`. Quantifications are not normalized
"))
```

<!-- Section on SBDI results -->

```{r, eval = !isFALSE(params$sbdi), results='asis'}
cat(paste0("
# SBDI
The [Swedish Biodiversity Infrastructure (SBDI)](https://biodiversitydata.se/) provides a cost-effective, cutting-edge
infrastructure that supports Swedish and international biodiversity and ecosystems research.
Files in preparation for submission to SBDI can be found in folder [SBDI](../SBDI/).
Tables are generated from the DADA2 denoising and taxonomy assignment steps.
Each table, except `annotation.tsv`, corresponds to one tab in the [SBDI submission template](https://asv-portal.biodiversitydata.se/submit).
Most of the fields in the template will not be populated,
but if you run nf-core/ampliseq with a sample metadata table (`--metadata`) any fields corresponding to a field in the template will be used.
"))
```

<!-- Section on PHYLOSEQ results -->

```{r, eval = !isFALSE(params$phyloseq), results='asis'}
cat(paste0("
# Phyloseq
[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.
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/).
"))
```

<!-- Section on methods -->

# Methods
Expand Down
5 changes: 4 additions & 1 deletion modules/local/summary_report.nf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ process SUMMARY_REPORT {
path(diversity_indices_adonis, stageAs: 'beta_diversity/adonis/*') // prevent folder name collisons
path(ancom)
path(picrust_pathways)

path(sbdi, stageAs: 'sbdi/*')
path(phyloseq, stageAs: 'phyloseq/*')

output:
path "*.svg" , emit: svg, optional: true
Expand Down Expand Up @@ -119,6 +120,8 @@ process SUMMARY_REPORT {
diversity_indices ? "diversity_indices_depth='$diversity_indices',diversity_indices_beta='"+ diversity_indices_beta.join(",") +"'" : "",
diversity_indices_adonis ? "diversity_indices_adonis='"+ diversity_indices_adonis.join(",") +"',qiime_adonis_formula='$params.qiime_adonis_formula'" : "",
ancom ? "ancom='"+ ancom.join(",") +"'" : "",
sbdi ? "sbdi='"+ sbdi.join(",") +"'" : "",
phyloseq ? "phyloseq='"+ phyloseq.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: 3 additions & 1 deletion workflows/ampliseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,9 @@ workflow AMPLISEQ {
run_qiime2 && !params.skip_diversity_indices && params.metadata ? QIIME2_DIVERSITY.out.beta.collect().ifEmpty( [] ) : [],
run_qiime2 && !params.skip_diversity_indices && params.metadata ? QIIME2_DIVERSITY.out.adonis.collect().ifEmpty( [] ) : [],
run_qiime2 && !params.skip_ancom && params.metadata ? QIIME2_ANCOM.out.ancom.collect().ifEmpty( [] ) : [],
params.picrust ? PICRUST.out.pathways.ifEmpty( [] ) : []
params.picrust ? PICRUST.out.pathways.ifEmpty( [] ) : [],
params.sbdiexport ? SBDIEXPORT.out.sbditables.mix(SBDIEXPORTREANNOTATE.out.sbdiannottables).collect().ifEmpty( [] ) : [],
!params.skip_taxonomy ? PHYLOSEQ_WORKFLOW.out.rds.map{info,rds -> [rds]}.collect().ifEmpty( [] ) : []
)
ch_versions = ch_versions.mix(SUMMARY_REPORT.out.versions)
}
Expand Down

0 comments on commit 8a537f0

Please sign in to comment.