Knode(g, dist.method=c("shortest.paths", "diffusion", "mfpt"), vertex.attr="pheno",
edge.attr=NULL, correct.factor=1, nsteps=1000, B=NULL, verbose=TRUE)igraph object, the network to work on.
correct.factor.
g output by the BinGraph function. If NULL, then B is computed within the Knode function.
TRUE messages about the progress of the function are displayed.
Knode AUKs for each vertex.If one vertex attribute is input, then the Knode AUKs are calculated and a single numerical vector is returned. If more than one vertex attribute is input, then a list of vectors, one for each set of vertex weights, is returned.
Knet equation, it becomes possible to prioritise vertices by how well they are connected, or associated, with high-weight vertices. The inner sum of the Knet equation is$$K^{node}_i[s]=\frac{2}{p} \sum_j (p_j - \bar{p}) I(d^g(i,j)<=s)$$< p="">
where $p_j$ is the weight of vertex $j$, $\bar{p}$ is the mean vertex weight across all vertices, and $I(dg[i,j]<=s)$ 1="" is="" an="" identity="" function,="" equaling="" if="" vertex="" $i$="" and="" $j$="" are="" within="" distance="" $s$="" $0$="" otherwise.="" <="" p="">
If the name of each vertex is stored within a vertex attribute called name, then the returned scores are labelled with these names.
Vertex weights should be greater than or equal to 0, or equal to NA if the weight is missing. The Knode statistic is still computed for vertices with missing weights.
If an edge attribute with this name is not found, then each edge is assumed to have a distance of 1. Smaller edge distances denote stronger interactions between vertex pairs
=s)$>=s)$$<>Knet
# create a network with a single cluster of high-weight vertices
# rank all vertices by their strength of association with the high-weight vertices
g1 <- erdos.renyi.game(15, p.or.m=0.3, directed=FALSE)
g1 <- SpreadHits(g1, h=3, lambda=10)
Knode(g1, vertex.attr="hits")
plot(g1)
Run the code above in your browser using DataLab