Last chance! 50% off unlimited learning
Sale ends in
adjacency(datExpr, selectCols = NULL,
type = "unsigned", power = if (type=="distance") 1 else 6,
corFnc = "cor", corOptions = "use = 'p'",
distFnc = "dist", distOptions = "method = 'euclidean'")
adjacency.fromSimilarity(similarity, type = "unsigned", power = if (type=="distance") 1 else 6)
"unsigned"
,
"signed"
, "signed hybrid"
, "distance"
.corFnc
. Use "use = 'p', method = 'spearman'"
to obtain Spearman correlation.dist
.
Any function returning non-negative values can be used.distFnc
. For example, when the function dist
is used, the argument method
can be used to specncol(datExpr)
times ncol(datExpr)
(or the same dimensions
as similarity
). If selectCols
was
given, the number of columns will be the length (if numeric) or sum (if boolean) of selectCols
.type
determines whether a correlation (type
one of "unsigned"
,
"signed"
, "signed hybrid"
), or a distance network (type
equal "distance"
) will
be calculated. In correlation networks the adajcency is constructed from correlations (values between -1 and
1, with high numbers meaning high similarity). In distance networks, the adjacency is constructed from
distances (non-negative values, high values mean low similarity).
The function calculates the similarity of columns (genes) in datExpr
by calling the function
given in corFnc
(for correlation networks) or distFnc
(for distance networks),
transforms the similarity according to type
and raises it to power
,
resulting in a weighted network adjacency matrix. If selectCols
is given, the corFnc
function
will be given arguments (datExpr, datExpr[selectCols], ...)
; hence the returned adjacency will have
rows corresponding to all genes and columns corresponding to genes selected by selectCols
.
Correlation and distance are transformed as follows: for type = "unsigned"
, adjacency = |cor|^power;
for type = "signed"
, adjacency = (0.5 * (1+cor) )^power; for type = "signed hybrid"
, adjacency
= cor^power if cor>0 and 0 otherwise; and for type = "distance"
, adjacency =
(1-(dist/max(dist))^2)^power.
The function adjacency.fromSimilarity
inputs a similarity matrix, that is it skips the correlation
calculation step but is otherwise identical.