estimate.delay computes the delay/time shift between two gene expression profiles contained in dataset. It returns a list with one or two estimated time shifts and their associated correlation. By default the function also returns a plot composed of four panels which show in more details how these estimate were obtained. This can help the user finding the appropriate parameter values to be used with the TDCOR main function. For more details see below.
estimate.delay(dataset, tar, reg, times, time_step, thr_cor, tol,
delaymax, delayspan, ...)delayspan was set to 12 hours).
make.graph: A boolean. Set to FALSE to prevent the function from generating a graph.
tar.name: A string. "Everyday name" of the target. This name will be used in the plots instead of the default value (gene code).
reg.name: A string. "Everyday name" of the regulator. This name will be used in the plots instead of the default value (gene code).
main: A string. Main title of the plot. By default the title of the plot is automatically generated from tar.name and reg.name.
The function automatically guess the sign of the potential interaction (stimulatory or inhibitory) and adapt the analysis based on it. The sign of the potential interaction is indicated in the main title of the graph by (+) or (-). When both types of interaction are possible, the function generates two graphs (one for each sign).
The function returns by default a graph composed of four panels. The top panel shows the spline functions of the two normalised expression profiles with respect to time. The second panel consists of the plots of the F1 and F2 functions with respect to the time shift (mu). The third one is for the F3 and F4 functions. All of these four functions aim at estimating the time shift between the two expression profiles by minimizing a distance-like measurement. But they each do it in a slightly different manner. F1 and F3 use Pearson's correlation as a measure of distance while F2 and F4 use the sum of squares. Moreover F1 and F2 measure the distances directly between the spline functions while F3 and F4 do it between the first derivatives of these functions. The vertical red and purple lines in the second and third panel indicate the position of the respective maximum or minimum of the functions. In the fourth and last panel, the final score function is plotted. This score is computed for each possible time shift analysed by combining the four above-mentionned functions. The green horizontal line indicate the position of the tolerance threshold (tol) above which time shift estimates are rejected. The vertical dark grey line(s) represent(s) the position of the final estimated time shift(s). All these lines necessarily fall into regions where the score function is below the threshold (painted in light green). Other vertical light grey line(s) may indicate other time shift estimate(s) that have a score above the tolerance threshold and were therefore rejected.
# Load the data
data(LR_dataset)
data(l_genes)
data(l_names)
data(times)
# Estimate the time shift between LBD16 and PUCHI (one time shift estimate returned)
estimate.delay(dataset=LR_dataset, tar=l_genes[which(l_names=="PUCHI")],
reg=l_genes[which(l_names=="LBD16")], times=times, time_step=1, thr_cor=0.7,
tol=0.15, delaymax=3, delayspan=12, reg.name="LBD16",tar.name="PUCHI")
# Estimate the time shift between ARF8 and PLT1 (two time shift estimates returned)
estimate.delay(dataset=LR_dataset, tar=l_genes[which(l_names=="PLT1")],
reg=l_genes[which(l_names=="ARF8")], times=times, time_step=1, thr_cor=0.7,
tol=0.15, delaymax=3, delayspan=12, reg.name="ARF8",tar.name="PLT1")
Run the code above in your browser using DataLab