pyfim.analysis.preference_index

pyfim.analysis.preference_index(exp)

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

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
  • TC_CUT_HEAD: set to ignore the first X frames for PI calculation. Can be fraction (e.g. 0.75) of total frames.
  • TC_CUT_TAIL: set to ignore the last X frames for PI calculation. Can be fraction (e.g. 0.1) of total frames.
Parameters:exp (pyfim.Experiment) – Experiment holding the raw data.
Returns:PI
Return type:float