disc: Run a disc analysis action

Description Usage Arguments Details See Also Examples

View source: R/disc.R

Description

Run a disc analysis action

Usage

1
2
disc(ids = NULL, actions = c("calibrate", "track", "correct", "stats"),
  deploy.dir = NULL, ...)

Arguments

ids

vector of deployments ids (correspond to folders in the working directory). Usually deployment ids are integers, which makes it easy to give ranges of deployments such as 1:10. But deployment ids can be anything.

actions

vector of actions to perform. Action names can be abbreviated. See below which actions are available.

deploy.dir

path to the directory containing deployments (and associated options). By default "deployments" in the current directory.

...

passed to the various actions functions. To see which arguments are available, see the help of the various action functions

Details

"camera compass angle"

estimate the angle between the top of the camera and the physical direction in which the digital compass is set up in its housing by detecting the angle of the analog compasses on a few frames and comparing that with the record of the digital compass. Is usually done on short, calibration-type deployments.

"calibrate"

measure the position of the arena on the first image of a deployment, to calibrate the trajectory and convert distances from pixels on frame to mm. See the "disc.diameter" option set by disc_conf.

"track"

manually track the larva(e) on each frame

"compass"

manually detect the analog compass bearing when the digital compass does not work

"correct"

correct larvae tracks according to compass readings, to put them back in cardinal space

"stats"

compute statistics on the positions of larvae in the arena

See Also

Other action.functions: disc_calibrate, disc_camera_compass_angle, disc_correct, disc_stats, disc_track_compass, disc_track

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# get example deployments included with the package
deploys <- system.file("extdata", "deployments", package = "discr")
# copy them to a writable, temporary directory
temp <- tempdir()
file.copy(deploys, temp, recursive=TRUE)
dd <- paste0(temp, "/deployments/")

disc_status(dd)

## Not run: # perform some actions on deployment 1
disc(ids=1, actions=c("calibrate", "track"), sub=10, deploy.dir=dd)
# action names can be abbreviated
disc(1, actions=c("cor", "st"), deploy.dir=dd)
# several deployments can be handled successively
disc(1:2, actions=c("cor", "st"), deploy.dir=dd)
# arguments can be passed to action functions
read.csv(paste0(dd, "/1/stats.csv"))
disc(1, actions="stats", sub=10, deploy.dir=dd)
read.csv(paste0(dd, "/1/stats.csv"))

## End(Not run)

jiho/discr documentation built on May 19, 2019, 9:30 a.m.