Skip to contents

This function loads a single CSV containing tracking data. The function then scores the tracked data and outputs PAWS scores.

Usage

mini_paws(
  csv_or_path,
  manual_scale_factor = NA,
  p_cutoff = 0,
  filter = "none",
  body_part = "center",
  reference_distance,
  fps = 2000,
  savgol_window_length = 11,
  median_window_length = 11,
  average_window_length = 11,
  shake_threshold = 0.35,
  window_threshold = 0.5,
  fixed_baseline = 1,
  y_threshold = 0.1
)

Arguments

csv_or_path

Either a csv loaded as an R object, or the full path to that CSV.

manual_scale_factor

The 'real-world-length' to pixel conversion factor (i.e. millimeters/pixel). If you are using two reference points, you can ignore this parameter.

p_cutoff

The confidence value at which all tracked points below this threshold are replaced by linear interpolation between two higher-confidence points.

filter

The filter chosen to smooth tracked trajectories. Options are "none", "savitzky-golay", "median", or "average" (average recommended)

body_part

The body_parts you wish to plot.

reference_distance

The 'real-world-length' between your reference objects (can be in mm, cm, etc). If you indicate a manual_scale_factor, this setting will be overrided by that factor.

fps

The frames per second of your CSV.

savgol_window_length

The rolling window length of Savitzky-Golay filter smoothing to apply to your tracking trajectory.

median_window_length

The rolling window length of median filter smoothing to apply to your tracking trajectory.

average_window_length

The rolling window length of average filter smoothing to apply to your tracking trajectory.

shake_threshold

The threshold to examine a given window of tracking activity for shaking behaviors. Higher values apply a more conservative shaking threshold (Tip: if shake segmentation does not match what you see in a video, you can fine-tune the threshold to match your observations).

window_threshold

The threshold to examine a given window of tracking activity for a withdrawal behavior. Higher values apply a more conservative window threshold.

fixed_baseline

The height (in units of choice) above the lowest y-axis position of the paw, used to determine the baseline for activity. the y_threshold parameter is used to set a baseline for this level of activity.

y_threshold

The threshold (in units of choice) above the fixed baseline at which the start and end time-points of activity are determined.

Value

A data frame in RStudio containing PAWS scores for a single file.