get_interaction_from_database: Get interaction from database

View source: R/get_interaction_from_database.R

get_interaction_from_databaseR Documentation

Get interaction from database

Description

Returns an interaction graph from a vector of nodes (or a list of vectors) and an interaction database (data.frame or igraph)

Usage

get_interaction_from_database(X, db = NULL, type = "db", user.ego = FALSE)

Arguments

X

vector of nodes or list of vectors

db

data.frame (with two columns: from, to) or igraph

type

character added to node metadata

user.ego

logical, if user.ego == TRUE looks for first degree neighbors in db and add 'mode' metadata ('core'/'extended')

Value

a subset graph of db from X list of nodes

Examples

X <- letters[1:4]
db <- as.data.frame(list(from = sample(letters[1:10], replace = TRUE),
                         to = sample(letters[1:10], replace = TRUE)))
                         
 sub <- get_interaction_from_database(X, 
                                      db)
 
 db.graph <- igraph::graph_from_data_frame(db, 
                                           directed=FALSE)
 sub <- get_interaction_from_database(X, 
                                      db)


abodein/netOmics documentation built on Oct. 20, 2024, 9:25 a.m.