MultiSampleAnalysis.detect_events_simple¶
Module: workflow.py
Run event detection on a selected time window for quick method selection and parameter tuning.
Parameters¶
detect_method(str):threshold,zscore_threshold,cusum,pelt, orhmm; default"threshold".detect_params(dict[str, Any] | None): Method-specific parameters; defaults are selected automatically.baseline_method(str):"rolling_quantile"by default; also supports"global_quantile"and"global_median".baseline_params(dict[str, Any] | None): Workflow fallback{"window": 10000, "q": 0.5};global_quantileaccepts{"q": ...}.sample_id(str | None): Trace to process;Noneprocesses all loaded traces.current(str):"denoise"(default) or"raw".start_ms/end_ms(float): Window bounds in milliseconds; defaults0.0and1000.0.detect_direction(str):"down"(default) or"up".merge_event(bool): Whether to merge adjacent events; defaultFalse.merge_event_params(dict[str, Any] | None): Use{"merge_gap_ms": ...}for the merge gap.exclude_current(bool): Whether to mask current values during baseline/noise estimation; defaultTrue.exclude_current_params(dict[str, Any] | None): Statistical bounds, with direction-dependent defaults when omitted.
Returns¶
dict[str, list[Event]], keyed by trace id. Event indices are mapped back to full-trace indices.
Side effects¶
- Stores the result in
analysis.detect_events_simple_objectand the compatibility mirroranalysis.simple_events. - Stores settings in
analysis.simple_detect_state. - Uses a progress bar when
tqdmis available and raisesValueErrorwhen too few effective statistics points remain.