rubitCalcPosition: Calculate positional information (e.g. thigmotaxis,...

Description Usage Arguments Value See Also Examples

View source: R/calcPosition.R

Description

Divides a circular area into inner and outer zones in order to quantify thigmotaxis (distance from area perimeter), and divides a circular area into any number of equally-sized grid cells in order to quantify exploration (number of unique area grid cells visited).

Usage

1
2
rubitCalcPosition(m, scale = 1, area_rad = NA, thigmo_dist = NA,
  n_radials = 1, n_slices = 1, n_bootstraps = 20)

Arguments

m

a matrix containing processed tracking data outputted by rubitBasic.

scale

a numeric to calibrate the true spatial scale, in pixels per mm. If scale == 1, measurements are returned in pixels. This value should match that used in rubitBasic.

area_rad

the minimum radius of the area. If an area shows insufficient movement to define a minimum enclosing circle of at least this radius, then a new minimum enclosing circle is calculated using area_rad and area metainformation stored in attributes(m). This unit is defined in pixels unless scale != 1.

thigmo_dist

the distance from the boundary perimeter defined as being central (i.e. not thigmotaxis). If thigmo_dist = NA, thigmotaxis is defined as movement in the outer 50% of the area (i.e. > R / sqrt(2) from the area centre, where R is the radius of the area). This unit is defined in pixels unless scale != 1.

n_radials

the number of concentric circles to divide a circular area into.

n_slices

the number of slices to divide a circular area into.

n_bootstraps

the number of random data samples used to calculate the minimum enclosing circle defining each circular area.

Value

The input matrix with additional positional information added for each timepoint.

See Also

rubitPlotPosition to visualise positional information, and rubitMetrics to understand the different steps of processing.

Examples

1
2
3
4
5
data(tenebrio_basic)

### Divide circular area into 96 cells, and define thigmotaxis
### as movement within 20mm of the area perimeter.
sapply(tenebrio_basic, rubitCalcPosition, n_radials = 8, n_slices = 12, thigmo_dist = 20)

JoGall/rubitrail documentation built on May 7, 2019, 10:53 a.m.