Description Usage Arguments Details Value Note Author(s) References See Also Examples
Given one or more of a set of poset restrictions, epistatic interactions, order effects, and genes without interactions, as well as, optionally, a mapping of genes to modules, return the complete fitness specification.
For mutator effects, given one or more of a set of epistatic interactions and genes without interactions, as well as, optionally, a mapping of genes to modules, return the complete specification of how mutations affect the mutation rate.
The output of these functions is not intended for user consumption, but as a way of preparing data to be sent to the C++ code.
1 2 3 4 5 6 7 |
rT |
A restriction table that is an extended version of a poset
(see
|
epistasis |
A named numeric vector. The names identify the relationship, and the numeric value is the fitness (or mutator) effect. For the names, each of the genes or modules involved is separated by a ":". A negative sign denotes the absence of that term. |
orderEffects |
A named numeric vector, as for |
noIntGenes |
A numeric vector (optionally named) with the fitness coefficients (or mutator multiplier factor) of genes (only genes, not modules) that show no interactions. These genes cannot be part of modules. But you can specify modules that have no epistatic interactions. See examples and vignette. Of course, avoid using potentially confusing characters in the names. In particular, "," and ">" are not allowed as gene names. |
geneToModule |
A named character vector that allows to match genes and modules. The
names are the modules, and each of the values is a character vector
with the gene names, separated by a comma, that correspond to a
module. Note that modules cannot share genes. There is no need for
modules to contain more than one gene. If you specify a geneToModule
argument, and you used a restriction table, the |
drvNames |
The names of genes that are considered drivers. This is
only used for: a) deciding when to stop the simulations, in case you
use number of drivers as a simulation stopping criterion (see
|
genotFitness |
A matrix or data frame that contains explicitly the mapping of genotypes to fitness. For now, we only allow epistasis-like relations between genes (so you cannot code order effects this way). Genotypes can be specified in two ways:
In all cases, fitness must be |
keepInput |
If TRUE, whether to keep the original input. This is only useful for human consumption of the output. It is useful because it is easier to decode, say, the restriction table from the data frame than from the internal representation. But if you want, you can set it to FALSE and the object will be a little bit smaller. |
allFitnessEffects
is used for extremely flexible specification of fitness
and mutator effects, including posets, XOR relationships, synthetic mortality and
synthetic viability, arbitrary forms of epistatis, arbitrary forms of
order effects, etc. Please, see the vignette for detailed and
commented examples.
allMutatorEffects
provide the same flexibility, but without
order and posets (this might be included in the future, but I have
seen no empirical or theoretical argument for their existence or
relevance as of now, so I do not add them to minimize unneeded complexity).
If you use both for simulations in the same call to, say,
oncoSimulIndiv
, all the genes specified in
allMutatorEffects
MUST be included in the
allFitnessEffects
object. If you want to have genes that have
no direct effect on fitness, but that affect mutation rate, you MUST
specify them in the call to allFitnessEffects
, for instance as
noIntGenes
with an effect of 0.
If you use genotFitness
then you cannot pass modules,
noIntgenes, epistasis, or rT. This makes sense, because using
genotFitness
is saying
"this is the mapping of genotypes to fitness. Period", so we should
not allow further modifications from other terms.
If you use genotFitness
you need to be careful when you use
Bozic's model (as you get a death rate of 0).
If you use genotFitness
note that we force the WT (wildtype) to
always be 1 so fitnesses are rescaled.
An object of class "fitnessEffects" or "mutatorEffects". This is just a list, but it is not intended for human consumption. The components are:
long.rt |
The restriction table in "long format", so as to be easy to parse by the C++ code. |
long.epistasis |
Ditto, but for the epistasis specification. |
long.orderEffects |
Ditto for the order effects. |
long.geneNoInt |
Ditto for the non-interaction genes. |
geneModule |
Similar, for the gene-module correspondence. |
graph |
An |
drv |
The numeric identifiers of the drivers. The numbers correspond to the internal numeric coding of the genes. |
rT |
If |
epistasis |
If |
orderEffects |
If |
noIntGenes |
If |
Please, note that the meaning of the fitness effects in the McFarland model is not the same as in the original paper; the fitness coefficients are transformed to allow for a simpler fitness function as a product of terms. This differs with respect to v.1. See the vignette for details.
The names of the genes and modules can be fairly arbitrary. But if you try hard you can confuse the parser. For instance, using gene or module names that contain "," or ":", or ">" is likely to get you into trouble. Of course, you know you should not try to use those characters because you know those characters have special meanings to separate names or indicate epistasis or order relationships. Right now, using those characters as names is caught (and result in stopping) if passed as names for noIntGenes.
Ramon Diaz-Uriarte
Diaz-Uriarte, R. (2015). Identifying restrictions in the order of accumulation of mutations during tumor progression: effects of passengers, evolutionary models, and sampling http://www.biomedcentral.com/1471-2105/16/41/abstract
McFarland, C.~D. et al. (2013). Impact of deleterious passenger mutations on cancer progression. Proceedings of the National Academy of Sciences of the United States of America\/, 110(8), 2910–5.
evalGenotype
, oncoSimulIndiv
,
plot.fitnessEffects
,
evalGenotypeFitAndMut
,
rfitness
,
plotFitnessLandscape
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | ## A simple poset or CBN-like example
cs <- data.frame(parent = c(rep("Root", 4), "a", "b", "d", "e", "c"),
child = c("a", "b", "d", "e", "c", "c", rep("g", 3)),
s = 0.1,
sh = -0.9,
typeDep = "MN")
cbn1 <- allFitnessEffects(cs)
plot(cbn1)
## A more complex example, that includes a restriction table
## order effects, epistasis, genes without interactions, and moduels
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"))
oe <- c("C > F" = -0.1, "H > I" = 0.12)
sm <- c("I:J" = -1)
sv <- c("-K:M" = -.5, "K:-M" = -.5)
epist <- c(sm, sv)
modules <- c("Root" = "Root", "A" = "a1",
"B" = "b1, b2", "C" = "c1",
"D" = "d1, d2", "E" = "e1",
"F" = "f1, f2", "G" = "g1",
"H" = "h1, h2", "I" = "i1",
"J" = "j1, j2", "K" = "k1, k2", "M" = "m1")
set.seed(1) ## for repeatability
noint <- rexp(5, 10)
names(noint) <- paste0("n", 1:5)
fea <- allFitnessEffects(rT = p4, epistasis = epist, orderEffects = oe,
noIntGenes = noint, geneToModule = modules)
plot(fea)
## Modules that show, between them,
## no epistasis (so multiplicative effects).
## We specify the individual terms, but no value for the ":".
fnme <- allFitnessEffects(epistasis = c("A" = 0.1,
"B" = 0.2),
geneToModule = c("A" = "a1, a2",
"B" = "b1"))
evalAllGenotypes(fnme, order = FALSE, addwt = TRUE)
## Epistasis for fitness and simple mutator effects
fe <- allFitnessEffects(epistasis = c("a : b" = 0.3,
"b : c" = 0.5),
noIntGenes = c("e" = 0.1))
fm <- allMutatorEffects(noIntGenes = c("a" = 10,
"c" = 5))
evalAllGenotypesFitAndMut(fe, fm, order = FALSE)
## Simple fitness effects (noIntGenes) and modules
## for mutators
fe2 <- allFitnessEffects(noIntGenes =
c(a1 = 0.1, a2 = 0.2,
b1 = 0.01, b2 = 0.3, b3 = 0.2,
c1 = 0.3, c2 = -0.2))
fm2 <- allMutatorEffects(epistasis = c("A" = 5,
"B" = 10,
"C" = 3),
geneToModule = c("A" = "a1, a2",
"B" = "b1, b2, b3",
"C" = "c1, c2"))
evalAllGenotypesFitAndMut(fe2, fm2, order = FALSE)
## Passing fitness directly, a complete fitness specification
## with a two column data frame with genotypes as character vectors
(m4 <- data.frame(G = c("A, B", "A", "WT", "B"), F = c(3, 2, 1, 4)))
fem4 <- allFitnessEffects(genotFitness = m4)
## Verify it interprets what it should: m4 is the same as the evaluation
## of the fitness effects (note row reordering)
evalAllGenotypes(fem4, addwt = TRUE, order = FALSE)
## Passing fitness directly, a complete fitness specification
## that uses a three column matrix
m5 <- cbind(c(0, 1, 0, 1), c(0, 0, 1, 1), c(1, 2, 3, 5.5))
fem5 <- allFitnessEffects(genotFitness = m5)
## Verify it interprets what it should: m5 is the same as the evaluation
## of the fitness effects
evalAllGenotypes(fem5, addwt = TRUE, order = FALSE)
## Passing fitness directly, an incomplete fitness specification
## that uses a three column matrix
m6 <- cbind(c(1, 1), c(1, 0), c(2, 3))
fem6 <- allFitnessEffects(genotFitness = m6)
evalAllGenotypes(fem6, addwt = TRUE, order = FALSE)
## Plotting a fitness landscape
fe2 <- allFitnessEffects(noIntGenes =
c(a1 = 0.1,
b1 = 0.01,
c1 = 0.3))
plot(evalAllGenotypes(fe2, order = FALSE))
## same as
plotFitnessLandscape(evalAllGenotypes(fe2, order = FALSE))
## same as
plotFitnessLandscape(fe2)
###### Defaults for missing genotypes
## As a two-column data frame
(m8 <- data.frame(G = c("A, B, C", "B"), F = c(3, 2)))
evalAllGenotypes(allFitnessEffects(genotFitness = m8), addwt = TRUE)
## As a matrix
(m9 <- rbind(c(0, 1, 0, 1, 4), c(1, 0, 1, 0, 1.5)))
evalAllGenotypes(allFitnessEffects(genotFitness = m9), addwt = TRUE)
## Reinitialize the seed
set.seed(NULL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.