graph: An igraph object. May be directed or weighted.
directed: logical. Whether directed information is passed to the adjacency matrix.
Returns
An adjacency matrix compatible with generating an expression matrix
Examples
# construct a synthetic graph modulelibrary("igraph")graph_test_edges <- rbind(c("A","B"), c("B","C"), c("B","D"))graph_test <- graph.edgelist(graph_test_edges, directed =TRUE)# compute adjacency matrix for toy exampleadjacency_matrix <- make_adjmatrix_graph(graph_test)adjacency_matrix
# construct a synthetic graph networkgraph_structure_edges <- rbind(c("A","C"), c("B","C"), c("C","D"), c("D","E"), c("D","F"), c("F","G"), c("F","I"), c("H","I"))graph_structure <- graph.edgelist(graph_structure_edges, directed =TRUE)# compute adjacency matrix for toy networkgraph_structure_adjacency_matrix <- make_adjmatrix_graph(graph_structure)graph_structure_adjacency_matrix
# import graph from package for reactome pathway# TGF-\eqn{\Beta} receptor signaling activates SMADs (R-HSA-2173789)TGFBeta_Smad_graph <- identity(TGFBeta_Smad_graph)# compute adjacency matrix for TGF-\eqn{\Beta} receptor signaling activates SMADsTGFBeta_Smad_adjacency_matrix <- make_adjmatrix_graph(TGFBeta_Smad_graph)dim(TGFBeta_Smad_adjacency_matrix)TGFBeta_Smad_adjacency_matrix[1:12,1:12]
See Also
See also generate_expression for computing the simulated data, make_sigma for computing the Sigma (Σ) matrix, make_distance for computing distance from a graph object, make_state for resolving inhibiting states.
See also plot_directed for plotting graphs or heatmap.2 for plotting matrices.
See also make_laplacian
or make_commonlink for computing input matrices.
See also igraph for handling graph objects.
Other graphsim functions: generate_expression(), make_commonlink, make_distance, make_laplacian, make_sigma, make_state, plot_directed()
Other graph conversion functions: make_commonlink, make_laplacian