dattalab / keypoint-moseq

https://keypoint-moseq.readthedocs.io
Other
71 stars 28 forks source link

KeyError at the 'Generate Dataframes' step #104

Closed ryanschwark closed 10 months ago

ryanschwark commented 11 months ago

Hi all,

After applying a previous model to new data, I've been able to generate many .csvs in the results folder from this new data. The next step is to use the Jupyter analysis notebook to create new moseq_df and stats_df files that incorporate the newly added data. After importing the data, I run this cell under the 1.3 Generate Dataframes tab and get the following error:

moseq_df = kpms.compute_moseq_df(project_dir, model_name, smooth_heading=True) moseq_df


KeyError Traceback (most recent call last) Cell In[9], line 1 ----> 1 moseq_df = kpms.compute_moseq_df(project_dir, model_name, smooth_heading=True) 2 moseq_df

File ~\anaconda3\envs\keypoint_moseq\lib\site-packages\keypoint_moseq\analysis.py:163, in compute_moseq_df(project_dir, model_name, fps, smooth_heading) 149 velocity.append( 150 np.concatenate( 151 ( (...) 158 ) 159 ) 161 if file_info is not None: 162 # find the group for each recording from index data --> 163 s_group.append([file_info[k]["group"]] n_frame) 164 else: 165 # no index data 166 s_group.append(["default"] n_frame)

KeyError: '00-07F4-369D + 00-007F4-3A99 - foreign breeding pair introduction - 10min trim.analysis_track0'

I've checked and this csv is in the results folder, so it's not that the file is missing. Any idea as to what could be causing this KeyError? Thanks!

versey-sherry commented 11 months ago

Hi, it is likely that this key is not in the index.yaml file. Could you open the index.yaml file with a text editor, and see if that key is included in the file. If the key is not included, please follow the same format and add the key to the file. Another alternative is to delete the index.yaml file and re-generate the file at the beginning of the notebook.

We are rolling out new analysis components and that would fix this issue and please stay tuned!