Calculate a degree-aware spillover threshold for row-normalized networks
Source:R/questions.R
spillover_threshold_from_degree.Rd
This function estimates a network-specific threshold for spillover activation, based on the expected signal that each node would receive from random initiator sets. It uses the assumption that, in a row-normalized matrix, initiators distribute 1 unit of signal across their neighbors, and thus the expected spillover is proportional to the degree (number of connections) of each node.
Arguments
- W
A row-normalized sparse network matrix of class `dgCMatrix`, where rows and columns have matching gene names.
- quantile
Numeric value between 0 and 1 (default = 0.95). The threshold is set at this quantile of the expected background distribution.
- verbose
Logical. If TRUE, prints the computed threshold and quantile information.
- tolerance
Numeric tolerance for row-sum deviation (default = 1e-6).
Details
This threshold can be used to distinguish spillover values that exceed what is expected from random signal diffusion alone, and is intended for use with row-normalized sparse adjacency or TOM matrices.
Examples
if (FALSE) { # \dontrun{
threshold <- spillover_threshold_from_degree(W = my_network, quantile = 0.95)
spill_binary <- ifelse(spillover > threshold, 1, 0)
} # }