View source: R/utility_functions.R
scaleTOM | R Documentation |
Query TOM matrix is rescaled to match nth percentile of reference TOM matrix. Since consensus is defined as component-wise minimum of two TOMS, a bias may result without scaling. This is mitigated by scaling the matrices.
scaleTOM(query.TOM, reference.TOM, reference.percentile = 0.95)
query.TOM |
Query topological overlap matrix. This is the matrix that will be scaled. Corresponds to w.mat output from scMiko::runWGCNA() function. |
reference.TOM |
Reference topological overlap matrix. This is the matrix that will be used as the reference and will not be scaled. Corresponds to w.mat output from scMiko::runWGCNA() function. |
reference.percentile |
Numerical. Matrix is scaled so that reference.percentile is matched across both matrices. Default is 0.95. |
scaled query.TOM
# scale TOM matrices
w.1 <- scaleTOM(query.TOM = w.1, reference.TOM = w.mat, reference.percentile = 0.95)
w.2 <- scaleTOM(query.TOM = w.2, reference.TOM = w.mat, reference.percentile = 0.95)
# recompute the distance matrix
d.mat <- 1-w.mat
d.1 <- 1-w.1
d.2 <- 1-w.2
# compute consensus topological overlap
w.co <- pmin(w.1, w.2) # component-wise parallel minimum of TOMs
d.co <- 1-w.co
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.