Skip to contents

Main deconvolution function

Top-level function to deconvolve a matrix of bulk expression samples using any combination of deconvolution algorithms in parallel.

deconvolute_ratios()
Parallel deconvolution of a bulk expression matrix

DeCovarT algorithm

Covariance-aware optimisation of cellular ratios under a multivariate Gaussian convolution model.

Score equations and simplex maps

Analytic first- and second-order helpers for the unconstrained and ILR-constrained log-likelihood (Helmert basis; Jacobian / Hessian of the isometric logistic map; gradients and Hessians of ()). Additive log-ratio maps are kept for the vignette appendix. Documented for ? / source inspection; see also vignette("theory-decovart-generative-model").

helmert_basis()
Helmert contrast matrix for isometric log-ratio coordinates
isometric_logistic() isometric_log_ratio()
Isometric logistic transform (ILR coordinates to the simplex)
jacobian_isometric_logistic()
Jacobian of the isometric logistic map
hessian_isometric_logistic()
Hessian tensor of the isometric logistic map
starting_simplex()
Open-simplex start for ILR solvers
additive_logistic() additive_log_ratio()
Additive logistic transform (unconstrained coordinates to the simplex)
jacobian_additive_logistic()
Jacobian \(\mathbf{J}_{\boldsymbol{\psi}}\) of the additive logistic map
hessian_additive_logistic()
Second derivatives (Hessian tensor) of the additive logistic map
gradient_loglik_unconstrained()
Gradient \(\nabla_{\boldsymbol{p}}\ell\) of the unconstrained log-likelihood
hessian_loglik_unconstrained()
Hessian \(\mathbf{H}\) of the unconstrained log-likelihood
gradient_loglik_constrained()
Constrained gradient via the chain rule
hessian_loglik_constrained()
Constrained Hessian of \(\ell\circ\boldsymbol{\psi}\)

Core optimiser

Marquardt–Levenberg deconvolution (exported entry point). Related first- and second-order variants live in R/03_03_DeCovarT_estimate_ratios_frequentist.R. The S3 model wrapper is fit_decovart().

Fixed-covariance GLS competitor

MASS::lm.gls() wrapper with a known residual covariance (fixed_gls_covariance() at a declared composition).

deconvolute_ratios_gls()
Generalised least squares with a fixed residual covariance
fixed_gls_covariance()
Fixed residual covariance for a GLS competitor

Structure-aware covariance backends

Factorise (()=_j p_j^2 _j) by exploiting declared covariance structure (block, band, sparse, diagonal-plus-low-rank) instead of a dense Cholesky. Operators return the log-determinant and solves without a materialised precision. See vignette("theory-decovart-generative-model").

new_decovart_covariance() print(<decovart_covariance>)
Structure-aware covariance backend for \(\boldsymbol{\Sigma}(\boldsymbol{p})\)
covariance_structure_from_graph_model()
Recommend a covariance backend from a network topology
sigma_logdet()
Log-determinant of \(\boldsymbol{\Sigma}(\boldsymbol{p})\)
sigma_solve()
Precision solve \(\boldsymbol{\Sigma}(\boldsymbol{p})^{-1}\mathbf{B}\)
sigma_quadform()
Mahalanobis quadratic form \(\mathbf{r}^{\mathsf{T}}\boldsymbol{\Sigma}(\boldsymbol{p})^{-1}\mathbf{r}\)
sigma_trace_precision_times()
Trace of the precision times a matrix, \(\operatorname{tr}(\boldsymbol{\Omega}(\boldsymbol{p})\mathbf{S})\)

Fisher information and Wald intervals

Expected Fisher information of unconstrained proportions and ILR delta-method covariance used by vcov() / confint() on decovart_fit objects (see fit_decovart).

expected_fisher_unconstrained()
Expected Fisher information of unconstrained \(\boldsymbol{p}\)
vcov_ilr_delta()
Cramer–Rao / ILR delta-method covariance of \(\hat{\boldsymbol{p}}\)

