lastralab / ABISSMAL

Github repository for ABISSMAL behavioral tracking platform
https://github.com/lastralab/ABISSMAL
Other
3 stars 2 forks source link

[R] Fix more bugs in data analysis functions while applying them to biological data #442

Closed gsvidaurre closed 9 months ago

gsvidaurre commented 12 months ago

I need to fix bugs that arise while using the new functions to process biological data. Test all fixes to functions by running the automated tests each time.

gsvidaurre commented 10 months ago

I want to generate a summary statistic of the magnitude of movement when videos were recorded by motion detection. This should be added to the function that scores detection clusters. Consider using 0 to the total number of pixels possible given the frame size of videos and quantiles within that range

gsvidaurre commented 10 months ago

Also, I realized that I’m still dropping the camera only events (e.g. just 1 camera triggering event) in find_detectionClusters. These events may represent when the birds were inside of the container, which is a different type of movement that should not be dropped. The recent change to using an infrared camera and LEDs means that the camera is triggered by movement inside the container only (assuming that the LEDs are connected correctly)

Consider updating score_detectionClusters to find the pre-processed camera events that are not included in detection clusters across sensors, and add these back as “inside container” movements

gsvidaurre commented 10 months ago

I added the magnitude of movement calculation but as a percentage of the total pixels available in a given video frame. I think the quartile-based approach could be useful in data analysis afterwards to get a sense of how "big" movements were with respect to all others recorded

gsvidaurre commented 10 months ago

I added the pre-processed video data integration option to score_detectionClusters and reran unit testing for all functions. Next up is to rerun data processing and analysis for data we're using for the manuscript, and to fix any bugs in functions that arise

gsvidaurre commented 10 months ago

I fixed a bug while processing biological data related to bad assumptions about Edge columns while adding on pre-processed video recording events. Then I found another bug that should be fixed next: detection clusters with 2 unique sensor types have an Edge_2 that is a duplicate of Edge_1 (see detection_clusters.csv)

gsvidaurre commented 10 months ago

Actually that bug is not a bug....I was confusing the sensor_ids column for another Edge column in the output of score_detectionClusters

gsvidaurre commented 10 months ago

The bug was in my brain....

gsvidaurre commented 10 months ago

Rename the functions (and associated documentation) as in Figure 4 of the manuscript