Construct an adjacency matrix from the (distance) scores and a given threshold.

getAdjacencyMatrix(distanceMatrix, cutOff)

Arguments

distanceMatrix

A Matrix::Matrix() containing (distance) scores between 0 and 1.

cutOff

Numeric value, indicating for which pair of entries in the distanceMatrix a 1 should be inserted in the adjacency matrix. A 1 is inserted when for each entry in the matrix # that is smaller or equal to the cutOff value.

Value

A Matrix::Matrix() of adjacency status

Examples

m <- Matrix::Matrix(stats::runif(1000, 0, 1), 100, 100)
geneset_names <- as.character(stats::runif(100, min = 0, max = 1))
rownames(m) <- colnames(m) <- geneset_names
threshold <- 0.3
adj <- getAdjacencyMatrix(m, threshold)