Orchestrates the complete pipeline for a single ActTrust recording:
Usage
run_pipeline(
path,
tz = "UTC",
gap_s = 120,
params = acttrust_params(),
offwrist_args = list(),
sleep_args = list(),
nap_args = list(),
quiet = FALSE
)Arguments
- path
character(1). Path to the ActTrust.txtfile.- tz
character(1). Recording time zone. Passed toread_acttrust(). Default is"UTC".- gap_s
numeric(1). Gap threshold (seconds) forcheck_consistency(). Default is120.- params
Device parameter preset, as returned by
acttrust_params(). When supplied, values fromparamsare used as defaults for each detector stage, with any explicitoffwrist_args,sleep_args, ornap_argstaking precedence. Defaults toacttrust_params().- offwrist_args
list. Additional arguments passed todetect_offwrist_bimodal(). Default is an empty list.- sleep_args
list. Additional arguments passed todetect_sleep_crespo(). Default is an empty list.- nap_args
list. Additional arguments passed todetect_naps_crespo(). Default is an empty list.- quiet
logical(1). IfTRUE, suppresses the timestamp-issue warning emitted whencheck_consistency()finds problems. Useful in batch or testing contexts where the warning is expected. Default isFALSE.
Value
A zeitr_result S3 object — a named list with:
subject_idcharacter— derived from the input filename stem.source_filecharacter— absolute path to the input file.datatibble— final epoch-level data frame with all state columns populated.nightstibble— per-night sleep statistics.issuestibble— timestamp consistency issues (0 rows if none).metadatalist— device and subject metadata from the file header.
Details
Read —
read_acttrust()Consistency check —
check_consistency()Prepare —
prepare_actigraphy()Off-wrist detection —
detect_offwrist_bimodal()Main sleep period detection —
detect_sleep_crespo()Nap detection —
detect_naps_crespo()WASO + nightly statistics —
compute_waso()
See also
run_pipeline_batch() for processing a directory of files.