find_intersecting_nodes: alternative find_edges from both

Description Usage Arguments Value Examples

View source: R/utils.R

Description

a less general approach is to come from both the start and end nodes, go one hop, and find the intersection of all pairwise comparisons. This method is useful as it provides a simple check on the original find_edges method for 2 hops.

Usage

1
find_intersecting_nodes(in_graph, start_nodes, end_nodes)

Arguments

in_graph

a graphBAM

start_nodes

the start nodes to use

end_nodes

the end nodes to reach

Value

with new graph and all nodes in graph

Examples

1
2
3
4
5
6
7
8
library(STRINGDatabaseManipulation)
library(graph)
set.seed(1234)
link_data <- STRING10_links
link_data <- link_data[sample(nrow(link_data), 10000),]
in_graph <- string_2_graphBAM(link_data)
start_nodes <- end_nodes <- sample(nodes(link_graph), 100)
out_graph <- find_intersecting_nodes(in_graph, start_nodes, end_nodes)

rmflight/STRINGDatabaseManipulation documentation built on Feb. 7, 2020, 12:26 a.m.