POM {OncoSimulR} | R Documentation

## Obtain Lines of Descent and Paths of the Maximum and their diversity from simulations.

### Description

Compute Lines of Descent (LOD) and Path of the Maximum (POM) for a single simulation or a set of simulations (from `oncoSimulPop`).

`diversityPOM` and `diversityLOD` return the Shannon's diversity (entropy) of the POM and LOD, respectively, of a set of simulations (it makes no sense to compute those from a single simulation).

### Usage

    POM(x)
    LOD(x)
    diversityPOM(lpom)
    diversityLOD(llod)

### Arguments

`x` | An object of class `oncosimulpop` (version >= 2, so simulations with the old poset specification will not work) or class `oncosimul2` (a single simulation).

`lpom` | A list of POMs, as returned from `POM` on an object of class `oncosimulpop`.
`llod` | A list of LODs, as returned from `LOD` on an object of class `oncosimulpop`.

### Details

Lines of Descent (LOD) and Path of the Maximum (POM) were defined in Szendro et al. (2013) and I follow those definitions here, as applied to a process in continuous time with sampling at user-specified periods.

For POM, the results can depend strongly on how often we sample (i.e., the `sampleEvery` argument to `oncoSimulIndiv` and `oncoSimulPop`), since the POM is computed by finding the clone with largest population size whenever we sample. This also explains why it is generally meaningless to use POM on `oncoSimulSample` runs: these only keep the very last sample.

For LOD, a single LOD per simulation is returned, with the same meaning as that in p. 572 of Szendro et al. (2013). "A given genotype may undergo several episodes of colonization and extinction that are stored by the algorithm, and the last episode before the colonization of the final state is used to construct the step.", and I check that this genotype (which is the one that will become the most populated at final time) does not become extinct before the final colonization.

Note breaking changes: for LOD we used to return all lines of descent in a given simulation. In v. 2.9.1 we also returned the LOD as explained above. Now we only return the LOD as defined above.

### Value

For `POM` either a character vector (if `x` is a single simulation) or a list of character vectors. Each character vector is the ordered set of genotypes that contain the largest subpopulation at the times of sampling.

For `LOD`, if `x` is a single simulation, the line of descent as defined above (either an object of class "igraph.vs" (an igraph vertex sequence: see `vertex_attr`) or a character vector if there were no descendants). If `x` is a list (population) of simulations, then a list where each element is a list as just explained.

For `diversityLOD` and `diversityPOM` a single element vector with the Shannon's diversity (entropy) of the LODs (for `diversityLOD`) or of the POMs (for `diversityPOM`).

### Author(s)

Ramon Diaz-Uriarte

### References

Szendro, I. G., Franke, J., Visser, J. A. G. M. de, & Krug, J. (2013). Predictability of evolution depends nonmonotonically on population size. Proceedings of the National Academy of Sciences, 110(2), 571-576. https://doi.org/10.1073/pnas.1213613110

### See Also

`oncoSimulPop`, `oncoSimulIndiv`

### Examples

    ######## Using a poset for pancreatic cancer from Gerstung et al.
    ###      (s and sh are made up for the example; only the structure
    ###       and names come from Gerstung et al.)

    pancr <- allFitnessEffects(data.frame(parent = c("Root", rep("KRAS", 4), "SMAD4", "CDNK2A",
                                              "TP53", "TP53", "MLL3"),
                                          child = c("KRAS","SMAD4", "CDNK2A",
                                              "TP53", "MLL3",
                                              rep("PXDN", 3), rep("TGFBR2", 2)),
                                          s = 0.05,
                                          sh = -0.3,
                                          typeDep = "MN"))

    pancr1 <- oncoSimulIndiv(pancr, model = "Exp")
    pancr8 <- oncoSimulPop(8, pancr, model = "Exp",
                           mc.cores = 2)

    POM(pancr1)
    LOD(pancr1)

    POM(pancr8)
    LOD(pancr8)

    diversityPOM(POM(pancr8))
    diversityLOD(LOD(pancr8))

[Package OncoSimulR version 2.18.0 Index]