msd-methods: msd

Description Usage Arguments Details Value Examples

Description

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

Usage

1
2
3
4
5
msd(trackll,dt=6,resolution=0.107,summarize=FALSE,cores=1,
plot=FALSE,output=FALSE,filter=c(min=7,max=Inf))
  msd.track.vecdt(trackll,vecdt=NULL,resolution=0.107,output=FALSE)
  msd.perc(trackll,percentage=0.25,filter=c(min=7,max=Inf),
trimmer=c(min=1,max=31),resolution=0.107,output=FALSE)

Arguments

dt

Time intervals. Default 6.

resolution

ratio of pixel to uM.

trackll

Track list output from createTrackll().

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.

vecdt

A list containing varying dt values.

percentage

compute msd based on (tierd) percentage of its total length.

trimmer

vector used for trimming via trimTrack()

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
13
# read in using createTrackll()
folder=system.file("extdata","SWR1",package="sojourner")
trackll=createTrackll(folder=folder, input=3)

# 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=FALSE,plot=TRUE) # individual
msd2=msd(trackll.flt2,dt=6,summarize=TRUE,plot=TRUE) # summarized

snjy9182/smt-beta documentation built on April 4, 2021, 6:26 a.m.