randomWalk: Performs a Random Walk on a Graph

Description Usage Arguments Value Author(s) References Examples

View source: R/randomWalk.R

Description

Performs random walk on a graph, with a restart probability of 0.7

Usage

1
randomWalk(intM, queryGenes)

Arguments

intM

adjacency matrix of the graph, or object of graph format containing this matrix

queryGenes

genes with which to seed the random walk

Value

Returns a named vector of visitation probabilities for all nodes in the graph

Author(s)

James Perkins Ian Morilla

Maintainer: James Perkins <jperkins@biochem.ucl.ac.uk>

References

http://www.ncbi.nlm.nih.gov/pubmed/18371930

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
    # using a graphNEL object
    set.seed(123)
    V <- letters[1:10]
    M <- 1:4
    g1 <- randomGraph(V, M, 0.5)
    visProbs <- randomWalk(g1, V[1:3])

    # using a graph object
    require(graph)
    zz <- rbind(c(0,1,0,1), c(1,0,0,0), c(0,0,0,1), c(1,0,1,0))
    colnames(zz) = rownames(zz) = letters[1:4]
    visProbs <- randomWalk(zz, V[1])

RWOAG documentation built on May 21, 2017, 3:44 a.m.

Search within the RWOAG package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.