# The "EngineWithActivity" Class

### Description

The `EngineWithActivity`

is used to set some components in the object
of class `Engine`

to be transcriptionally inactive and transform the
expression data to appropriate logarithmic scale.

### Usage

1 2 3 4 5 |

### Arguments

`active` |
logical vector with length equal to number of components specifying whether each component should be transcriptionally active, or a numeric scalar specifying the probability for a component to be active |

`components` |
list where each element contains the parameters for the underlying distribution that the gene expression follows |

`base` |
numeric scalar specifying the logarithmic scale to which the data should be transformed |

`object` |
object of class |

`n` |
number of samples to be simulated |

`...` |
extra arguments for generic routines |

### Details

An ENGINE WITH ACTIVITY allows for the possibility that some components (or genes) in an expression engine (or tissue) might be transcriptionally inactive. Thus, the true biological signal S_gi should really be viewed as a mixture:

*S_gi = z_g * delta_0 + (1 - z_g) * T_gi*

where delta_0 = a point mass at zero; T_gi = a random variable supported on the positive real line; z_g ~ Binom(pi) defines the activity state (1 = on, 0 = off)

The `rand`

method for an EngineWithActivity is a little bit
tricky, since we do two things at once. First, we use the
`base`

slot to exponentiate the random variables generated by
the underlying Engine on the log scale. We treat `base = 0`

as
a special case, which means that we should continue to work on
the scale of the Engine. Second, we mask any inactive component
by replacing the generated values with `0`

.

Note that this is terribly inefficient if we only have a single homogeneous population, since we generate a certain amount of data only to throw it away. The power comes when we allow cancer disregulation to turn a block on or off, when the underlying data reappears.

### Value

The `EngineWithActivity`

generator returns an object of class
`EngineWithActivity`

.

The `rand`

method returns *nrow(EngineWithActivity)*n* gene
expression matrix with the inactive components being masked by `0`

.

The `summary`

method prints out the total number of components and
the number of active components in the object of `EngineWithActivity`

.

### Objects from the Class

Although objects of the class can be created by a direct call to
new, the preferred method is to use the
`EngineWithActivity`

generator function.

### Slots

`active`

:logical vector specifying whether each component should be transcriptionally active or not

`base`

:numeric scalar specifying the logarithmic scale

`components`

:list specifying the parameters of the underlying distribution

### Extends

Class `Engine`

, directly.

### Methods

- rand(object, n, ...)
Generates nrow(EngineWithActivity)*n matrix representing gene expressions of

`n`

samples, and the transcriptionally inactive components are masked by`0`

.- summary(object, ...)
Prints out the total number of components and the number of active components in the object of

`EngineWithActivity`

.

### Author(s)

Kevin R. Coombes krc@silicovore.com, Jiexin Zhang jiexinzhang@mdanderson.org, P. Roebuck proebuck@mdanderson.org

### References

OOMPA

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
showClass("EngineWithActivity")
nComponents <- 10
nGenes <- 100
active <- 0.7
comp <- list()
for (i in 1:nComponents) {
comp[[i]] <- IndependentNormal(rnorm(nGenes/nComponents, 6, 1.5),
1/rgamma(nGenes/nComponents, 44, 28))
}
myEngine <- EngineWithActivity(active, comp, 2)
summary(myEngine)
myData <- rand(myEngine, 5)
dim(myData)
``` |