We need to load the output from our neuroscience animal behavior training sessions into our datajoint database pipeline. We run experiments with a platform called Bpod that implements a finite state machine on an Arduino to control hardware and record events. We want to be able to analyze, for example, the response time on each trial, which is the time gap between two of the states in the finite state machine.
The data about state and event timings are saved within a matlab structure for each trial, with a field for each state that contains an array with the start and end times for that state (states can occur more than once during a trial, so the array for a state within a trial can have size(3,2) for example).
My question is what is the most efficient way to store these data within the datajoint database? Right now, we have an imported table Trials with an entry for each trial. It seems most efficient to store the start time for each state in a column with float values in some sort of part table, but I'm not sure how to do that programmatically given that (1) states can occur multiple times and (2) without hard-coding a part table for each state (the list of possible states can also vary as we adjust the behavior paradigm over time, and it would be nice to not have to rebuild the entire database to add a new state). Alternatively, we had originally imagined having a column for each state within the Trials table, but then the data would have to be blobs, which I would guess might be much less efficient? Any advice appreciated!