Skip to contents

Calculate the TOM from a correlation matrix

Usage

calculate_tom(cor_mat, signed, version = c("v1", "v2"))

Arguments

cor_mat

Numerical matrix. The symmetric correlation matrix.

signed

Boolean. Do you want to calculate the signed version. If set to FALSE, the absolute correlation coefficients will be used.

version

String. One of c("v1", "v2"). Defaults to "v1".

Value

A symmetric matrix of the same dimensions as cor_mat containing the topological overlap measures.

Details

Calculates the topological overlap matrix from a correlation matrix. The TOM is defined as:

Unsigned, v1:

$$TOM_{ij} = \frac{a_{ij} + \sum_{k \neq i,j} a_{ik} a_{kj}}{\min(k_i, k_j) + 1 - a_{ij}}$$

Signed, v1:

$$TOM_{ij} = \frac{a_{ij} + \sum_{k \neq i,j} a_{ik} a_{kj}}{\min(k_i, k_j) + 1 - \left|a_{ij}\right|}$$

Unsigned, v2:

$$TOM_{ij} = 0.5 \left( a_{ij} + \frac{\sum_{k \neq i,j} a_{ik} a_{kj}}{\min(k_i, k_j) + a_{ij}} \right)$$

Signed, v2:

$$TOM_{ij} = 0.5 \left( a_{ij} + \frac{\sum_{k \neq i,j} a_{ik} a_{kj}}{\min(k_i, k_j) + \left|a_{ij}\right|} \right)$$

where \(a_{ij}\) is the affinity between nodes \(i\) and \(j\), and \(k_i = \sum_j a_{ij}\) is the connectivity of node \(i\). For signed networks, connectivity is calculated as \(k_i = \sum_j \left|a_{ij}\right|\).

Version 2 uses a different normalization approach that scales the shared neighbor contribution separately before combining it with the direct connection strength.