msd-methods: msd

Description Usage Arguments Details Value Examples

Description

calculate mean square displacement for individual trajectory or summarize on trajectories.

Usage

1
msd(trackll,dt=6,resolution=0.107,summarize=F,cores=1,plot=F,output=F)

Arguments

dt

Time intervals.

resolution

ratio of pixel to µM.

trackll

Track list output from readDiatrack().

summarize

An logical indicate if MSD should be calculated on individual trajectories (Default) or summarized on all trajectories.

filter

a vector specifies the minimum and max length of trajecotries to be analyzed. Take only trajectories that has number of frames greater than (>=) min and less than (<) max.

cores

Number of cores used for parallel computation. This can be the cores on a workstation, or on a cluster. Tip: the computation on each file will be parallel assigned to each CPU core.

plot

An logical indicate if plot should be generated. See Values for detail.

output

An logical indicate if output should be generated. See Values for detail.

Details

msd() calculate track (/trajectory)'s mean square displacement as a function of time (dt). For a track of N steps, at each dt, there are N-dt number of sub-trajectory/sub-tracks, mean of dt-wise sub-trajectories/ step-wise sub tracks average subtracks into one number at each dt.

the dt number of su-btracks each contains N:N-dt steps. Because minimum step is 1 (N-dt > = 1), so the maxium dt is N-1 (dt < = N-1). As dt increase, the number of steps used to generate that mean decrease with the maxmum dt (dt=N-1) generated from one step.

if one wants to focus on a group of trajectory's evolution, he can simply filter on a number that is bigger than the dt he wanted to plot MSD.

by assinging cores, computation is paralelled on each each list of trackll (corresponding to one movie file).

Value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# read in using readDiatrack
folder=system.file("extdata","SWR1",package="smt")
trackll=readDiatrack(folder)

# filter track based length
trackll.flt=filterTrack(trackll,filter=c(min=5,max=Inf))
msd=msd(trackll.flt,dt=6,summarize=TRUE,plot=TRUE)
str(msd)

# focus on a group of trajectory by setting filter greater than dt
trackll.flt2=filterTrack(trackll,filter=c(min=7,max=Inf))
msd2=msd(trackll.flt2,dt=6,summarize=TRUE,plot=TRUE)

sheng-liu/smt documentation built on May 29, 2019, 9:22 p.m.