Event/Trial Ontology (ADAMACS)
This page adapts the DataJoint Element Event ontology to ADAMACS usage.
Reference: Element Event concepts.
Ontology-first mindset for ADAMACS
The core idea is simple: define time ontology first, then run analysis.
In practice:
first agree on what counts as a session, scan, block, trial, and event
encode those concepts in tables and keys
only then compute features, train models, and compare conditions
This is why ADAMACS treats event/trial structure as core infrastructure, not as notebook-side convenience.
Why this matters
Most ingest/debug issues in behavior synchronization come from unclear timing ontology.
Use this page when validating event.Event and trial.Trial population.
ADAMACS ontology map
Concept |
Element Event table |
ADAMACS usage |
|---|---|---|
Session |
|
One experiment session ( |
Recording |
|
Behavior/AUX recording linked to the session/scan ingest context |
Event vocabulary |
|
Names such as |
Event instances |
|
Timestamped entries ( |
Trial vocabulary |
|
Trial category labels |
Trial instances |
|
Trial windows ( |
Event-trial link |
|
Event membership per trial |
Optional blocking |
|
Block-level grouping (optional) |
Analysis window spec |
|
Event-locked windows for downstream analysis |
Expanded labeled timeline (adapted)
This extends the Element Event conceptual timeline with ADAMACS labels used in practice.
|------------------------ behavior.Procedure 1 (session-bound) ------------------------|_____|------- behavior.Procedure 2 (cross-session labels) -------|
|-------------------------------------------- Session 1 --------------------------------------------|______________________________|------------- Session 2 -------------|
|---------------------------- Scan 1 ----------------------------|__|--------- Scan 2 ---------|_______________________________________|--------- Scan 1 ---------|__|---- Scan 2 ----|
|----- Block 1 -----|______|----- Block 2 -----|______|----- Block 3 -----|
| Trial 1 || Trial 2 |____| Trial 3 || Trial 4 |____| Trial 5 |____| Trial 6 |
|_|e1|_|e2||e3|_|e4|__|e5|__|e6||e7||e8||e9||e10||e11|____|e12||e13|______|
Interpretation:
Procedure labels are conceptual groupings:
session-bound variants usually map to session metadata + trial/event labels
cross-session variants are shared label vocabularies (for example
trial.TrialType,event.EventType)
behavior.Procedurein this timeline is a conceptual label, not a required core table in ADAMACS.Scans are ingest units in ADAMACS and are commonly used as restrictions (
scan_key).Blocks and trials are intervals; events are points/spans on the same recording clock.
trial.TrialEventlinks event instances to trial windows.
Procedure labels in ADAMACS
In ADAMACS, procedures are part of the experimental grammar, not free text. ADAMACS mirrors this with two practical layers:
session-bound procedure context: usually represented through session/recording metadata (
session.SessionNote,event.BehaviorRecording.recording_notes) and scan-restricted event/trial rowscross-session procedure vocabulary: represented by stable label sets in
event.EventTypeandtrial.TrialType
If the lab decides to add a dedicated behavior.Procedure lookup later, this ontology still holds:
the table should define shared vocabulary
session/scan/trial tables should carry the instance-level links
Label mapping in ADAMACS
Timeline label |
Where to store/restrict |
|---|---|
Procedure (session-bound) |
|
Procedure (cross-session) |
|
Session |
|
Scan |
|
Block |
|
Trial |
|
Event ( |
|
Graph visualization
ER view (same ontology)
Key field semantics
event.Event.event_start_timeandevent.Event.event_end_timeare in seconds relative to recording start.trial.Trial.trial_start_timeandtrial.Trial.trial_stop_timeare also on the same recording-time axis.trial.TrialEventis the bridge table used for event-in-trial analyses.Typical ADAMACS restrictions use
session_id+scan_id(scan_key).
Table-level reference (core)
Table |
Primary key shape |
Key attributes used most often |
|---|---|---|
|
|
|
|
|
|
|
|
relative file path for recording source |
|
|
|
|
|
alignment/start/end event types with time shifts |
|
|
|
|
|
nullable |
|
|
event membership of trials |
|
|
|
|
|
block membership of trials |
Note:
In Element Event / Trial, many imported tables are populated via explicit inserts in ingest workflows (
allow_direct_insert=Truepatterns are common).
dj.Diagram views (from adamacs_analysis)
These are exported from adamacs_analysis/notebooks/21_schema_dependency_diagrams.ipynb.
Event schema
Trial schema
These diagrams are not decoration. Use them as the dependency contract before writing downstream analysis joins.
ADAMACS-specific conventions
In ADAMACS workflows, event/trial checks are usually run with
scan_keyrestrictions.Typical validation pattern:
(event.Event() & scan_key)
(trial.Trial() & scan_key)
(trial.TrialEvent() & scan_key)
Common sync sanity checks:
(event.Event() & "event_type='aux_cam'" & 'event_start_time < "100"' & scan_key)
(event.Event() & "event_type='aux_cam'" & 'event_start_time > "1000"' & scan_key)
Minimal debugging checklist
event.EventTypecontains required event names.event.Eventrows exist for the targetscan_key.trial.Trialrows exist and time windows are non-empty.trial.TrialEventrows exist for expected events.Event times and trial windows use the same recording clock convention.