Unmixes samples in
x according to
using numerical optimization. The components in
are added on the scale of gene expression (either normalized counts, or TPMs).
The loss function when comparing fitted expression to the
x occurs in a variance stabilized space.
This task is sometimes referred to as "deconvolution",
and can be used, for example, to identify contributions from
Note: some groups have found that the mixing contributions
may be more accurate if very lowly expressed genes across
pure are first removed. We have not explored this fully.
Note: if the
pbapply package is installed a progress bar
will be displayed while mixing components are fit.
normalized counts or TPMs of the samples to be unmixed
normalized counts or TPMs of the "pure" samples
for normalized counts, the dispersion of the data
when a negative binomial model is fit. this can be found by examining
the asymptotic value of
for TPMs, the shift which approximately stabilizes the variance
of log shifted TPMs. Can be assessed with
either 1 (for L1) or 2 (for squared) loss function. Default is 1.
suppress progress bar. default is FALSE, show progress bar if pbapply is installed.
a matrix, the mixture components for each sample in
The "pure" samples make up the columns, and so each row sums to 1.
If colnames existed on the input matrices they will be propagated to the output matrix.
format="list", then a list, containing as elements:
(1) the matrix of mixture components,
(2) the correlations in the variance stabilized space of the fitted samples
to the samples in
(3) the fitted samples as a matrix with the same dimension as
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# some artificial data cts <- matrix(c(80,50,1,100, 1,1,60,100, 0,50,60,100), ncol=4, byrow=TRUE) # make a DESeqDataSet dds <- DESeqDataSetFromMatrix(cts, data.frame(row.names=seq_len(ncol(cts))), ~1) colnames(dds) <- paste0("sample",1:4) # note! here you would instead use # estimateSizeFactors() to do actual normalization sizeFactors(dds) <- rep(1, ncol(dds)) norm.cts <- counts(dds, normalized=TRUE) # 'pure' should also have normalized counts... pure <- matrix(c(10,0,0, 0,0,10, 0,10,0), ncol=3, byrow=TRUE) colnames(pure) <- letters[1:3] # for real data, you need to find alpha after fitting estimateDispersions() mix <- unmix(norm.cts, pure, alpha=0.01)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.