weighted.score.single.vertex-methods {RANKS} | R Documentation |
Single vertex score functions - weighted version
Description
Methods to compute weighted score functions applied to a single vertex of the graph
Usage
## S4 method for signature 'graph'
single.NN.w.score(RW, x, x.pos, w)
## S4 method for signature 'matrix'
single.NN.w.score(RW, x, x.pos, w)
## S4 method for signature 'graph'
single.KNN.w.score(RW, x, x.pos, w, k = 3)
## S4 method for signature 'matrix'
single.KNN.w.score(RW, x, x.pos, w, k = 3)
## S4 method for signature 'graph'
single.eav.w.score(RW, x, x.pos, w, auto = FALSE)
## S4 method for signature 'matrix'
single.eav.w.score(RW, x, x.pos, w, auto = FALSE)
Arguments
RW |
matrix. It must be a kernel matrix or a symmetric matrix expressing the similarity between nodes |
x |
integer. Index corresponding to the element of the RW matrix for which the score must be computed |
x.pos |
vector of integer. Indices of the positive elements of the RW matrix |
w |
vector of numeric. Its elements represent the initial likelihood that the nodes of the graph belong to the class under study. The elements of w correspond to the columns of RW and the length of w and the number of columns of RW must be equal. |
k |
integer. Number of the k nearest neighbours to be considered |
auto |
boolean. If TRUE the components |
Details
single.NN.w.score
computes the weighted NN score for a single vertex:
score(x) = - \min_{x_i \in V_C} -2 K(x,x_i)) * w(x_i)
where V_C
is the set of positive vertices, and w(x_i)
is the weight associated to the node x_i
single.KNN.w.score
compute the weighted KNN score for a single vertex:
score(x) = \sum_{k \; nearest \; x_i \in V_C} 2 K(x,x_i) * w(x_i)
single.eav.score
computes the weighted Empirical Average score for a single vertex:
score(x) = - K(x,x) * w(x) + \frac{2}{(\sum_{x_i \in x.pos} w(x_i))} * \sum_{x_i \in x.pos} K(x,x_i) * w(x_i)
Value
single.NN.w.score
: the weighted NN score of the vertex
single.KNN.w.score
: the weighted KNN score of the vertex
single.eav.w.score
: the weighted Empirical Average score of the vertex
Methods
signature(RW = "graph")
-
single.NN.w.score
computes the weighted NN score for a single vertex using a graph of class graph (hence including objects of class graphAM and graphNEL from the package graph)single.KNN.w.score
computes the weighted KNN score for a single vertex using a graph of class graph (hence including objects of class graphAM and graphNEL from the package graph)single.eav.w.score
computes the weighted Empirical Average score for a single vertex using a graph of class graph (hence including objects of class graphAM and graphNEL from the package graph) signature(RW = "matrix")
-
single.NN.w.score
computes the weighted NN score for a single vertex using a kernel matrix or a symmetric matrix expressing the similarity between nodessingle.KNN.w.score
computes the weighted KNN score for a single vertex using a kernel matrix or a symmetric matrix expressing the similarity between nodessingle.eav.score
computes the weighted Empirical Average score using a kernel matrix or a symmetric matrix expressing the similarity between nodes
See Also
Methods for scoring a single vertex
Methods for scoring multiple vertices - weighted version
Examples
# Computation of scores using STRING data with respect to
# the FunCat category 11.02.01 rRNA synthesis
library(bionetdata);
data(Yeast.STRING.data);
data(Yeast.STRING.FunCat);
labels <- Yeast.STRING.FunCat[,"11.02.01"];
n <- length(labels);
ind.pos <- which(labels==1);
# NN-score computed directly on the STRING matrix on the first yeast gene YJR121W
s <- single.NN.w.score(Yeast.STRING.data, 1, ind.pos, w=labels);
# NN-score weighted computed directly on the STRING matrix on the first yeast gene YJR121W,
# using this time random weights for the value of positive nodes
w <- runif(n);
s <- single.NN.w.score(Yeast.STRING.data, 1, ind.pos, w=w);
# NN-score weighted computed on the 1 step and 2-step random walk kernel matrix
K <- rw.kernel(Yeast.STRING.data);
sK <- single.NN.w.score(K, 1, ind.pos, w);
K2 <- p.step.rw.kernel(K, p=2);
sK2 <- single.NN.w.score(K2, 1, ind.pos, w);