Parameters and code reference

Default parameters, the code behind every metric and the review status of this documentation.

✓ All descriptions on these pages have been reviewed against the current analysis code.

Parameters and their defaults

Set in the setup wizard; the values below are the defaults used in these pages.

ParameterDefaultNote
duration360000Total samples (100 Hz → 3600s = 1 hour)
sampling_rate100Hz
rms_window300Window for RMS computation (3s at 100Hz)
equality_factor0.5Threshold ratio for sip detection
rms_threshold1.0RMS threshold for activity bout detection
min_sip_duration4Minimum sip duration in samples (40ms)
max_sip_duration100Maximum sip duration in samples (1s)
matlab_identical_detectionFalse
bin_size1000Bin size for cumulative feeding (samples)
trial_before_s10.0peri-trial sip rate from -before ...
trial_after_s30.0... to +after
trial_count_s10.0sips counted in 0..count after the trial
trial_bin_s1.0peri-trial bin width
remove_substrate_noneatersFalse
remove_global_noneatersFalse
non_eater_threshold2
remove_spill_qualityFalse
spill_quality_threshold0.5
remove_driftFalse
bonsai_style_activity_boutsFalse
time_window60000Time bin for timecourse (samples)
merge_channelsFalse
save_epsTrue

How this documentation stays current

These pages are generated from the analysis code (flypad/metrics_catalog.py): values such as window sizes and thresholds are read from the code, and figures 1-3 are drawn by running the current detection on a real 10-minute recording. The pages are regenerated automatically whenever analysis code is committed (git hook) or pushed (GitHub Action). Every metric records a fingerprint of the code that computes it; if that code changes, the metric is marked for review until its text has been checked.

Review status of every metric

TopicMetricCode fingerprintReviewed
Signal processingTrimmed recording1cd813e2c909✓
Signal processingMedian-filtered signald8be006f0b38✓
Signal processingDetrended trace R3bace2a170c0✓
Signal processingActivity (RMS) mask2862c63f0530✓
SipsSip onset / offset7dab289a3e51✓
SipsSip duration3bad3cba97d8✓
SipsInter-sip interval (IFI / ISI)3bad3cba97d8✓
SipsIn-burst / isolated sips7533b7f2b4ea✓
Activity boutsActivity bout onset / offset / durationc71bc6f2f762✓
Activity boutsActivity bout IBI35411d59b9aa✓
Activity boutsActive samplesc71bc6f2f762✓
Feeding burstsFeeding burst3927a72d5a21✓
Feeding burstsBurst duration / sips per burst / burst IBIba07a94537f1✓
Feeding burstsBursts per activity boutf820111caa37✓
Feeding burstsInsider IBIf820111caa37✓
Feeding burstsBurst latencyf820111caa37✓
Quality control and fly removalSpill quality / unconnected / out of ranged1c39952371d✓
Quality control and fly removalFly removal80da3248e27f✓
Per-fly summary metricsNumber of sips6de393b9bd79✓
Per-fly summary metricsMedian sip duration5f3ccbc35a12✓
Per-fly summary metricsMedian inter-sip interval5f893ec021a0✓
Per-fly summary metricsTotal sip duration851158f9cd45✓
Per-fly summary metricsTotal inter-sip intervals2e3ab6daec84✓
Per-fly summary metricsNumber of activity bouts44b4a83110a1✓
Per-fly summary metricsMedian activity bout duration09c54c900b5e✓
Per-fly summary metricsMedian activity bout IBIf186d9716318✓
Per-fly summary metricsTotal activity bout duration39488e7666aa✓
Per-fly summary metricsNumber of feeding burstsd89ae1334638✓
Per-fly summary metricsMedian burst duration50f42d23a4c5✓
Per-fly summary metricsMedian burst IBIba2ab74742c7✓
Per-fly summary metricsMedian burst latency / bursts per bout / insider IBI55d662449370✓
Substrate transitionsTransition IBIdd519f804342✓
Substrate transitionsNumber of transitions / median transition IBI4fe961c25f12✓
Substrate transitionsVisit sequence / transition matrixbe4c0fb2bf42✓
Time coursesCumulative sips / feeding bursts69903d3cb515✓
Time coursesCumulative activity69903d3cb515✓
Time coursesNon-cumulative (per bin)cc8e1b6009eb✓
Time coursesPreference index (sips, activity)752f4ca823bd✓
Time coursesTime-resolved per-fly parameterse2a600eeb198✓
DistributionsSip duration / inter-sip interval histograms0245fcda189c✓
DistributionsCCDFccdca7dfcfa5✓
StatisticsDescriptive statistics0c030283b5c3✓
StatisticsPairwise test6d5dd78d06f1✓
StatisticsOmnibus tests094b98a130d4✓
StatisticsEffect sizes73534e013526✓
Stimulation vs catchPeri-trial sip rate50323d100e3a✓
Stimulation vs catchSips after the trial5770253873bc✓
Stimulation vs catchTime until feeding stops5770253873bc✓
Stimulation vs catchLatency to feed again5770253873bc✓
Stimulation vs catchStim and catch periods of a flybc494deb5c45✓
Stimulation vs catchBox-plot and microstructure metrics within periods984df77798cf✓
Stimulation vs catchPaired Wilcoxon test89751e7903aa✓

Code fingerprints

Fingerprint of every computation file (comments and docstrings ignored).

FileFingerprint
core/__init__.pya54504566751
core/burst_detection.pyd6ce985e9cfe
core/data_loader.pyd850b4c3cbb4
core/events.pycf6d57979819
core/pipeline.py65089f08e549
core/post_processing.py408beab27bb1
core/signal_processing.pye96034efb937
core/sip_detection.pydca8b9e5c8c8
analysis/__init__.pydd4fab74efa2
analysis/cumulative.py65d6245b154c
analysis/distributions.py8387620290b9
analysis/preference_index.py4169c4714937
analysis/statistics.pyfdb26462a634
analysis/stim_catch.pyf295c37cbe18
export/__init__.py309da18954e7
export/excel_export.py98051f89a1a6
export/extra_outputs.py9d1e3f81bf46
export/figure_export.py97ef0e0cef8f
export/text_export.py1360e3096326
plotting/__init__.py15884253ffdc
plotting/box_plots.pya13dda1b9d80
plotting/ccdf_plots.py95342f5f2c5e
plotting/cumulative_plots.py5fc064afba23
plotting/histograms.pyfb5ebe52d4d4
plotting/microstructure.py445a47a99730
plotting/preference_plots.py3cd0338c8b3c
plotting/style.py32c522d9eb2e
config/__init__.py756e30c3c537
config/constants.py56a1c037c69c
config/hardware.py42f2693fc864
config/labels.py10611c3c0444
config/parameters.py226de15950c6
config/viz_preferences.py387d9fbd7e13