In [6]:
df <- read.table("shared/pathway_commons.sif",
sep="\t",
quote="",
comment.char="",
stringsAsFactors=FALSE,
header=FALSE,
col.names=c("species1","interaction_type","species2"))
In [19]:
library(igraph)
interaction_types_ppi <- c("interacts-with",
"in-complex-with",
"neighbor-of")
interaction_types_metab <- c("controls-production-of",
"consumption-controlled-by",
"controls-production-of",
"controls-transport-of-chemical")
interaction_types_ppd <- c("catalysis-precedes",
"controls-phosphorylation-of",
"controls-state-change-of",
"controls-transport-of",
"controls-expression-of")
In [31]:
graph_ppi <- graph_from_data_frame(df[df$interaction_type %in% interaction_types_ppi,c(1,3,2)],
directed=FALSE)
print(graph_ppi)
In [32]:
graph_metab <- graph_from_data_frame(df[df$interaction_type %in% interaction_types_metab, c(1,3,2)],
directed=TRUE)
print(graph_metab)
In [30]:
graph_ppd <- graph_from_data_frame(df[df$interaction_type %in% interaction_types_ppd, c(1,3,2)],
directed=TRUE)
print(graph_ppd)
In [ ]: