Constructs a network
matrixToNetwork(
mat,
symmetrizeMethod = c("average", "min", "max"),
signed = TRUE,
min = NULL, max = NULL,
power = 12,
diagEntry = 1)
The adjacency matrix that encodes the network.
matrix to be turned into a network. Must be square.
method for symmetrizing the matrix. The method will be applied to each component of mat and its transpose.
logical: should the resulting network be signed? Unsigned networks are constructed from abs(mat)
.
minimum allowed value for mat
. If NULL
, the actual attained minimum of mat
will be used.
Missing data are ignored. Values below min
are truncated to min
.
maximum allowed value for mat
. If NULL
, the actual attained maximum of mat
will be used.
Missing data are ignored. Values below max
are truncated to max
.
the soft-thresholding power.
the value of the entries on the diagonal in the result. This is usally 1 but some applications may require a zero (or even NA) diagonal.
Peter Langfelder
If signed
is FALSE
, the matrix mat
is first converted to its absolute value.
This function then symmetrizes the matrix using the symmetrizeMethod
component-wise on mat
and t(mat)
(i.e., the transpose of mat
).
In the next step, the symmetrized matrix is linearly scaled to the interval [0,1] using either min
and max
(each either supplied or determined from the matrix). Values outside of the [min, max] range
are truncated to min
or max
.
Lastly, the adjacency is calculated by rasing the matrix to power
.
The diagonal of the result is set to
diagEntry
. Note that most WGCNA functions expect the diagonal of an adjacency matrix to be 1.
adjacency
for calculation of a correlation network (adjacency) from a numeric matrix such as
expression data
adjacency.fromSimilarity
for simpler calculation of a network from a symmetric similarity matrix.