Description Usage Arguments Details Objects from the Class Slots Methods Author(s) See Also Examples
The IndependentNormal
class is a tool used to generate gene
expressions that follow independent normal distribution.
1 2 3 4 5 6 7 8 9 10 11 | IndependentNormal(mu,sigma)
## S4 method for signature 'IndependentNormal'
alterMean(object, TRANSFORM, ...)
## S4 method for signature 'IndependentNormal'
alterSD(object, TRANSFORM, ...)
## S4 method for signature 'IndependentNormal'
nrow(x)
## S4 method for signature 'IndependentNormal'
rand(object, n, ...)
## S4 method for signature 'IndependentNormal'
summary(object, ...)
|
mu |
numeric vector specifying the mean expression values |
sigma |
numeric vector specifying the standard deviation of the gene expression values |
object, x |
object of class |
TRANSFORM |
function that takes a vector of mean expression or standard deviation and returns a transformed vector that can be used to alter the appropriate slot of the object. |
n |
numeric scalar specifying number of samples to be simulated |
... |
extra arguments for generic or plotting routines |
Note that we typically work on expression value with its logarithm to some appropriate base. That is, the independent normal should be used on the logarithmic scale in order to construct the engine.
Objects can be created by using the IndependentNormal
generator
function. The object of class IndependentNormal
contains the mean
and standard deviation for the normal distribution
mu
:see corresponding argument above
sigma
:see corresponding argument above
Takes an object of class
IndependentNormal
, loops over the mu
slot, alters
the mean as defined by TRANSFORM
function, and returns an
object of class IndependentNormal
with altered mu
.
Takes an object of class
IndependentNormal
, loops over the sigma
slot, alters
the standard deviation as defined by TRANSFORM
function, and
returns an object of class IndependentNormal
with altered
sigma
.
Returns the number of genes (i.e, the length of the
mu
vector).
Generates nrow(IndependentNormal)*n
matrix representing gene expressions of n
samples following the
normal distribution captured in the object of IndependentNormal
.
Prints out the number of independent normal
random variables in the object of IndependentNormal
.
Kevin R. Coombes krc@silicovore.com, Jiexin Zhang jiexinzhang@mdanderson.org,
Engine
,
IndependentLogNormal
,
MVN
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | showClass("IndependentNormal")
nGenes <- 20
mu <- rnorm(nGenes, 6, 1)
sigma <- 1/rgamma(nGenes, rate=14, shape=6)
ind <- IndependentNormal(mu, sigma)
nrow(ind)
summary(ind)
if (any(mu - ind@mu)) {
print('means do not match')
} else {
print('means verified')
}
if (any(sigma - ind@sigma)) {
print('standard deviations do not match')
} else {
print('sd verified')
}
x <- rand(ind, 3)
print(dim(x))
print(summary(x))
print(paste("'ind' should be valid:", validObject(ind)))
ind@sigma <- 1:3 # now we break it
print(paste("'ind' should not be valid:", validObject(ind, test=TRUE)))
rm(nGenes, mu, sigma, ind, x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.