weighted.score.multiple.vertex-methods {RANKS} | R Documentation |
Multiple vertex score functions - weighted version
Description
Methods to compute weighted score functions for multiple vertices of the graph
Usage
## S4 method for signature 'graph'
NN.w.score(RW, x, x.pos, w, norm = TRUE)
## S4 method for signature 'matrix'
NN.w.score(RW, x, x.pos, w, norm = TRUE)
## S4 method for signature 'graph'
KNN.w.score(RW, x, x.pos, w, k = 3, norm = TRUE)
## S4 method for signature 'matrix'
KNN.w.score(RW, x, x.pos, w, k = 3, norm = TRUE)
## S4 method for signature 'graph'
eav.w.score(RW, x, x.pos, w, auto = FALSE, norm = TRUE)
## S4 method for signature 'matrix'
eav.w.score(RW, x, x.pos, w, auto = FALSE, norm = TRUE)
Arguments
RW |
matrix. It must be a kernel matrix or a symmetric matrix expressing the similarity between nodes |
x |
vector of integer. Indices corresponding to the elements 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 |
k |
integer. Number of the k nearest neighbours to be considered |
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. |
auto |
boolean. If TRUE the components |
norm |
boolean. If TRUE (def.) the scores are normalized between 0 and 1. |
Details
The methods compute the weighted scores for multiple vertices according to the weighted version of NN, KNN, and Empirical Average score. Note that the argument x indicates the set of nodes for which the score must be computed. The vector x represents the indices of the rows of the matrix RW corresponding to the vertices for which the scores must be computed. If x = 1:nrow(RW) the scores for all the vertices of the graph are computed.
Value
NN.w.score
: a numeric vector with the weighted NN scores of the vertices. The names of the vector correspond to the indices x
KNN.score
: a numeric vector with the weighted KNN scores of the vertices. The names of the vector correspond to the indices x
eav.score
: a numeric vector with the weighted Empirical Average score of the vertices. The names of the vector correspond to the indices x
Methods
signature(RW = "graph")
-
NN.w.score
computes the weighted NN score for multiple vertices using a graph of class graph (hence including objects of class graphAM and graphNEL from the package graph)KNN.w.score
computes the weighted KNN score for multiple vertices using a graph of class graph (hence including objects of class graphAM and graphNEL from the package graph)eav.w.score
computes the weighted Empirical Average score for multiple verticesusing a graph of class graph (hence including objects of class graphAM and graphNEL from the package graph) signature(RW = "matrix")
-
NN.w.score
computes the weighted NN score for multiple vertices using a kernel matrix or a symmetric matrix expressing the similarity between nodesKNN.w.score
computes the weighted KNN score for multiple vertices using a kernel matrix or a symmetric matrix expressing the similarity between nodeseav.w.score
computes the weighted Empirical Average score multiple for vertices using a kernel matrix or a symmetric matrix expressing the similarity between nodes
References
Giorgio Valentini, Giuliano Armano, Marco Frasca, Jianyi Lin, Marco Mesiti, and Matteo Re RANKS: a flexible tool for node label ranking and classification in biological networks Bioinformatics first published online June 2, 2016 doi:10.1093/bioinformatics/btw235
Re M, Mesiti M, Valentini G: A fast ranking algorithm for predicting gene functions in biomolecular networks. IEEE ACM Trans Comput Biol Bioinform 2012, 9(6):1812-1818.
See Also
Methods for scoring a single vertex - weighted version
Methods for scoring multiple vertices
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-scores computed directly on the STRING matrix
s <- NN.w.score(Yeast.STRING.data, 1:n, ind.pos, w=labels);
# Weighted NN-scores computed directly on the STRING matrix
# using this time random weights for the value of positive nodes
w <- runif(n);
s <- NN.w.score(Yeast.STRING.data, 1:n, ind.pos, w=w);
# Weighted NN-scores computed on the 1 step and 2-step random walk kernel matrix
K <- rw.kernel(Yeast.STRING.data);
sK <- NN.w.score(K, 1:n, ind.pos, w);
K2 <- p.step.rw.kernel(K, p=2);
sK2 <- NN.w.score(K2, 1:n, ind.pos, w);