Saving Metadata #1039
Replies: 2 comments 3 replies
-
@matiasandina Thank you for starting this conversation. This is indeed of course a critical point of any experiment, and something that we should all design well ahead of data collection. What is the main difficulty of tackling this directly in bonsai itself is that bonsai is a general purpose programming language that can be used to create and run any kind of program or experiment. Therefore, it is much harder to know ahead of time what exactly even counts as metadata since there is a lot which is unknown regarding what is running in the workflow. Even parameters which might seem obvious such as acquisition sampling rate for ephys or cameras, become complicated if suddenly the camera is being triggered dynamically by some other hardware configured directly or indirectly by bonsai. Not to mention of course the complexities of formalizing and stabilizing metadata for rich experimental behavior tasks. My feeling here is that this should be attacked two-fold:
Happy to hear other feedback on this. |
Beta Was this translation helpful? Give feedback.
-
To avoid to create multiple copies of my workflows, I use the simple extension from Bruno here to save the workflows when they start: #1002 It's still not ideal as it does not save dynamically updated parameters, but at least keeps most relevant metadata and has the advantage of being very simple. |
Beta Was this translation helpful? Give feedback.
-
Metadata are important information that accompany all experiments. I don't think this is the place to delve into this topic and assume we all understand why there is a need for saving metadata.
As a general rule, I have found that it's difficult for me to save metadata in bonsai, and choose to hard-code variables in my analysis code and refer to my handwritten notes with caution instead (e.g., channel map to go from column major to
channels x time
). Small changes like adding the frame number of one camera recording mess up the transformation and create spurious data.Below are few examples of what I would want to save, but I assume the community has other variables of interest.
Currently, some of this information is saved on the
.bonsai
itself. But that creates a few issues. First, in order to save it as it ran, you have to duplicate your sketch for new experiments. I understand this might be a design choice, but in my experience it becomes impractical to duplicate sketches many times, especially if you tweak a few values here and there (e.g., HSV thresholding). Second, as of today, the bonsai files are not trivial to parse programmatically to get the information out into another machine readable format (e.g.,.yaml
,.json
, ...).According to the last discussions of the gitter, this is a known issue and the team/users desire to make it better. People seem to externalize properties and save them (unclear how, but I am also partially doing this for some things using
CsvWriter
) and @glopesdev proposed using xpath queries to parse the information from the bonsai file.I understand the difficulty to foresee all that users might want to save from an experiment and don't think that's the goal the development team should aim for. But because there's flexibility in the sketches, and because metadata changes the data in important ways, it would be desirable to have a record of this flexibility as a file that accompanies the recorded data.
Beta Was this translation helpful? Give feedback.
All reactions