data(examplePosets)
p701 <- examplePosets[["p701"]]
## Simulate and plot a single individual, including showing
## Shannon's diversity index
b1 <- oncoSimulIndiv(p701)
plot(b1, addtot = TRUE, plotDiversity = TRUE)
## A stacked area plot
plot(b1, type = "stacked", plotDiversity = TRUE)
## And what if I show a stream plot?
plot(b1, type = "stream", plotDiversity = TRUE)
## Simulate and plot 2 individuals
## (I set mc.cores = 2 to comply with --as-cran checks, but you
## should either use a reasonable number for your hardware or
## leave it at its default value).
p1 <- oncoSimulPop(2, p701, mc.cores = 2)
par(mfrow = c(1, 2))
plot(p1, ask = FALSE)
## Stacked; we cannot log here, and harder to see patterns
plot(p1, ask = FALSE, type = "stacked")
## Show individual genotypes and drivers for an
## epistasis case with at most eight genotypes
sa <- 0.1
sb <- -0.2
sab <- 0.25
sac <- -0.1
sbc <- 0.25
sv2 <- allFitnessEffects(epistasis = c("-A : B" = sb,
"A : -B" = sa,
"A : C" = sac,
"A:B" = sab,
"-A:B:C" = sbc),
geneToModule = c(
"Root" = "Root",
"A" = "a1, a2",
"B" = "b",
"C" = "c"))
evalAllGenotypes(sv2, order = FALSE, addwt = TRUE)
e1 <- oncoSimulIndiv(sv2, model = "McFL",
mu = 5e-6,
sampleEvery = 0.02,
keepEvery = 1,
initSize = 2000,
finalTime = 3000,
onlyCancer = FALSE)
## Drivers and clones
plot(e1, show = "drivers")
## Make genotypes explicit
plot(e1, show = "genotypes")
## Oh, but I want other colors
plot(e1, show = "genotypes", col = rainbow(8))
## and actually I want a line plot
plot(e1, show = "genotypes", type = "line")
Run the code above in your browser using DataLab