The S4 generic function mixData
extract mixture
data from an object, i.e. information on its underlying
constituents/components. For example, for gene expression
deconvolution, the CellMix stores such data as an
NMFstd-class
model object.
The function mixData<-
assign mixture data onto
objects.
mixData(object, ...) mixData(object) <- value
ExpressionMix
objects, this will be an
object of class NMFstd-class
.signature(object =
"ExpressionMix")
: Extracts mixture data from an
ExpressionMix
object.
Because ExpressionMix-class
inherits from
linkS4class{NMFstd}
, this methods simply returns
the the object coerced as an NMFstd
object.
signature(object =
"ExpressionMix", value = "NMFstd")
: Sets mixture data in
an ExpressionMix object.
Because ExpressionMix-class
inherits from
linkS4class{NMFstd}
, this method simply copies all
slots in value
in into the corresponding slots in
object
, and then checks that the result object is
valid.
e <- ExpressionMix(rmatrix(10,5))
e
## ExpressionMix (storageMode: lockedEnvironment)
## assayData: 10 features, 5 samples
## element names: exprs
## protocolData: none
## phenoData: none
## featureData: none
## experimentData: use 'experimentData(object)'
## Annotation:
## Composition: none
# the mixture data is stored as an NMF model
mixData(e)
## <Object of class:NMFstd>
## features: 10
## basis/rank: 0
## samples: 5
# assign a random mixture data with 5 cell types
m <- rnmf(3, e)
# ensure proportions sum-up to one
coef(m) <- scoef(m)
mixData(e) <- m