View source: R/pipeline-glassbox.R
glassbox | R Documentation |
eyeris
pipelineThis glassbox
function (in contrast to a "black box" function where you run
it and get a result but have no (or little) idea as to how you got from input
to output) has a few primary benefits over calling each exported function
from eyeris
separately.
glassbox(
file,
interactive_preview = FALSE,
preview_n = 3,
preview_duration = 5,
preview_window = NULL,
verbose = TRUE,
...,
confirm = deprecated(),
num_previews = deprecated(),
detrend_data = deprecated(),
skip_detransient = deprecated()
)
file |
An SR Research EyeLink |
interactive_preview |
A flag to indicate whether to run the |
preview_n |
Number of random example "epochs" to generate for previewing the effect of each preprocessing step on the pupil timeseries. |
preview_duration |
Time in seconds of each randomly selected preview. |
preview_window |
The start and stop raw timestamps used to subset the
preprocessed data from each step of the |
verbose |
A logical flag to indicate whether to print status messages to
the console. Defaults to |
... |
Additional arguments to override the default, prescribed settings. |
confirm |
(Deprecated) Use |
num_previews |
(Deprecated) Use |
detrend_data |
(Deprecated) A flag to indicate whether to run the
|
skip_detransient |
(Deprecated) A flag to indicate whether to skip
the |
First, this glassbox
function provides a highly opinionated prescription of
steps and starting parameters we believe any pupillometry researcher should
use as their defaults when preprocessing pupillometry data.
Second, and not mutually exclusive from the first point, using this function should ideally reduce the probability of accidental mishaps when "reimplementing" the steps from the preprocessing pipeline both within and across projects. We hope to streamline the process in such a way that you could collect a pupillometry dataset and within a few minutes assess the quality of those data while simultaneously running a full preprocessing pipeline in 1-ish line of code!
Third, glassbox
provides an "interactive" framework where you can evaluate
the consequences of the parameters within each step on your data in real
time, facilitating a fairly easy-to-use workflow for parameter optimization
on your particular dataset. This process essentially takes each of the
opinionated steps and provides a pre-/post-plot of the timeseries data for
each step so you can adjust parameters and re-run the pipeline until you are
satisfied with the choices of your paramters and their consequences on your
pupil timeseries data.
Preprocessed pupil data contained within an object of class eyeris
.
lifecycle::deprecate_warn()
demo_data <- eyelink_asc_demo_dataset()
# (1) examples using the default prescribed parameters and pipeline recipe
## (a) run an automated pipeline with no real-time inspection of parameters
output <- eyeris::glassbox(demo_data)
plot(
output,
steps = c(1, 5),
preview_window = c(0, max(output$timeseries$block_1$time_secs)),
seed = 0
)
## (b) run a interactive workflow (with confirmation prompts after each step)
output <- eyeris::glassbox(demo_data, interactive_preview = TRUE, seed = 0)
# (2) examples of overriding the default parameters
output <- eyeris::glassbox(
demo_data,
interactive_preview = FALSE, # TRUE to visualize each step in real-time
deblink = list(extend = 40),
lpfilt = list(plot_freqz = TRUE) # overrides verbose parameter
)
plot(output, seed = 0)
# (3) examples of disabling certain steps
output <- eyeris::glassbox(
demo_data,
detransient = FALSE,
detrend = FALSE,
zscore = FALSE
)
plot(output, seed = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.