This function takes a weighted adjacency matrix and separates the components of the matrix into weights and presence/absence matrices making use of a threshold.

network_make_binary(adj_mat, threshold, print_message = TRUE)

Arguments

adj_mat

adjacency matrix to be converted.

threshold

we recommended to use network_rescale before using this function. Re-scaling will transform all values into a range [0,100]. The threshold can either be a numeric balue in the interval [0,100] or a character string specifying the following methods for automatically determining the threshold based on the input data:

  • threshold = "median": compute the median over the entire input adj_mat and use this median value as threshold for defining all edge weights of a genes equal or below the median value as 0 and all values above the median value as 1.

print_message

a logical value indicating whether or not a threshold message shall be printed.

Author

Sergio Vasquez and Hajk-Georg Drost

Examples

# path to PPCOR output file ppcor_output <- system.file('beeline_examples/PPCOR/outFile.txt', package = 'edgynode') # import PPCOR specific output ppcor_parsed <- ppcor(ppcor_output) # rescale the matrix ppcor_rescaled <- network_rescale(ppcor_parsed)
#> It seems like your input matrix contains values of correlation coefficients range(-1,1). Please be aware that for negative values the absolute value will be taken before rescaling. We transformed all negative values to their absolute values.
# make the binary matrix ppcor_binary <- network_make_binary(ppcor_rescaled, 70)
#> network_make_binary() applies [70] as cut-off threshold to transform the input weighted adjacency matrix into a binary adjacency matrix.
# to see the differences you may use: plot_network_dendrogram(ppcor_rescaled)
plot_network_dendrogram(ppcor_binary)