pyfim.analysis.PI_over_time

pyfim.analysis.PI_over_time(exp)

Calculates the preference index (PI) for a two choice experiment over time:

PI = (exp-control)/(exp+control)

with exp and control being the number of objects on the experimental and the control side, respectively.

Based on code by Sebastian Hueckesfeld (University of Bonn, Germany).

Notes

This function counts the number of objects in rolling windows of 10s on either side of a boundary. You can finetune this behaviour by adjusting the following parameters in the config file:

  • TC_PARAM: parameter used to split data (e.g. “mom_x” for split along x-axis)
  • TC_BOUNDARY: boundary between control and experiment
  • TC_CONTROL_SIDE: defines which side is the control
  • TC_COUNT_WINDOW: rolling window (in frames) over which to count max objects
  • TC_SMOOTHING_WINDOW : rolling window (in frames) over which to smooth PI
Parameters:exp (pyfim.Experiment) – Experiment holding the raw data.
Returns:PI over time
Return type:pandas.DataFrame