Calculation of the topological overlap matrix from a given adjacency matrix.
TOMsimilarity(adjMat, TOMType = "unsigned", TOMDenom = "min", verbose = 1, indent = 0)
TOMdist(adjMat, TOMType = "unsigned", TOMDenom = "min", verbose = 1, indent = 0)
adjacency matrix, that is a square, symmetric matrix with entries between 0 and 1
(negative values are allowed if TOMType=="signed"
).
a character string specifying TOM type to be calculated. One of "unsigned"
,
"signed"
. If "unsigned"
, the standard TOM will be used (more generally, TOM
function will receive the adjacency as input). If "signed"
, TOM will keep track of the sign of
the adjacency between neighbors.
a character string specifying the TOM variant to be used. Recognized values are
"min"
giving the standard TOM described in Zhang and Horvath (2005), and "mean"
in which
the min
function in the denominator is replaced by mean
. The "mean"
may produce
better results but at this time should be considered experimental.
integer level of verbosity. Zero means silent, higher values make the output progressively more and more verbose.
indentation for diagnostic messages. Zero means no indentation, each unit adds two spaces.
A matrix holding the topological overlap.
The functions perform basically the same calculations of topological overlap. TOMdist
turns the
overlap (which is a measure of similarity) into a measure of dissimilarity by subtracting it from 1.
Basic checks on the adjacency matrix are performed and missing entries are replaced by zeros.
If TOMType = "unsigned"
, entries of the adjacency matrix are required to lie between 0 and 1;
for TOMType = "signed"
they can be between -1 and 1. In both cases the resulting TOM entries, as
well as the corresponding dissimilarities, lie between 0 and 1.
The underlying C code assumes that the diagonal of the adjacency matrix equals 1. If this is not the case, the diagonal of the input is set to 1 before the calculation begins.
Bin Zhang and Steve Horvath (2005) "A General Framework for Weighted Gene Co-Expression Network Analysis", Statistical Applications in Genetics and Molecular Biology: Vol. 4: No. 1, Article 17