This function models the downstream secondary effects of an in-silico perturbation by propagating the initial expression changes through a gene-gene co-expression or regulatory network.
ApplyPropagation.RdUsage
ApplyPropagation(
seurat_obj,
exp,
exp_per,
network,
perturb_dir,
n_iters = 3,
delta_scale = 0.2,
row_normalize = FALSE,
apply_ceiling = FALSE,
ceiling_multiplier = 1,
prune_network = FALSE,
prune_percentile = 0.95
)Arguments
- seurat_obj
A Seurat object containing the dataset.
- exp
A features-by-cells matrix containing the baseline (unperturbed) observed expression data.
- exp_per
A features-by-cells matrix containing the initial perturbation results (e.g., output from
ApplyPerturbation).- network
A gene-by-gene matrix representing the network structure (e.g., a Topological Overlap Matrix or gene regulatory network) used to route the signal.
- perturb_dir
Numeric. The direction and magnitude of the original perturbation, used to extract the sign for propagation scaling.
- n_iters
Numeric/Integer. The number of iterative steps to apply the signal propagation. Default is
3.- delta_scale
Numeric. A penalization/dampening factor applied to the delta matrix at each iteration to prevent biologically unrealistic exponential explosions in expression values. Default is
0.2.- row_normalize
Logical. If
TRUE, normalizes the network such that each row sums to 1. This converts the matrix multiplication from a cumulative sum into a weighted average, helping to prevent signal explosion in highly connected background genes. Default isFALSE.- apply_ceiling
Logical. If
TRUE, constrains the maximum propagated expression for each gene so it does not exceed its maximum observed value in the baseline data (adjusted by theceiling_multiplier). Default isFALSE.- ceiling_multiplier
Numeric. A scaling factor applied to the expression ceiling if
apply_ceiling = TRUE. For example,1.10allows simulated expression to reach 10\prune_networkLogical. If
TRUE, removes weak background edges from the network prior to propagation based on a calculated percentile threshold. Highly recommended for dense networks like WGCNA TOMs. Default isFALSE.prune_percentileNumeric. The percentile threshold (between 0 and 1) used to prune the network if
prune_network = TRUE. For example,0.95drops the weakest 95\ A matrix (ordgCMatrix) containing the fully updated expression matrix representing the global cell state after the perturbation signal has propagated through the network. This function models the downstream secondary effects of an in-silico perturbation by propagating the initial expression changes through a gene-gene co-expression or regulatory network. The function calculates the initial difference (delta) between the perturbed and baseline expression matrices. Overn_itersiterations, thisdeltais multiplied by the gene-genenetworkmatrix via dot product. This mathematical diffusion simulates how a change in a hub gene ripples out to its connected targets.To maintain stability and biological realism, the propagated signal is penalized at each step by thedelta_scaleparameter. Users can further stabilize the diffusion by pruning weak network edges (prune_network), row-normalizing the network (row_normalize), and enforcing a strict biological ceiling (apply_ceiling) to prevent genes from entering biologically impossible high-expression states. Finally, total expression is strictly floored at 0 to prevent negative read counts, and the final matrix is rounded to represent valid count data.