Skip to content

Report templates - #1

Open
worthyc51 wants to merge 6 commits into
1.2.0devfrom
report_templates
Open

worthyc51 wants to merge 6 commits into
1.2.0devfrom
report_templates

Conversation

@worthyc51

Copy link
Copy Markdown

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/pathogensurveillance branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

"type": "string"
},
"ref_ncbi_query_max": {
"type": "string",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

integer

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 1881570

+| ✅ 265 tests passed       |+
#| ❔  10 tests were ignored |#
!| ❗   1 tests had warnings |!
Details

❗ Test warnings:

❔ Tests ignored:

✅ Tests passed:

Run details

  • nf-core/tools version 4.1.0
  • Run at 2026-10-06 23:11:23

Comment thread assets/schema_report_data.json Outdated
},
"template": {
"type": "string",
"default": "report",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pathsurveil_report

Comment thread bin/check_samplesheet.R Outdated
Comment on lines +1209 to +1211
if (grepl('^~', value)) {
stop(call. = FALSE, paste0('report_data template "', value, '" starts with "~", which is not expanded.'))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment out and test if ~ works

Comment thread bin/check_samplesheet.R Outdated
stop(call. = FALSE, paste0('report_data template "', value, '" starts with "~", which is not expanded.'))
}
candidates <- value
if (!grepl('^/', value)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support relative paths

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test if matches a dir name in assets/report_templates, if it exists use it even if a relative path also matches

Comment thread bin/check_samplesheet.R
# Replace double quotes with single quotes to not conflict with the CSV format quoting values
metadata_samp[] <- lapply(metadata_samp, gsub, pattern = '"', replacement = "'")
metadata_ref[] <- lapply(metadata_ref, gsub, pattern = '"', replacement = "'")
metadata_rep[] <- lapply(metadata_rep, gsub, pattern = '"', replacement = "'")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

Comment thread docs/output.md Outdated

This is the primary output of the pipeline, containing the report meant to be understandable by non-bioinformaticians.

Each full report directory contains the rendered site, so every page of a multi-page template is included along with the stylesheets, scripts and images those pages reference. A `render_target` publishes only the exact matching rendered file.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generalize to any quarto template output or just talk about defualt repor

Comment thread modules/local/render_report/main.nf Outdated
export XDG_CACHE_HOME="\$(pwd)/cache"

# Render a private copy; the staged template may be a symlink to user data.
cp -r --dereference render_report_template render_report

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odd name for template

Comment thread modules/local/render_report/main.nf Outdated
Comment on lines +60 to +66
shopt -s nullglob dotglob
rendered_entries=( "\$site_dir"/* )
shopt -u nullglob dotglob
if [[ -d "\$site_dir" && \${#rendered_entries[@]} -gt 0 ]]; then
mkdir -p "${prefix}"
cp -R "\$site_dir/." "${prefix}/"
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if can be replaced with cp --dereference

Comment thread workflows/pathogensurveillance.nf Outdated
Comment on lines +295 to +298
.map { row ->
def report_meta = [id: row.report_group_ids.toString()]
def template_meta = [template: row.template.toString(), render_target: row.render_target.toString()]
[report_meta, template_meta, file(row.template.toString(), checkIfExists: true)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move parsing logic to PREPARE_INPUT and use same methods that are used to parse sample and reference metadata so that we dont need to hardcode column names

Comment thread bin/check_samplesheet.R Outdated
Comment on lines +1213 to +1217
expanded_value <- path.expand(value)
candidates <- expanded_value
if (!grepl('^/', expanded_value)) {
candidates <- c(candidates, file.path(projectDir, expanded_value))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too complex, if it exists use it, otherwise error

Comment thread docs/usage.md Outdated
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `report_group_ids` | Report group IDs defined in the sample metadata. Can accept multiple values if delimited by semicolons. |
| `template` | A pre-built template directory name under `assets/report_templates/` (for example, `pathsurveil_report`) or a path to a custom template directory. Existing paths are checked before pre-built names. Multiple templates may be delimited by semicolons. |
| `template` | A pre-built template directory name under `assets/report_templates/` (for example, `pathsurveil_report`) or a path to a custom template directory. Built-in template names are checked first; otherwise relative, `~`-prefixed, and absolute paths are supported. Multiple templates may be delimited by semicolons. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont need dewtail on different types of paths

def template_meta = [
template: row.template.toString(),
render_target: row.render_target.toString()
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like ref_meta = ref_meta.collectEntries { key, value -> [(key): value ?: null] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants