make_target_graph: Creating shortest path subgraphs

Description Usage Arguments Value Author(s) See Also Examples

Description

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.

Usage

1
2
make.target.graph(use.graph, hit.nodes, mut.nodes)
get.graph.sp(use.graph, from.nodes, to.nodes, path.len.restrict)

Arguments

use.graph

An igraph object.

hit.nodes

A character vector of nodes corresponding to hits.

mut.nodes

A character vector of nodes corresponding to variant nodes.

from.nodes

A character vector of nodes corresponding to the starting point of the shortest path.

to.nodes

A character vector of nodes corresponding to the ending point of the shortest path (or NULL).

path.len.restrict

Maximum number of nodes on the shortest path.

Value

make.target.graph

returns a graphNEL object.

get.graph.sp

returns a matrix containing two columns indicating the nodes that have an edge.

Author(s)

Daniel Bottomly

See Also

igraph, graphNEL

Examples

 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)
}

dbottomly/HitWalker documentation built on May 15, 2019, 1:22 a.m.