我有所有分类级别的细菌OTU表。我想用I(或任何其他包)来绘制网络。我从来没有创建过这样的情节,所以如果有人知道一些初学者的教程链接?或者,如果有人用剧本指导我,你的时间会很感激的。谢谢!
发布于 2020-05-28 16:54:16
edgeslistnodeslist。1. Then, you have to create an Igraph object with `igraph::graph_from_data_frame(edgeslist, directed = F, vertices = nodeslist)`
2. And you can access to this object for compile a bunch of global statistics or obtain some new-data associated with some nodes (e.g., `cliques <- igraph::largest_cliques(mygraph)` or `igraph::edge_density(mygraph, loops=T)` )
3. Or access to a very precise set of nodes or edges (e.g., `igraph::E(mygraph)$weight <- 1` or whatever func.
4. I suggest to play with the edge-list and the tidyverse, in order to made group-statistics.
尝试找到一些现有的教程,如这一个。
发布于 2020-05-29 19:13:26
我不明白您有哪些数据,这里是一个用于小网络分析的例程:
- FOR SMALL GRAPH ONLY, you start by plotting and read the plot. Hereafter, an edges-list sent to igraph and plotted, assuming you require about the tidyverse syntax (`%>%`): myedgeslist <- data.frame(from = c('man1', 'man2','man3', 'man3'), to = c('man3','man1','man1', 'man2') ) mygraph <- myedgeslist %>% igraph::graph_from_data_frame(directed = T) mygraph %>% igraph::plot.igraph()
在3个节点之间用4个链路绘制了一个小的有向网络( IGRAPH DN-- 3 4 --表示DN有向网络,3个节点和4个链路)。
myedgeslist %>% group_by(to) %>% summarise(nlinksto= n(), n_nodes=n_distinct(from)) %>% arrange(desc(n_nodes))说'man1‘是最核心的节点,因为有2个链接给他( man3和man2只有一个链接)。
mygraph %>% igraph::edge_density()说,66 %的有向链路是在这个网络中实现的。PS:绘制大型网络通常是个坏主意,你必须将它们分成几个部分,或者通过全局/分组统计数据恢复网络。
https://stackoverflow.com/questions/62069657
复制相似问题