This function rescales to a 0 to 100 scale using the values present in the matrix. It is based on the rescale function of the scales package. It will make the matrix symmetric by mirroring the upper half if it isn't. If negative values present, their absolute value will be taken.

network_rescale(adj_mat, to = c(0, 100), print_message = TRUE)

Arguments

adj_mat

an adjacency matrix to normalize.

to

interval in which transformation should be done. Default is to = c(0, 100).

print_message

a logical value indicating whether or not a re-scaling 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') # parsing the output to an adjacency matrix ppcor_parsed <- ppcor(ppcor_output) # rescaling the matrix 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.
# Visualize result head(rescaled)
#> DMRT1 FGF9 RSPO1 DHH CTNNB1 PGD2 WT1mKTS #> DMRT1 0.00000 21.29578 19.201584 10.396156 36.254437 12.158182 14.917907 #> FGF9 21.29578 0.00000 13.787012 52.516509 27.646002 34.103635 7.653306 #> RSPO1 19.20158 13.78701 0.000000 19.301500 86.885101 4.729058 15.730029 #> DHH 10.39616 52.51651 19.301500 0.000000 9.937542 46.698354 16.667705 #> CTNNB1 36.25444 27.64600 86.885101 9.937542 0.000000 2.604611 2.054147 #> PGD2 12.15818 34.10363 4.729058 46.698354 2.604611 0.000000 4.734473 #> SRY DKK1 WNT4 CBX2 AMH NR0B1 NR5A1 #> DMRT1 79.308246 89.470246 33.645266 17.24909 13.010369 11.26526 40.31568 #> FGF9 21.317186 4.075543 33.198658 30.79540 39.061874 34.87136 34.15264 #> RSPO1 20.133421 4.660239 89.586138 39.14069 3.430698 41.01352 73.85361 #> DHH 4.018216 18.231590 7.606054 19.18282 56.297538 35.14721 33.05562 #> CTNNB1 29.988223 5.646461 98.215426 30.86320 6.413189 38.63306 23.33152 #> PGD2 10.806533 9.631663 14.867534 30.41108 52.687466 35.02585 23.03107 #> WT1pKTS FOXL2 UGR SOX9 GATA4 #> DMRT1 35.667556 8.372022 34.961957 48.802466 12.775644 #> FGF9 19.037610 22.331243 6.646834 30.883813 11.239773 #> RSPO1 2.391683 35.934619 39.036947 5.411625 15.061765 #> DHH 4.373751 33.259122 17.989367 35.516356 2.563966 #> CTNNB1 34.080990 54.715054 48.697348 4.800439 18.890363 #> PGD2 2.816691 21.333371 27.989674 33.631187 6.081368