Skip to content

Commit

Permalink
add input section
Browse files Browse the repository at this point in the history
  • Loading branch information
d4straub committed Jul 31, 2023
1 parent f732688 commit ea20a1c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
42 changes: 42 additions & 0 deletions assets/report_template.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ output:
date: "`r Sys.Date()`"
#bibliography: ./references.bibtex
params:
# any parameter that is by default "FALSE" is used to evaluate the inclusion of a codeblock with e.g. "eval=!isFALSE(params$mqc_plot)"

# report style
css: NULL
logo: NULL
Expand Down Expand Up @@ -51,6 +53,10 @@ params:
qiime_adonis_formula: FALSE

# file paths
metadata: FALSE
samplesheet: FALSE
fasta: FALSE
input: FALSE
mqc_plot: FALSE
ca_sum_path: FALSE
dada_filtntrim_args: FALSE
Expand Down Expand Up @@ -142,6 +148,42 @@ subtitle: `r report_subtitle`
The bioinformatics analysis pipeline [nfcore/ampliseq](https://nf-co.re/ampliseq) is used for amplicon sequencing,
supporting denoising of any amplicon and supports a variety of taxonomic databases for taxonomic assignment of 16S, ITS, CO1 and 18S amplicons.

<!-- Section on Input -->

# Input

Pipeline input was saved in folder [input](../input).

```{r, results='asis'}
if ( !isFALSE(params$samplesheet) ) {
# samplesheet input
cat("Sequencing data was provided in the samplesheet file `", params$samplesheet, "` that is displayed below:", sep="")
samplesheet <- read.table(file = params$samplesheet, header = TRUE, sep = "\t")
# Display table
datatable(samplesheet, options = list(
scrollX = TRUE,
scrollY = "300px",
paging = FALSE))
} else if ( !isFALSE(params$fasta) ) {
# fasta input
cat("ASV/OTU sequences were provided in the fasta file `", params$fasta, "`. ", sep="")
} else if ( !isFALSE(params$input) ) {
# folder input
cat("Sequencing data was retrieved from folder `", params$fasta, "`. ", sep="")
}
if ( !isFALSE(params$metadata) ) {
cat("Metadata associated with the sequencing data was provided in `", params$metadata, "` and is displayed below:", sep="")
metadata <- read.table(file = params$metadata, header = TRUE, sep = "\t")
# Display table
datatable(metadata, options = list(
scrollX = TRUE,
scrollY = "300px",
paging = FALSE))
}
```

<!-- Section on Preprocessing -->

```{r, eval = !isFALSE(params$mqc_plot) || !isFALSE(params$dada_filtntrim_args), results='asis'}
Expand Down
8 changes: 7 additions & 1 deletion modules/local/summary_report.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
process SUMMARY_REPORT {

label 'process_low'

container 'docker.io/tillenglert/ampliseq_report:latest'
Expand All @@ -20,6 +19,9 @@ process SUMMARY_REPORT {
path(report_template)
path(report_styles)
path(report_logo)
path(metadata)
path(samplesheet)
path(fasta)
path(mqc_plots)
path(ca_summary)
val(find_truncation_values)
Expand Down Expand Up @@ -76,6 +78,10 @@ process SUMMARY_REPORT {
"workflow_manifest_version='${workflow.manifest.version}'",
"workflow_scriptid='${workflow.scriptId.substring(0,10)}'",
meta.single_end ? "flag_single_end=TRUE" : "",
metadata ? "metadata='$metadata'" : "",
samplesheet ? "samplesheet='$samplesheet'" : "",
fasta ? "fasta='$fasta'" : "",
!fasta && !samplesheet ? "input='$params.input'" : "",
mqc_plots ? "mqc_plot='${mqc_plots}/svg/mqc_fastqc_per_sequence_quality_scores_plot_1.svg'" : "",
ca_summary ?
params.retain_untrimmed ? "flag_retain_untrimmed=TRUE,ca_sum_path='$ca_summary'" :
Expand Down
3 changes: 3 additions & 0 deletions workflows/ampliseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,9 @@ workflow AMPLISEQ {
ch_report_template,
ch_report_css,
ch_report_logo,
ch_metadata.ifEmpty( [] ),
params.input.toString().toLowerCase().endsWith("tsv") ? ch_input : [], // samplesheet input
is_fasta_input ? PARSE_INPUT.out.fasta.ifEmpty( [] ) : [], // fasta input
!is_fasta_input && !params.skip_fastqc && !params.skip_multiqc ? MULTIQC.out.plots : [], //.collect().flatten().collectFile(name: "mqc_fastqc_per_sequence_quality_scores_plot_1.svg")
!params.skip_cutadapt ? CUTADAPT_WORKFLOW.out.summary.collect().ifEmpty( [] ) : [],
find_truncation_values,
Expand Down

0 comments on commit ea20a1c

Please sign in to comment.