Auerbach-Lab/Behavior-autoanalysis

Multiple runs on the same day

Opened this issue · 1 comments

Adding 2 runs for same rat same day has issues. Note that there is code Check_Multipart_Run but its not used.

Restarts are normally caused by either matlab issues or due to unexpected user stoppage. However, restarts can occur if the rats are running on the wrong files.

Example files:
1/19/2023 BP1, 3, and 4 Same file in both runs
1/26/2023 Orange 11-12, LP3-LP4 Wrong files loaded so different file in both runs

Requirements

  • Same assignment gets applied to both. Note this requires getting the assignment from the prior run or from Old..._
  • Warnings should be handled Potential hangups: Low trial count, high FA%, or low hit% may not be the case for the 'combined' files. Also I don't know which set of warnings the supervisor.xlsx will display.

Desired Behavior

Solution thoughts
Best case is probably to throw a flag i.e. CheckMultipartRun possibly during Get_Rat_Name. It is currently marked as ToDo at line 313 in Get_Run_Data. This flag should then trigger the unused function Check_Multipart_Run (line 1189) that that:

  1. Pulls the prior run from the run_archive
  2. copies the assignment from the extant file to the new file
  3. Recalculates stats (trial_count, hit_percent, FA_percent, mean_attempts_per_trial) necessary for Check_Performance_Cutoffs by combining the two run files (pull old run and combines with new run) Note this will cause issues cause its looking in analysis$stats which hasn't been written for the new run and we should to write out truthfully. We may need to add a 3rd 'corrected' entry with the combined stats?
  4. Handle warnings. I would normally say to blank the warnings list prior to step 3 but the issue is that this would cause the loss of 'wrong file', etc data. I don't know what the correct solution is right now.

See #70 for current workaround, which could be considered a fix for #14, expect it doesn't handle inputting. How inputting currently works is that you enter 1 file, remove it and then use the import_deleted_entries to apply the same comments, etc to both matlab files.