# A three-gene epistasis example
sa <- 0.1
sb <- 0.15
sc <- 0.2
sab <- 0.3
sbc <- -0.25
sabc <- 0.4
sac <- (1 + sa) * (1 + sc) - 1
E3A <- allFitnessEffects(epistasis =
c("A:-B:-C" = sa,
"-A:B:-C" = sb,
"-A:-B:C" = sc,
"A:B:-C" = sab,
"-A:B:C" = sbc,
"A:-B:C" = sac,
"A : B : C" = sabc)
)
evalAllGenotypes(E3A, order = FALSE, addwt = FALSE)
evalAllGenotypes(E3A, order = FALSE, addwt = TRUE, model = "Bozic")
evalGenotype("B, C", E3A, verbose = TRUE)
## Order effects and modules
ofe2 <- allFitnessEffects(orderEffects = c("F > D" = -0.3, "D > F" = 0.4),
geneToModule =
c("Root" = "Root",
"F" = "f1, f2, f3",
"D" = "d1, d2") )
evalAllGenotypes(ofe2, max = 325)[1:15, ]
## Next two are identical
evalGenotype("d1 > d2 > f3", ofe2, verbose = TRUE)
evalGenotype("d1 , d2 , f3", ofe2, verbose = TRUE)
## This is different
evalGenotype("f3 , d1 , d2", ofe2, verbose = TRUE)
## but identical to this one
evalGenotype("f3 > d1 > d2", ofe2, verbose = TRUE)
## Restrictions in mutations as a graph. Modules present.
p4 <- data.frame(parent = c(rep("Root", 4), "A", "B", "D", "E", "C", "F"),
child = c("A", "B", "D", "E", "C", "C", "F", "F", "G", "G"),
s = c(0.01, 0.02, 0.03, 0.04, 0.1, 0.1, 0.2, 0.2, 0.3, 0.3),
sh = c(rep(0, 4), c(-.9, -.9), c(-.95, -.95), c(-.99, -.99)),
typeDep = c(rep("--", 4),
"XMPN", "XMPN", "MN", "MN", "SM", "SM"))
fp4m <- allFitnessEffects(p4,
geneToModule = c("Root" = "Root", "A" = "a1",
"B" = "b1, b2", "C" = "c1",
"D" = "d1, d2", "E" = "e1",
"F" = "f1, f2", "G" = "g1"))
evalAllGenotypes(fp4m, order = FALSE, max = 1024, addwt = TRUE)[1:15, ]
evalGenotype("b1, b2, e1, f2, a1", fp4m, verbose = TRUE)
## Of course, this is identical; b1 and b2 are same module
## and order is not present here
evalGenotype("a1, b2, e1, f2", fp4m, verbose = TRUE)
evalGenotype("a1 > b2 > e1 > f2", fp4m, verbose = TRUE)
## We can use the exact same integer numeric id codes as in the
## fitnessEffects geneModule component:
evalGenotype(c(1L, 3L, 7L, 9L), fp4m, verbose = TRUE)
Run the code above in your browser using DataCamp Workspace