Methods to compute weighted score functions applied to a single vertex of the graph
# S4 method for graph
single.NN.w.score(RW, x, x.pos, w)
# S4 method for matrix
single.NN.w.score(RW, x, x.pos, w)
# S4 method for graph
single.KNN.w.score(RW, x, x.pos, w, k = 3)
# S4 method for matrix
single.KNN.w.score(RW, x, x.pos, w, k = 3)
# S4 method for graph
single.eav.w.score(RW, x, x.pos, w, auto = FALSE)
# S4 method for matrix
single.eav.w.score(RW, x, x.pos, w, auto = FALSE)
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
matrix. It must be a kernel matrix or a symmetric matrix expressing the similarity between nodes
integer. Index corresponding to the element of the RW matrix for which the score must be computed
vector of integer. Indices of the positive elements of the RW matrix
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.
integer. Number of the k nearest neighbours to be considered
boolean. If TRUE the components
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 nodes
single.KNN.w.score
computes the weighted KNN score for a single vertex using a kernel matrix or a symmetric matrix expressing the similarity between nodes
single.eav.score
computes the weighted Empirical Average score using a kernel matrix or a symmetric matrix expressing the similarity between nodes
single.NN.w.score
computes the weighted NN score for a single vertex:
where
single.KNN.w.score
compute the weighted KNN score for a single vertex:
single.eav.score
computes the weighted Empirical Average score for a single vertex:
Methods for scoring a single vertex
Methods for scoring multiple vertices - weighted version
# 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);
# \donttest{
# 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);
# }
Run the code above in your browser using DataLab