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 ALR-constrained log-likelihood (Jacobian / Hessian of the additive logistic map; gradients and Hessians of ()). Documented for ? / source inspection; see also vignette("softmax-alr-derivatives").

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.

Benchmark and evaluation

Quality metrics for estimated proportions, and the bivariate toy convolution benchmark.

compute_benchmark_metrics()
Compute summary metrics for estimated proportions
benchmark_bivariate_gaussian_convolutions()
Benchmark bivariate Gaussian convolutions
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 with a target pairwise cosine
simulate_bulk_mixture()
Simulate bulk mixtures from a multivariate Gaussian convolution
simulate_hierarchical_grn_moments()
Simulate GRN first- and second-order moments

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
check_true_theta()
Validate generative-model parameters \(\theta\)
compute_average_overlap()
Average pairwise overlap of a Gaussian mixture
compute_average_jeffreys()
Average pairwise Jeffreys divergence of a Gaussian mixture
compute_glmnet_gene_scores()
Gene scores from multinomial elastic-net cell-type classification