Description Usage Arguments Value Author(s) See Also Examples
The make.target.graph
function uses get.graph.sp
to create subgraphs corresponding to the shortest paths between hits or between variants and hits or between variants. These subgraphs are subsequently joined together to form the graph structure that will be plotted.
1 2 | make.target.graph(use.graph, hit.nodes, mut.nodes)
get.graph.sp(use.graph, from.nodes, to.nodes, path.len.restrict)
|
use.graph |
An |
hit.nodes |
A |
mut.nodes |
A |
from.nodes |
A |
to.nodes |
A |
path.len.restrict |
Maximum number of nodes on the shortest path. |
returns a graphNEL
object.
returns a matrix containing two columns indicating the nodes that have an edge.
Daniel Bottomly
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | set.seed(123)
if (require(RSQLite) && require(HitWalkerData))
{
data(params)
graph.obj <- loadGraph(graph.file.path(), examp.prior.param)
graph.params <- makeGraphDispParams(file.name=character())
nodes <- annotation(graph.obj)$protein
samp.nodes <- sample(nodes, 6)
res.graph <- make.target.graph(use.graph=getGraph(graph.obj), hit.nodes=samp.nodes[1:3], mut.nodes=samp.nodes[4:6])
if (require(Rgraphviz)) plot(res.graph)
res.graph.sp <- get.graph.sp(getGraph(graph.obj), from.nodes=samp.nodes[1:3], to.nodes=samp.nodes[4:6], path.len.restrict=NULL)
trans.graph.sp <- matrix(V(getGraph(graph.obj))$name[as.integer(res.graph.sp)], ncol=2, nrow=nrow(res.graph.sp))
head(trans.graph.sp)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.