-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTutorial_Rscript
More file actions
94 lines (76 loc) · 4.58 KB
/
Tutorial_Rscript
File metadata and controls
94 lines (76 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#Installation of NetVA package
##NetVA depends on igraph package. Therefore, the users have to install igraph first before installing NetVA.
install.packages("igraph")
##For installing the NetVA from GitHub, the users will need devtools package. If the users have devtools
##installed already in their systems, then directly can proceed with the installation of the NetVA.
##If devtools is not installed, then the users will have to install it first before installing the NetVA.
install.packages("devtools")
devtools::install_github("kr-swapnil/NetVA")
#Load NetVA and igraph packages
> library(NetVA)
> library(igraph)
#Load protein-protein interactions of breast cancer as data.frame
> data(bca_ppi)
> bc.net <- bca_ppi
#Store name of all vertices in v as character vector
> v <- vertex_attr(bc.net)$name
#Run netva using single core/default option for one protein or more than one protein at once
#compatible for all Linux, macOS, and Windows machines
> netva.res <- netva(v[1], bc.net) #Only 1st protein
> netva.res <- netva(v[2], bc.net) #Only 2nd protein
> netva.res <- netva(v[6], bc.net) #Only 6th protein
> netva.res <- netva(v[7], bc.net) #Only 7th protein
> netva.res <- netva(v[c(1, 6, 7)], bc.net) #Three proteins, i.e., 1st, 6th and 7th at once
#Run netva using multiple core option for all proteins one by one (compatible only for all Linux and macOS machines)
> netva.res <- netva(v, bc.net, ncore = 36)
#Run netva using single core/default option for all proteins one by one (compatible with all Linux, macOS, and Windows machines)
> netva.res <- netva(v, bc.net)
#Detect vulnerable proteins (VPs) based on each property one by one
> abc.outliers <- detectVNs(v, netva.res[,1], "ABC") #Average betweenness centrality
> acc.outliers <- detectVNs(v, netva.res[,2], "ACC") #Average closeness centrality
> aec.outliers <- detectVNs(v, netva.res[,3], "AEC") #Average eccentricity
> anc.outliers <- detectVNs(v, netva.res[,4], "ANC") #Average node connectivity
> apl.outliers <- detectVNs(v, netva.res[,5], "APL") #Average path length
> apn.outliers <- detectVNs(v, netva.res[,6], "APN") #Articulation point
> cco.outliers <- detectVNs(v, netva.res[,7], "CCO") #Clustering coefficient
> coh.outliers <- detectVNs(v, netva.res[,8], "COH") #Cohesiveness
> com.outliers <- detectVNs(v, netva.res[,9], "COM") #Compactness
> gef.outliers <- detectVNs(v, netva.res[,10], "GEF") #Global efficiency
> het.outliers <- detectVNs(v, netva.res[,11], "HET") #Heterogeneity
> nce.outliers <- detectVNs(v, netva.res[,12], "NCE") #Network centralization
> nde.outliers <- detectVNs(v, netva.res[,13], "NDE") #Network density
> ndi.outliers <- detectVNs(v, netva.res[,14], "NDI") #Network diameter
#Vulnerability analysis for the detection of most vulnerable edges i.e. node pairs (VPPs)
> v.list = combn(v, 2, simplify = FALSE)
> netva.res <- netva(v.list, bc.net, ncore = 36)
> abc.outliers <- detectVNs(v, netva.res[,1], "ABC") #Average betweenness centrality
> acc.outliers <- detectVNs(v, netva.res[,2], "ACC") #Average closeness centrality
> aec.outliers <- detectVNs(v, netva.res[,3], "AEC") #Average eccentricity
> anc.outliers <- detectVNs(v, netva.res[,4], "ANC") #Average node connectivity
> apl.outliers <- detectVNs(v, netva.res[,5], "APL") #Average path length
> apn.outliers <- detectVNs(v, netva.res[,6], "APN") #Articulation point
> cco.outliers <- detectVNs(v, netva.res[,7], "CCO") #Clustering coefficient
> coh.outliers <- detectVNs(v, netva.res[,8], "COH") #Cohesiveness
> com.outliers <- detectVNs(v, netva.res[,9], "COM") #Compactness
> gef.outliers <- detectVNs(v, netva.res[,10], "GEF") #Global efficiency
> het.outliers <- detectVNs(v, netva.res[,11], "HET") #Heterogeneity
> nce.outliers <- detectVNs(v, netva.res[,12], "NCE") #Network centralization
> nde.outliers <- detectVNs(v, netva.res[,13], "NDE") #Network density
> ndi.outliers <- detectVNs(v, netva.res[,14], "NDI") #Network diameter
#Detect hubs and bottlenecks
> hubs <- detectHubs(bc.net)
> bottlenecks <- detectBottlenecks(bc.net)
#EVC and EVC+ of all nodes in bc.net
> evc.bcnet <- evc(bc.net)
#Detect influential proteins
> detectINs(bc.net)
#Calculate the value of heterogeneity of a network
> net.het <- heterogeneity(bc.net)
#Calculate the value of cohesiveness of a network
> coh.cent <- cohesiveness(net = bc.net)
#Calculate the value of cohesiveness of the network after the removal of node "UBC"
> coh.cent <- cohesiveness(v = "UBC", net = bc.net)
#Calculate the value of compactness of a network
> com.cent <- compactness(net = bc.net)
#Calculate the value of compactness of the network after the removal of node "UBC"
> com.cent <- compactness(v = "UBC", net = bc.net)