sgoldenlab / simba

SimBA (Simple Behavioral Analysis), a pipeline and GUI for developing supervised behavioral classifiers
https://simba-uw-tf-dev.readthedocs.io/
GNU General Public License v3.0
287 stars 140 forks source link

Data plot and wrong body parts selection #86

Closed filos93 closed 3 years ago

filos93 commented 3 years ago

Hey, I run into an issue with Data plot visualization. When I hit the "generate data plot" button in the GUI it gives me in terminal (Anaconda Prompt) a "KeyError: 'movement_Mouse_2_No_2'", indeed when I try to select body parts in the GUI they are wrong like truncated. In particular, the "Select body part" button shows me the wrong body parts (eg, "Mouse_2_No" instead of "Mouse_2_Nose" as it is in the project_bp_names.csv file). How can I fix it? Thank you so much again.

sgoldenlab commented 3 years ago

Hey @filos93 - sounds like a bug - which version of SimBA are you using?

filos93 commented 3 years ago

Hey @sgoldenlab thanks for reply, I'm using the dev version ie, pip install simba-uw-tf-dev, should I change it?

sgoldenlab commented 3 years ago

No, keep that one @filos93 - is it the latest version? I just want to be sure I am searching for the bug in the correct place.

filos93 commented 3 years ago

Hey @sgoldenlab my version is 0.77.6 Should be the latest right?

sgoldenlab commented 3 years ago

Yep, that's the latest. Thanks, I will get back to you, i'll see if I can recreate

sgoldenlab commented 3 years ago

@filos93 - can you update to version 0.77.7 and see if thats fixed?

Heads up, this part of the code hasn't been updated for a while and can still only handle two animals, if you have more you'll only get the data for animal 1 I believe.

filos93 commented 3 years ago

Hey @sgoldenlab I updated my version, that fixes the bug in the GUI but I still get a KeyError in the terminal (ie, "KeyError: 'movement_Mouse_1_Ear_left_2'), I'll attach a screenshot maybe that can help. Thanks again for your help and your patience. Screenshot (22)

sronilsson commented 3 years ago

Ah thanks for letting me know.. just to confirm, you don't have more than 2 animals? And are the same body parts tracked on all the animals?

filos93 commented 3 years ago

yes two animals and tracked bodyparts are the same, here's the list: "Mouse_1_Ear_left, Mouse_1_Ear_right, Mouse_1_Nose, Mouse_1_Tail_base, Mouse_2_Ear_left, Mouse_2_Ear_right, Mouse_2_Nose, Mouse_2_Tail_base" from my project_bp_names csv file

filos93 commented 3 years ago

the other visualizations (eg, Gantt plot, path plot) works well, it's just with Data plot visualization the issue

sgoldenlab commented 3 years ago

@filos93 - let's try one more time, could you update to 0.77.8 and see if that solves it?

filos93 commented 3 years ago

Hey @sgoldenlab I found the error in the dataplot.py lines: 61,63,105, you have to change "movement" to "Movement" (eg, if noAnimals == 2: move1ColName = "Movement" + SelectedBp + '1'" so simba can find the "Movement" in the features_extracted.csv file, after you do that everything works fine, I was able to generate the data plot! I'll attach a screnshot from the lines I changed in Notepad ++ maybe can help Screenshot (25) Screenshot (26)

. Thanks again :)

sronilsson commented 3 years ago

Super helpful, ta!