ltrack: Track larval movement in 24 or 48 well assay plates.

Description Usage Arguments Details Value

View source: R/drtracker.R

Description

Tracks single larvae in 24 or 48 well assay plates from xy spot data and computes distance and speed. Exports data as text files and generates plots.

Usage

1
2
3
4
5
6
7
ltrack(files = NULL, wells = 24, markededges = TRUE, fps = 25,
  mm = 5.4, framelinking = TRUE, follow = "none", trackfeatures = TRUE,
  activitydist = 5, spotcoverage = TRUE, spotalphahull = TRUE,
  alphavalue = 4, spotdensity = TRUE, spotmsd = FALSE, spotratio = TRUE,
  outercircleradius = 8.1, innercircleradius = 4.8,
  filenamediscard = ".txt", exportdata = TRUE, exportplot = TRUE,
  useexisting = FALSE)

Arguments

files

A character or vector of paths or filenames. See details.

wells

A numeric indicating plate format. Either 24 or 48.

markededges

A logical indicating if corners of plates have been marked. See details.

fps

A numeric indicating framerate of video in number of frames per second.

mm

A numeric indicating number of pixels in 1 mm.

framelinking

A logical indicating if spots should be linked frame to frame.

follow

A character indicating if the algorithm must be followed at every step. Options are 'none', 'interactive' or 'track'. See details.

trackfeatures

A logical indicating if track features should be computed.

activitydist

A numeric indicating distance in mm after which the larvae is considered active.

spotcoverage

A logical indicating if the coverge must be computed. See details.

spotalphahull

A logical indicating if alphahull of point cloud is to be calculated. See details.

alphavalue

A numeric indicating alpha value for alphahull. See details.

spotdensity

A logical indicating if 2D kernal density is to be estimated. See details.

spotmsd

A logical indicating if the minimum spanning distance should be computed. See details.

spotratio

A logical indicating if spotratio should be computed. See details.

outercircleradius

A numeric indicating radius of outer circle (radius of one well) in mm.

innercircleradius

A numeric indicating radius of inner circle in mm.

filenamediscard

A character for part of the filename to be removed.

exportdata

A logical indicating if data tables must be exported to working directory.

exportplot

A logical if results must be plotted and exported to working directory.

useexisting

A logical indicating if existing files in working directory with same filename should be recomputed and overwritten. If set to FALSE, all modules are computed and existing files are quietly overwritten. If set to TRUE, existing files are not modified, but non-existing files are computed and exported. Default set to FALSE.

Details

The quality of tracks almost completely depends on the image thresholding and subsequent xy data.
files
The input files must be tab-delimited decimal as dot (.) text files. The file must contain a minimum of 3 columns named x, y and slice. x is a numeric indicating x coordinate and y is a numeric indicating y coordinate of each spot. slice indicates the frame number for each spot. Extra columns are not used.
markededges
markededges = T indicates that the four corners of the plate have been marked in frame 1. They will be used for plate alignment and plotting and will be removed from analyses.
coverage
Area covered by each larvae in their respective well across the whole duration. Computed from convex hull of points. The polygon area is computed based on the function polyarea from package pracma.
msd
The minimum spanning distance based on the minimum spanning network of point cloud. Computed using spantree from package vegan. Very slow. Set to FALSE by default.
alphahull
The alphahull of point cloud based on the alphavalue. The function ahull from package alphahull. Smaller alphavalue produces more gaps in spot cloud.
spotdensity
Computes 2D kernal density of spots and generates an image file.
spotratio
Spots in the periphery of the well and spots in the centre of the well are computed. A ratio is computed. filenamediscard
The file name of the input file is used on plots and text files for identification. Part of the filename to be removed can be indicated here. '.txt' is removed by default.
follow
Set as 'none', 'interactive' or 'track'. In 'interactive' mode, a plot is shown at every frame and waits for user input. In 'track' mode, the track path creation is shown in real-time.

Value

Returns the features dataframe.
'Features' contains row number, plate name, well, id, total distance in pixels and mm, mean speed in pixels per sec (pps) and in mm per second (mmps), max speed in pixels per sec (pps) and mm per sec (mmps), duration of the whole sequence in frames (fr) and seconds (sec), activity (active seconds), framerate (fps) and calibration, number of pixels in one mm (mm). If coverage=TRUE, then coverage is added in pxsq and mmsq. If alphahull=TRUE, then alphahull area is added in pxsq and mmsq. If spotratio=TRUE, then outer spots, inner spots and spots ratio is added. If msd=TRUE, then msd_px and msd_mm are added. If more than one file was selected, a Combined-Features file is also exported. If exportplot = T, then 8 figures are exported: EdgeMarks, AssignedWells, Tracks, spotCoverage, spotMsd, spotAlphahull, spotDensity and spotRatio.


royfrancis/drtracker documentation built on May 27, 2019, 11:45 p.m.