RtreemixSim-class {Rtreemix} | R Documentation

## Class "RtreemixSim"

### Description

This class contains data simulated from the `RtreemixModel` it extends together with their sampling and waiting times. It also includes the sampling mode and the sampling parameter used for the time simulation.

### Objects from the Class

Objects can be created by calls of the form `new("RtreemixSim", Model, SimPatterns, SamplingMode, SamplingParam, WaitingTimes, SamplingTimes)`. The `RtreemixSim` class specifies patterns (`RtreemixData`) simulated from the parent `RtreemixModel` together with their waiting and sampling times resulting from the waiting time simulation along the branchings in the parent model.

The `Model` is an `RtreemixModel` object used in the data and time simulation process. In other words, this model is used for simulating patterns with their sampling and waiting times.

The `SimPatterns` is an `RtreemixData` object that contains the patterns simulated from the given `Model`.

The `SamplingMode` is a `character` that specifies the sampling mode ("constant" or "exponential") used in the time simulations.

The `SamplingParam` is a `numeric` that specifies the sampling parameter corresponding to the sampling mode given by `SamplingMode`.

The `WaitingTimes` is a numeric `vector` that specifies the waiting times for the simulated patterns. Its length equals the number of patterns in `SimPatterns`.

The `SamplingTimes` is a numeric `vector` that specifies the sampling times for the simulated patterns. Its length equals the number of patterns in `SimPatterns`.

### Slots

`SimPatterns`:
  Object of class `"RtreemixData"`.
`SamplingMode`:
  Object of class `"character"`. It can have one of the two possible values: "constant" or "exponential".
`SamplingParam`:
  Object of class `"numeric"`.
`WaitingTimes`:
  Object of class `"numeric"`. The length of `WaitingTimes` must be equal to the number of patterns in `SimPatterns`.
`SamplingTimes`:
  Object of class `"numeric"`. The length of `SamplingTimes` must be equal to the number of patterns in `SimPatterns`.

### Extends

Class `"RtreemixModel"`, directly. Class `"RtreemixData"`, by class "RtreemixModel", distance 2.

### Methods

SamplingMode
  `signature(object = "RtreemixSim")`: A method for obtaining the sampling mode ("constant" or "exponential") used for the time simulations.
SamplingParam
  `signature(object = "RtreemixSim")`: A method for obtaining the sampling parameter corresponding to the specified `SamplingMode`.
SamplingTimes
  `signature(object = "RtreemixSim")`: A method used for obtaining the sampling times of the patterns in `SimPatterns`.
SimPatterns
  `signature(object = "RtreemixSim")`: A method used for obtaining the patterns simulated from the parent model.
WaitingTimes
  `signature(object = "RtreemixSim")`: A method used for obtaining the waiting times of the patterns in `SimPatterns`.
getModel
  `signature(object = "RtreemixSim")`: A method for obtaining the mixture model used in the simulations.
noDraws
  `signature(object = "RtreemixSim")`: A method for obtaining the number of simulated patterns, i.e. the size of `SimPatterns`.

### Author(s)

Jasmina Bogojeska

### References

Learning multiple evolutionary pathways from cross-sectional data, N. Beerenwinkel et al.

### See Also

`RtreemixGPS-class`, `RtreemixData-class`, `RtreemixModel-class`, `fit-methods`, `sim-methods`

### Examples

    ## Generate a random RtreemixModel object with 3 components and 9 genetic events.
    rand.mod <- generate(K = 3, no.events = 9, noise.tree = TRUE, prob = c(0.2, 0.8))
    show(rand.mod)

    ## Create an RtreemixSim object by simulating patterns with their sampling and waiting times from a given mixture model.
    sim.data <- sim(model = rand.mod, sampling.mode = "exponential", sampling.param = 1, no.sim = 200)
    show(sim.data)

    ## See the slots from the RtreemixSim object.
    SimPatterns(sim.data)
    SamplingMode(sim.data)
    SamplingParam(sim.data)
    WaitingTimes(sim.data)
    SamplingTimes(sim.data)
    ## See model.
    getModel(sim.data)
    ## See number of simulated patterns.
    noDraws(sim.data)

[Package Rtreemix version 1.6.0 Index]