DeCovarT MLE of cellular proportions for one bulk sample
Source:R/03_01_first_generation_deconvolution.R, R/03_03_DeCovarT_estimate_ratios_frequentist.R
deconvolute_ratios_Marquardt_Levenberg.RdEstimates
\(\hat{\boldsymbol{p}}=\arg\max_{\boldsymbol{p}}
\ell_{\boldsymbol{y}\,|\,\boldsymbol{\zeta}}(\boldsymbol{p})\) under the
Gaussian convolution model
$$
\boldsymbol{y}\,|\,(\boldsymbol{\zeta},\boldsymbol{p})
\sim\mathcal{N}_{G}\!\bigl(\boldsymbol{\mu}\boldsymbol{p},\,
\boldsymbol{\Sigma}(\boldsymbol{p})\bigr),
\qquad
\boldsymbol{\Sigma}(\boldsymbol{p})=\sum_{j=1}^{J}p_j^{2}\boldsymbol{\Sigma}_j,
$$
subject to the simplex constraint
\(\mathbf{1}^{\mathsf{T}}\boldsymbol{p}=1\), \(\boldsymbol{p}\ge\mathbf{0}\).
Optimisation is performed in unconstrained coordinates
\(\boldsymbol{\rho}\in\mathbb{R}^{J-1}\) via
\(\boldsymbol{p}=\boldsymbol{\psi}(\boldsymbol{\rho})\)
(Marquardt–Levenberg default; see other methods below and
vignette("softmax-alr-derivatives", package = "DeCovarT")).
Usage
deconvolute_ratios_cibersort(y, mean_signature_matrix)
deconvolute_ratios_lsfit(y, mean_signature_matrix)
deconvolute_ratios_rlm(y, mean_signature_matrix)
deconvolute_ratios_nnls(y, mean_signature_matrix)
deconvolute_ratios_deconrnaseq(y, mean_signature_matrix)
deconvolute_ratios_Marquardt_Levenberg(
y,
mean_signature_matrix,
Sigma,
epsilon = 10^-4,
itmax = 200
)
deconvolute_ratios_simulated_annealing(
y,
mean_signature_matrix,
Sigma,
epsilon = 10^-4,
itmax = 200
)
deconvolute_ratios_L_BFGS_B(
y,
mean_signature_matrix,
Sigma,
epsilon = 10^-4,
itmax = 200
)
deconvolute_ratios_Newton_Raphson(
y,
mean_signature_matrix,
Sigma,
epsilon = 10^-4,
itmax = 200
)
deconvolute_ratios_gradient_descent(
y,
mean_signature_matrix,
Sigma,
epsilon = 10^-4,
itmax = 200
)Arguments
- y
Bulk expression vector \(\boldsymbol{y}\in\mathbb{R}^{G}\) (one heterogeneous sample).
- mean_signature_matrix
Mean signature \(\boldsymbol{\mu}\in\mathcal{M}_{G\times J}\) (columns = cell types; plug-in for latent profiles).
- Sigma
Array \((\boldsymbol{\Sigma}_j)_{j=1}^{J}\in\mathcal{M}_{G\times G\times J}\) of cell-type covariances.
- epsilon, itmax
Absolute convergence tolerance and maximum number of iterations for the optimiser.
Value
Named numeric vector \(\hat{\boldsymbol{p}}\) on the simplex.
Benchmark metrics are computed by deconvolute_ratios().
Details
Plug-in signature. Argument mean_signature_matrix is the mean
\(\boldsymbol{\mu}\), used as a proxy for the unobserved cell-type
profiles \(\boldsymbol{x}_{\cdot j}\). This is the frequentist plug-in;
recovering sample-specific latents is a Bayesian / MAP problem
(.map_gaussian_convolution()).
Functions
deconvolute_ratios_cibersort(): Linear baseline \(\hat{\boldsymbol{y}}=\boldsymbol{\mu}\hat{\boldsymbol{p}}\) via nu-SVR (CIBERSORT-style); no covariance prior is used.deconvolute_ratios_lsfit(): Ordinary least squares for \(\boldsymbol{y}\approx\boldsymbol{\mu}\boldsymbol{p}\) (stats::lsfit()), following Abbas et al. (2009) ; estimates are projected back onto the simplex.deconvolute_ratios_rlm(): Robust linear model \(\boldsymbol{y}\approx\boldsymbol{\mu}\boldsymbol{p}\) (MASS::rlm()), as in Monaco et al. (2019) .deconvolute_ratios_nnls(): Non-negative least squares for \(\boldsymbol{y}\approx\boldsymbol{\mu}\boldsymbol{p}\) (nnls::nnls()), then simplex projection.deconvolute_ratios_deconrnaseq(): Equality- and inequality-constrained least squares on the simplex (limSolve::lsei()), in the spirit ofdeconRNASeq.deconvolute_ratios_simulated_annealing(): Simulated annealing on \(\boldsymbol{\rho}\) (stats::optim()withmethod = "SANN").deconvolute_ratios_L_BFGS_B(): Box-constrained L-BFGS-B directly in \(\boldsymbol{p}\) (stats::optim()method = "L-BFGS-B").deconvolute_ratios_Newton_Raphson(): Newton–Raphson /nlminbon \(\boldsymbol{\rho}\) using analytic gradient and Hessian (stats::nlminb()).deconvolute_ratios_gradient_descent(): BFGS quasi-Newton ascent on \(\boldsymbol{\rho}\) (stats::optim()method = "BFGS").
References
Abbas AR, Wolslegel K, Seshasayee D, Modrusan Z, Clark HF (2009).
“Deconvolution of Blood Microarray Data Identifies Cellular Activation Patterns in Systemic Lupus Erythematosus.”
PloS One, 4.
doi:10.1371/journal.pone.0006098
.
Monaco G, Lee B, Xu W, Mustafah S, Hwang YY, Carré C, Burdin N, Visan L, Ceccarelli M, Poidinger M, Zippelius A, Pedro de Magalhães J, Larbi A (2019).
“RNA-Seq Signatures Normalized by mRNA Abundance Allow Absolute Deconvolution of Human Immune Cell Types.”
Cell Reports, 26.
doi:10.1016/j.celrep.2019.01.041
.
Examples
set.seed(1)
genes <- paste0("g", 1:2)
cts <- paste0("ct", 1:2)
mu <- matrix(c(20, 22, 22, 20), nrow = 2, dimnames = list(genes, cts))
Sigma <- array(
c(1, 0, 0, 1, 1, 0, 0, 1),
dim = c(2, 2, 2),
dimnames = list(genes, genes, cts)
)
y <- drop(mu %*% c(0.6, 0.4) + rnorm(2, sd = 0.1))
deconvolute_ratios_Marquardt_Levenberg(y, mu, Sigma, itmax = 50)
#> ct1 ct2
#> 0.5605665 0.4394335