Load the Pathway Commons SIF file into an R data frame, naming the three columns
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"))
Make a set of specific interaction-type names, for three general types of networks: PPI, metabolic network, and PPD
In [7]:
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")
For each of the three sets, make a new data frame by subsetting your R dataframe to only the rows where the "interaction_type" column contains a value that is in the set of specific interaction types.
In [8]:
ppi_df <- df[df$interaction_type %in% interaction_types_ppi,c(1,3,2)]
metab_df <- df[df$interaction_type %in% interaction_types_metab, c(1,3,2)]
ppd_df <- df[df$interaction_type %in% interaction_types_ppd, c(1,3,2)]
Make an igraph Graph object from each of your three data frames, using graph_from_data_frame; call the print function on each graph object to print the summary information for the graph.
In [9]:
library(igraph)
In [10]:
In [11]:
In [ ]: