Comparison¶
A comparison asks whether a behavior differs between groups of recordings. It takes one behavior result (a behavior scan or a behavior clustering run), groups the recordings by a column of your recording information (treatment, sex, session), computes the measures, and reads the groups side by side.
You choose the column; the tool picks the design. A column that is the same for all of an animal's recordings compares between animals. One that changes within an animal compares within it: two values are a paired contrast, three or more numeric values a trend, three or more named values a profile. Name two Contrast levels to compare just those two. Every result says which design ran.
Say what one observation is. When one animal contributed several recordings, averaging each animal first and counting every recording separately give different answers, so Aggregate to is yours to set and the tool does not guess.
It stops at description. Means, medians, spreads, and a permutation floor: how big a
difference chance would produce, from Floor draws shuffles of the kind the design allows
(group labels across animals, or each animal's own direction or levels). The only p-values are
the floor's own. stats.csv, one row per observation, is the handoff to whatever model you test
with.
Every cluster, named or not. With Measure set to every cluster of a clustering run, each node of its tree with at least Candidate floor of member time is ranked by how its share of time differs, nested slices of one behavior are collapsed to the best of them, and the list says where to look. Naming a cluster is still yours to do, from its clips.
The source is pinned. A comparison reads a snapshot of its behavior result, so its numbers keep meaning what they meant after the run is reopened and re-cut.
Parameters¶
Source run¶
source_run_id · string · required
The analysis run whose behavior output is compared (§19).
Source snapshot¶
source_snapshot · string
Which pinned copy of that run's artifact to compare (§21). Left unset, the comparison pins the run's current artifact and records the id it got, so its numbers stay reproducible after the run is reopened and re-cut. The node source reads the run's current node cache and takes no snapshot.
Measure¶
source · string · default labels
What is measured: the run's labelled behaviors (its §19 artifact); every candidate node of a clustering run's node cache, labelled or not: the difference screen over clusters nobody has named yet; or locations: distance travelled, time moving, speed and body shape, read from a location-export run. Nodes need a clustering run with a current node cache. Locations need a location-export run that measured the body, on calibrated recordings.
Group by¶
group_by · array · required
Columns to compare across: any metadata.csv column, plus subject or window_id.
Aggregate to¶
aggregate_to · array · required
Columns to average through before grouping: the unit of analysis. Empty means each recording is an observation; ['animal'] means each animal is. Both are legitimate and they answer different questions, so there is no default.
Contrast levels¶
levels · array
Two values of the one group_by column to contrast, read as the second against the first. Unset, a column with two values contrasts them, a numeric column with more is a trend, and a column with more non-numeric values is a profile over all of them: the largest difference between any two.
Recordings¶
recordings · array
Restrict to these recordings; unset compares every recording in the artifact.
Measures¶
measures · array
Which §23 measures to compute; unset computes every registered measure. The node source always measures share of time, rate, total time and mean duration, and refuses a subset.
Windows¶
windows
How to slice each recording in time: the whole span, fixed durations, equal fractions, or a sliding window. window_id then becomes a column to compare across, which is how early-versus-late becomes the same operation as drug-versus-vehicle. The node source measures the whole recording.
Floor draws¶
draws · integer · default 200 · range ≥ 1
Permutation draws behind the difference ranking's floor. A paired contrast over ten or fewer units enumerates every sign flip instead, and ignores this.
Seed¶
seed · integer · default 0 · range ≥ 0
Seed for the permutation floor, so a ranking reproduces.
Presence (s)¶
presence_s · number · default 5.0 · range ≥ 0 · unit s
Seconds of total time at a level for a unit to count as having the behavior present there. Within-unit designs count present units toward the minimum, and a paired contrast reports how many units are present at each level.
Pseudo-count (s)¶
pseudo_count_s · number · default 1.0 · range ≥ 0 · unit s
Seconds of time added to both sides of a within-unit ratio, in the measure's own unit, so a node absent at one level has a finite ratio rather than an infinite one that would own the floor.
Minimum units (share)¶
min_units_fraction · number · default 0.5 · range >0–1
The share of the cohort's units a behavior must be present in for its within-unit effect to be defined. Below it the effect is undefined, never large: a node three of eight animals ever showed cannot clear a floor on their behalf.
Candidate floor (s)¶
candidate_floor_s · number · default 30.0 · range ≥ 0 · unit s
Seconds of member time a cluster needs, over the whole run, to be a candidate of the node source. Below it a cluster is too small to be judged from its clips, and every candidate widens the family the floor is taken over.
Suppress nested nodes¶
suppress_nesting · boolean · default True
Over a hierarchical source, keep the best clearing node and drop its ancestors and descendants, repeating down the ranking, so one behavior is reported once rather than as every slice of itself. Ignored for a flat source.
Rank on¶
statistic · string · default moderated_t
What a within-unit ranking scores each behavior by, and the floor is taken over. The moderated t is the mean per-unit effect over its spread across units (plus the family's median spread, so exact agreement cannot own the floor): a behavior ranks by how far the units agree, not by how large its numbers are, and the floor stops belonging to the sparsest behaviors. The effect ranks by the mean per-unit effect itself, as comparisons run before this choice existed did. The effect is shown either way. A between design has no per-unit effects and ranks on the effect.
Rows per second read¶
location_sample_fps · number · default 5.0 · range > 0
Locations source: rows per second read for each animal. The run's rows are thinned to at most this many a second before anything is measured, so runs exported at different rates are measured alike. A run exported at a lower rate is read as it is. Unset reads every row.
Path smoothing (s)¶
location_smooth_s · number · default 1.0 · range > 0 · unit s
Locations source: seconds the body's position is averaged over before distance and speed are measured. Without it, frame-to-frame jitter adds distance for an animal standing still.
Moving above (cm/s)¶
location_moving_threshold · number · default 2.0 · range ≥ 0
Locations source: speed on the smoothed path, in centimetres per second, above which an animal counts as moving.
Jump above (body lengths/s)¶
location_jump_speed · number · default 7.5 · range > 0
Locations source: a raw step faster than this many of the animal's own body lengths per second is a tracking jump, not movement. The path is broken there rather than joined, so the jump adds no distance. 7.5 is one and a half body lengths in a fifth of a second.