View source: R/utils-boilerplate.R
| boilerplate | R Documentation |
Auto-generates human-readable, "fMRIPrep-style" methods-section boilerplate
text that describes – in plain prose – the exact preprocessing workflow
that was run on an eyeris object. Because every eyeris preprocessing step
records its own call stack and parameters (in eyeris$params), the pipeline
is able to self-document precisely what it did to your data, ready to paste
directly into the methods section of a manuscript.
This reinforces the workflow-level transparency at the heart of the eyeris
"glassbox" philosophy: the code that ran and the prose that describes it are
generated from one and the same source of truth.
boilerplate(
eyeris,
version = NULL,
include_citation = TRUE,
include_license = TRUE
)
eyeris |
An object of class |
version |
Optional character string giving the |
include_citation |
Logical. Whether to append a formatted citation for
|
include_license |
Logical. Whether to append the Creative Commons CC BY
4.0 license note telling users it is safe to paste the text into a manuscript
as long as they cite |
The generated text walks the recorded pipeline steps in the canonical order
in which eyeris applies them (load_asc -> deblink -> detransient ->
interpolate -> lpfilt -> downsample/bin -> detrend -> zscore ->
epoch) and emits one sentence per step, substituting in the actual
parameter values that were used. Steps that were skipped are omitted, and any
custom (user-supplied) pipeline extensions are appended at the end so that
multi-step and non-default pipelines are described faithfully. Multi-block
(multi-run) and binocular recordings are handled automatically.
The boilerplate also references the per-run, machine-readable .json
metadata sidecar that eyeris writes for every run
(source/logs/run-XX_metadata.json), which together with the reported
package version is sufficient to reproduce the pipeline exactly.
License & attribution. The auto-generated boilerplate text is licensed
under the Creative Commons Attribution 4.0 International (CC BY 4.0) license
(https://creativecommons.org/licenses/by/4.0/). It is explicitly safe to
copy and paste the generated Markdown content directly into your manuscript,
provided that you give appropriate credit by citing eyeris (run
citation("eyeris") for the reference); including that citation in your
references satisfies the attribution requirement. This mirrors the approach
taken by fMRIPrep and other reproducible-pipeline tools.
When you run bidsify() (or glassbox() with reporting
enabled), this same boilerplate is embedded in the diagnostic HTML report and
written to derivatives/.../source/logs/ as a standalone Markdown file.
A length-one character string of Markdown-formatted methods
boilerplate (invisibly classed as eyeris_boilerplate so it prints nicely at
the console). The raw string can be passed to base::cat(),
base::writeLines(), or embedded directly in a report.
glassbox(), bidsify()
demo_data <- eyelink_asc_demo_dataset()
eyeris_obj <- demo_data |>
eyeris::glassbox(verbose = FALSE)
# print the copy-and-paste-ready methods boilerplate
boilerplate(eyeris_obj)
# capture it as plain Markdown text (e.g., to write to a file)
methods_md <- boilerplate(eyeris_obj)
cat(methods_md)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.