Provides tools to create a CancerEngine with block correlation structure. Also makes it possible to simulate paired clinical and gene expression data with this block structure.
1 2 3 4 5 6 7 8 9 10 11  BlockHyperParameters(nExtraBlocks=100,
meanBlockSize=100,
sigmaBlockSize=30,
minBlockSize=5,
mu0=6,
sigma0=1.5,
rate=28.11,
shape=44.25,
p.cor=0.6,
wt.cor=5)
makeBlockStructure(cm, hyperp, xform=normalOffset, ...)

cm 
object of class 
hyperp 
object of class 
nExtraBlocks 
integer scalar specifying number of blocks not
involved in the "hit" structure defined by the 
meanBlockSize 
numeric scalar specifying mean number of genes in a correlated block 
sigmaBlockSize 
numeric scalar specifying standard deviation of the number of genes in a correlated block 
minBlockSize 
integer scalar specifying minimal number of genes in a correlated block 
mu0 
numeric scalar specifying expected mean expression level of a gene on the log scale 
sigma0 
numeric scalar specifying standard deviation of the mean expression level of a gene on the log scale 
rate 
numeric scalar specifying one of the gamma parameters 
shape 
numeric scalar specifying one of the gamma parameters 
p.cor 
numeric scalar specifying expected correlation within each block 
wt.cor 
numeric scalar specifying weight given to the expected block correlation 
xform 
A function that will be passed to the 
... 
extra arguments that wil be passed back to the

Our standard model for gene expression in a homogeneous sample assumes
that the overall correlation matrix is block diagonal. Correlation
between genes in different blocks is assumed to be zero. Correlation
for genes in the same block is assumed to be a constant, but different
correlation constants can be used in different blocks. The actual
correlations are assumed to arise from a beta distribution of the form
Beta(pw, (1p)w), where p=p.cor
and w=wt.cor
are two of the
hyperparameters.
The number of blocks is determined jointly by the CancerModel
,
cm
, and the hyperparameter nExtraBlocks
. The size of a
block is assumed to arise from a normal distribution with mean given
by meanBlockSize
and standard deviaion given by
sigmaBlockSize
. To avoid accidentally assigning nonpostive
block sizes, this distribution is truncated below by
minBlockSize
.
The expression of each gene is assumed to come from a lognor,mal
distribution with parameters describing the pergene mean (μ_g)
and standard deviation (σ_g) n the log scale. These
parameters, in turn, are assumed to come from hyperdistributions.
Specifically, we assume that μ_g comes from a normal distribution
with mean mu0
and standard deviation sigma0
. We also
assume that σ_g comes from an inverse gamma distribution with
parameters rate
and shape
.
The BlockHyperParameters
class simpy bundles the parameters for
this model into a single structure. The default values are consistent
with data we have seen from several Affymetrix microarray studies.
The makeBlockStructure
function takes a CancerModel
and
a BlockHyperParameters
object as arguments and produces a
CancerEngine
object. The rand
method for
this class can be used to generate matched clinical data (with the
structure defined by the CancerModel
object) and gene
expression data with the specified block correlation structure.
The BlockHyperParameters
generator returns an object of class
BlockHyperParameters
.
The function makeBlockStructure
returns an object of the
CancerEngine
class.
Although objects of the class can be created by a direct call to
new, the preferred method is to use the
BlockHyperParameters
generator function.
nExtraBlocks
:An integer; the number of blocks not involved in
the "hit" structure defined by the CancerModel
.
meanBlockSize
:A real number; the mean number of genes in a correlated block.
sigmaBlockSize
:A real number; standard deviation of the number of genes in a correlated block.
minBlockSize
:An integer; the minimal number of genes in a correlated block.
mu0
:A real number; the expected mean expression level of a gene on the log scale.
sigma0
:A real number; the standard deviation of the mean expression level of a gene on the log scale.
rate
:Gamma parameter; see details.
shape
:Gamma parameter; see details.
p.cor
:A real number; the expected correlation within each block.
wt.cor
:A real number; the weight given to the expected block correlation.
There are no special methods defind for this class.
Kevin R. Coombes krc@silicovore.com, P. Roebuck proebuck@mdanderson.org
OOMPA
1 2 3 4 5 6 7 8 9  showClass("BlockHyperParameters")
sm < SurvivalModel(baseHazard=1/3, units=52, unitName="weeks")
cm < CancerModel("myModel", nPossible=10, nPattern=5,
survivalModel=sm)
hyper < BlockHyperParameters()
engine < makeBlockStructure(cm, hyper)
outcome < rand(engine, 100)
summary(outcome$clinical)
dim(outcome$data)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.