Skip to content

Commit

Permalink
import igraph >= 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiLiubio committed Jul 12, 2024
1 parent eb9da6e commit f5459bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Maintainer: Chi Liu <[email protected]>
Description: A series of statistical and plotting approaches in microbial community ecology based on the R6 class. The classes are designed for data preprocessing, taxa abundance plotting, alpha diversity analysis, beta diversity analysis, differential abundance test, null model analysis, network analysis, machine learning, environmental data analysis and functional analysis.
URL: https://github.com/ChiLiubio/microeco
Depends: R (>= 3.5.0)
Imports: R6, stats, ape, vegan, rlang, data.table, magrittr, dplyr, tibble, scales, grid, ggplot2 (>= 3.5.0), RColorBrewer, reshape2, igraph
Imports: R6, stats, ape, vegan, rlang, data.table, magrittr, dplyr, tibble, scales, grid, ggplot2 (>= 3.5.0), RColorBrewer, reshape2, igraph (>= 2.0.0)
Suggests: GUniFrac, MASS, ggpubr, randomForest, ggdendro, ggrepel, agricolae, gridExtra, picante, pheatmap, rgexf, mice, GGally
License: GPL-3
LazyData: true
Expand Down
4 changes: 2 additions & 2 deletions R/trans_network.R
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ trans_network <- R6Class(classname = "trans_network",
stop("All the correlation coefficients larger than COR_cut parameter are not significant under current COR_p_thres parameter!")
}
cor_matrix[cor_matrix != 1] <- 0
network <- graph.adjacency(cor_matrix, mode = "undirected") # graph_from_adjacency_matrix
network <- graph_from_adjacency_matrix(cor_matrix, mode = "undirected")
edges <- t(sapply(1:ecount(network), function(x) ends(network, x)))
E(network)$label <- unlist(lapply(seq_len(nrow(edges)), function(x) ifelse(cortable[edges[x, 1], edges[x, 2]] > 0, "+", "-")))
if(COR_weight == T){
Expand Down Expand Up @@ -414,7 +414,7 @@ trans_network <- R6Class(classname = "trans_network",
b[t(beem.out$resample$b.stab < beemStatic_t_stab)] <- 0
}
b[abs(b) < beemStatic_t_strength] <- 0
network <- graph.adjacency(b, mode = 'directed', weighted = 'weight')
network <- graph_from_adjacency_matrix(b, mode = 'directed', weighted = 'weight')
V(network)$name <- rownames(use_abund)
}
if(ecount(network) == 0){
Expand Down

0 comments on commit f5459bc

Please sign in to comment.