directionalVariation: Directional variation

Description Usage Arguments Examples

Description

Calculate the Evolvability and Conditional evolvability in the direction of selection.

Usage

1
directionalVariation(cov.matrix, line, delta_Z, Wmat = cov.matrix)

Arguments

cov.matrix

covariance matrix

line

current line

delta_Z

direction in phenotype space

Wmat

optional fixed matrix for selection gradient reconstruction

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
delta_Z = colMeans(dplyr::select(ratonesdf[ratonesdf$selection == "upwards",], IS_PM:BA_OPI)) -
          colMeans(dplyr::select(ratonesdf[ratonesdf$selection == "downwards",], IS_PM:BA_OPI))
## Not run: 
# this can take a while
library(doMC)
registerDoMC(5)
p_directional_stats <- ldply(ratones_models, function(model) adply(model$Ps, 1,
                                                                   directionalVariation,
                                                                   model$line,
                                                                   delta_Z), .parallel = TRUE)
DzPC1 = densityPlot(p_directional_stats, "DZpc1",
                    expression(paste("Vector correlation of ", delta, "z and E1")))
evolDZ = densityPlot(p_directional_stats, "evolDZ", "Scaled directional\n evolvability") +
           theme(legend.position = "none", text = element_text(size = 20))
condevolDZ = densityPlot(p_directional_stats, "condevolDZ",
                         "Scaled directional\n conditional evolvability") +
               theme(legend.position = "none", text = element_text(size = 20))
figure_4 <- ggdraw() + draw_plot(evolDZ, 0, 0.5, 0.5, 0.5) +
 draw_plot(condevolDZ, 0.5, 0.5, 0.5, 0.5) + draw_plot(DzPC1, 0.2, 0, 0.5, 0.5) +
 draw_plot_label(c("A", "B", "C"), c(0, 0.5, 0.2), c(1, 1, 0.5), size = 20)
 
## End(Not run)

diogro/ratones documentation built on May 24, 2019, 4:01 a.m.