Likelihood-ratio and boundary inference

Profile likelihood, likelihood-ratio tests with chi-bar-square (Chernoff / Self–Liang) calibration on simplex faces, parametric bootstrap, reference-sample bootstrap (donors, cells, or Dirichlet compositions), and the boundary / multimodality diagnostics that a bare convergence code cannot provide. See vignette("theory-DeCovarT-MLE-properties").

restricted_mle_decovart()
Restricted maximum likelihood with fixed cellular ratios
profile_loglik_decovart()
Profile log-likelihood of one cellular ratio
lrt_decovart()
Likelihood-ratio test for cellular ratios
confint_profile_decovart()
Profile-likelihood confidence intervals for cellular ratios
chi_bar_square_pvalue()
Chi-bar-square tail probability for boundary likelihood-ratio tests
bootstrap_decovart()
Parametric bootstrap for DeCovarT proportions and boundary tests
reference_bootstrap_decovart()
Reference-based bootstrap for signature and composition uncertainty
equivariance_check_decovart()
Permutation-equivariance check for a labelled reference
boundary_diagnostics()
Boundary and stationarity diagnostics for one DeCovarT fit
multistart_decovart()
Refit DeCovarT from several random starts to probe multimodality

Benchmark and evaluation

Quality metrics for estimated proportions, and the simulation benchmark wrapper.

compute_benchmark_metrics()
Compute deconvolution benchmark metrics
coverage_mc_interval()
Monte Carlo interval for an empirical coverage probability
run_simulation_benchmark()
Simulate bulk mixtures and benchmark deconvolution algorithms
deconvolute_ratios()
Parallel deconvolution of a bulk expression matrix
pivot_mc_estimates()
Pivot Monte Carlo proportion estimates to a long table
plot_mc_raincloud()
Horizontal raincloud of Monte Carlo proportion estimates
plot_mc_forest()
Forest plot of ADEMP Monte Carlo summaries
theme_decovart_facets()
Faceted ggplot2 theme (black strips, panel border)
algorithm_similarity()
Algorithm-similarity correlation from a Monte Carlo benchmark
plot_algorithm_similarity()
Tile heatmap of algorithm-similarity correlations
plot_mc_metric_dots()
Faceted dot plot of several ADEMP metrics
plot_correlation_Heatmap()
Plot deconvolution metric heatmaps

Simulation

Toy bulk mixtures

Simulate bulk mixtures as convolutions of multivariate Gaussians, and hierarchical GRN moments with graph-constrained covariances.

generate_mean_signature_matrix()
Generate mean profiles from a target Gram matrix
equicorrelation_gram()
Equicorrelation (constant-correlation) Gram matrix
simulate_bulk_mixture()
Simulate bulk mixtures from a multivariate Gaussian convolution
simulate_hierarchical_grn_moments()
Simulate GRN first- and second-order moments
describe_simulation_scenario()
Describe a Gaussian-convolution simulation scenario

Statistical metrics

Simplex repair, Shannon entropy, MixSim overlap, Jeffreys divergence, and glmnet gene scores for signature design.

repair_simplex()
Repair a numeric vector onto the unit simplex
compute_shannon_entropy()
Normalised Shannon entropy of a discrete distribution
composition_from_entropy()
One-dominant composition with a target normalised Shannon entropy
check_true_theta()
Validate generative-model parameters \(\theta\)
compute_average_overlap()
Average pairwise overlap of a Gaussian mixture
overlap_gaussian_mc()
MixSim-style pairwise overlap via stratified Sobol Monte Carlo
spd_affine_invariant_distance()
Affine-invariant Riemannian (AIRM) distance between two SPD matrices
compute_average_riemannian()
Mean pairwise AIRM distance of component covariances
scale_covariance_array()
Scale component covariances, keeping precision zeros
compute_average_jeffreys()
Average pairwise Jeffreys divergence of a Gaussian mixture
compute_glmnet_gene_scores()
Gene scores from multinomial elastic-net cell-type classification