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)


IGRAPH cdfa81b UN-- 17531 508480 -- 
+ attr: name (v/c), interaction_type (e/c)
+ edges from cdfa81b (vertex names):
 [1] A1BG--ABCC6   A1BG--ACE2    A1BG--ADAM10  A1BG--ADAM17  A1BG--ADAM9  
 [6] A1BG--AGO1    A1BG--ANXA7   A1BG--CDKN1A  A1BG--CRISP3  A1BG--CRK    
[11] A1BG--CSE1L   A1BG--DDX3X   A1BG--DEAF1   A1BG--E2F1    A1BG--E2F2   
[16] A1BG--E2F3    A1BG--EIF3E   A1BG--ELAVL1  A1BG--GDPD1   A1BG--GRB2   
[21] A1BG--GRB7    A1BG--HNF4A   A1BG--HNRNPC  A1BG--HUWE1   A1BG--IQGAP1 
[26] A1BG--KCMF1   A1BG--KPNB1   A1BG--LIG3    A1BG--MYD88   A1BG--NEIL1  
[31] A1BG--NTHL1   A1BG--ONECUT1 A1BG--PFN2    A1BG--PIAS1   A1BG--PIK3CA 
[36] A1BG--PIK3R1  A1BG--PNKP    A1BG--POLB    A1BG--PPP2R1A A1BG--PRDX4  
+ ... omitted several edges

In [10]:



IGRAPH 5c9ebce DN-- 9795 47646 -- 
+ attr: name (v/c), interaction_type (e/c)
+ edges from 5c9ebce (vertex names):
 [1] A1CF  ->CHEBI:17775 A1CF  ->CHEBI:27226 A1CF  ->CHEBI:46819
 [4] A4GALT->CHEBI:17659 A4GALT->CHEBI:17950 A4GALT->CHEBI:18307
 [7] A4GALT->CHEBI:18313 A4GALT->CHEBI:58223 A4GALT->CHEBI:67119
[10] A4GNT ->CHEBI:17659 A4GNT ->CHEBI:58223 AAAS  ->CHEBI:1604 
[13] AAAS  ->CHEBI:2274  AACS  ->CHEBI:13705 AACS  ->CHEBI:15345
[16] AACS  ->CHEBI:17369 AACS  ->CHEBI:45212 AACS  ->CHEBI:57286
[19] AACS  ->CHEBI:57287 AACS  ->CHEBI:57288 AACS  ->CHEBI:57392
[22] AACS  ->CHEBI:58280 AADAC ->CHEBI:17790 AADAC ->CHEBI:40574
+ ... omitted several edges

In [11]:



IGRAPH 994c2ba DN-- 18155 479298 -- 
+ attr: name (v/c), interaction_type (e/c)
+ edges from 994c2ba (vertex names):
 [1] A1BG  ->A2M     A1BG  ->AKT1    A1BG  ->AKT1    A1CF  ->CASP1  
 [5] A1CF  ->CCL2    A1CF  ->IL1B    A2M   ->APOA1   A2M   ->CASP3  
 [9] A2M   ->CASP9   A2M   ->CDC42   A2M   ->IFNG    A2M   ->INS    
[13] A2M   ->LRP1    A2M   ->PARP1   A2M   ->PTK2    A2M   ->RAC1   
[17] A2M   ->RAC2    A2M   ->RAC3    A2M   ->RHOA    A2M   ->RHOBTB1
[21] A2M   ->RHOBTB2 A2M   ->RHOB    A2M   ->RHOC    A2M   ->RHOD   
[25] A2M   ->RHOF    A2M   ->RHOG    A2M   ->RHOH    A2M   ->RHOJ   
[29] A2M   ->RHOQ    A2M   ->RHOT1   A2M   ->RHOT2   A2M   ->RHOU   
+ ... omitted several edges

In [ ]: