77# ' PPI function.
88# ' @param export if `TRUE`, exports the analysis table as a csv file
99# ' @param FileName suffix for the file name (if export = TRUE)
10- # ' @importFrom igraph graph.data.frame as_adjacency_matrix distance_table
11- # ' average.path.length get.adjacency V E mean_distance betweenness
10+ # ' @importFrom igraph graph_from_data_frame as_adjacency_matrix distance_table
11+ # ' mean_distance as_adjacency_matrix V E mean_distance betweenness
1212# ' @importFrom NetIndices GenInd
1313# ' @return A network analysis table
1414NetAnalysis <- function (
@@ -17,7 +17,7 @@ NetAnalysis <- function(
1717 stop(" No Protein-Protein Interactions" )
1818 }
1919 df <- data [, - c(1 , 2 )]
20- gg <- graph.data.frame (df )
20+ gg <- graph_from_data_frame (df )
2121 betweenness <- betweenness(gg )
2222 betweenness.table <- data.frame (betweenness )
2323 names <- rownames(betweenness.table )
@@ -38,14 +38,14 @@ NetAnalysis <- function(
3838 write.csv(AnalysisTable , file = paste0(FileName , " .csv" ))
3939 }
4040
41- test.graph.adj <- get.adjacency (gg , sparse = FALSE )
41+ test.graph.adj <- as_adjacency_matrix (gg , sparse = FALSE )
4242 test.graph.properties <- GenInd(test.graph.adj )
4343 message(" Number of nodes: " , test.graph.properties $ N )
4444 message(" Number of links: " , test.graph.properties $ Ltot )
4545 message(" Link Density: " , test.graph.properties $ LD )
4646 message(" The connectance of the graph: " , test.graph.properties $ C )
4747 message(" Mean Distences" , mean_distance(gg ))
48- message(" Average Path Length" , average.path.length (gg ), " \n " )
48+ message(" Average Path Length" , mean_distance (gg ), " \n " )
4949 AnalysisTable <-
5050 AnalysisTable [order(AnalysisTable [, 2 ], decreasing = TRUE ), ]
5151 return (AnalysisTable )
0 commit comments