setwd("D:/KS项目/公众号文章/互作网络图")
gene_info <- read.csv("gene_group.csv", header = T)
interaction <- read.csv("string_interactions.csv", header = T)
library(igraph)
library(ggraph)
library(tidyverse)
library(tidygraph)
graph <- as_tbl_graph(interaction) %>%
mutate(interaction = centrality_degree(mode='out'),
group=gene_info$group)
ggraph(graph, layout = 'kk') + geom_edge_fan(color='grey60', show.legend=T) + geom_node_point(aes(size = interaction, fill=factor(group)), shape=21)+ geom_node_text(aes(filter= interaction>5, label=name), size=2.5, repel = T)+ theme_graph()
ggraph(graph, layout = 'kk') + geom_edge_fan(color='grey60', show.legend=T, aes(edge_width=automated_textmining)) + geom_node_point(aes(size = interaction, fill=factor(group)), shape=21)+ geom_node_text(aes(filter= interaction>5, label=name), size=2.5, repel = T)+ scale_edge_width(range=c(0,1))
联系客服