当前位置: 首页 > news >正文

在线制作网站表白哪些网站可以发广告

在线制作网站表白,哪些网站可以发广告,网站建设和优化的营销话术,福田的网站建设公司1写在前面 好久没更了,实在是太忙了,值班真的是根本不不睡觉啊,一忙一整天,忙到怀疑人生。😭 最近看到比较🔥的就是ggkegg包,感觉使用起来还是有一定难度的。🫠 和大家分享一下使用教…

1写在前面

好久没更了,实在是太忙了,值班真的是根本不不睡觉啊,一忙一整天,忙到怀疑人生。😭

最近看到比较🔥的就是ggkegg包,感觉使用起来还是有一定难度的。🫠

和大家分享一下使用教程吧,还有一些小坑。💪

2用到的包

rm(list = ls())
library(ggkegg)
library(ggfx)
library(ggraph)
library(igraph)
library(clusterProfiler)
library(dplyr)
library(tidygraph)

3小试牛刀

首先以eco00270为例,获取后转换路径和eco标识符,删除无连接节点并返回igraph对象。🤪

g <- ggkegg(pid="eco00270",
convert_org = c("pathway","eco"),
delete_zero_degree = T,
return_igraph = T)

gg <- ggraph(g, layout="stress")
gg$data$type %>% unique()

gg + geom_edge_diagonal(
aes(color=subtype_name,
filter=type!="maplink"))+
geom_node_point(
aes(filter= !type%in%c("map","compound")),
fill=gg$data[!gg$data$type%in%c("map","compound"),]$bgcolor,
color="black",
shape=21, size=4
)+
geom_node_point(
aes(filter= !type%in%c("map","gene")),
fill=gg$data[!gg$data$type%in%c("map","gene"),]$bgcolor,
color="black",
shape=21, size=6
)+
geom_node_text(
aes(label=converted_name,
filter=type=="gene"),
repel=T,
bg.colour="white")+
theme_void()
alt

4改变nodes颜色

颜狗必备技能,修改配色。😘

g <- pathway("ko00520")
V(g)$color_one <- colorRampPalette(RColorBrewer::brewer.pal(5,"Set1"))(length(V(g)))
V(g)$color_two <- colorRampPalette(RColorBrewer::brewer.pal(5,"Set2"))(length(V(g)))

ggraph(g, x=x, y=y) +
geom_node_rect(aes(xmin=xmin, xmax=x, fill=I(color_one)), alpha=0.5)+
geom_node_rect(aes(xmin=x, xmax=xmax, fill=I(color_two)), alpha=0.5)+
ggfx::with_outer_glow(geom_node_text(aes(label=name %>%
strsplit(":") %>%
sapply("[", 2) %>%
strsplit(" ") %>%
sapply("[", 1),
filter=type=="ortholog"),
size=2), colour="white", expand=1)
alt

V(g)$color_one <- colorRampPalette(RColorBrewer::brewer.pal(5,"Set1"))(length(V(g)))
V(g)$color_two <- colorRampPalette(RColorBrewer::brewer.pal(5,"Set2"))(length(V(g)))
V(g)$color_three <- colorRampPalette(RColorBrewer::brewer.pal(5,"PuOr"))(length(V(g)))
V(g)$color_four <- colorRampPalette(RColorBrewer::brewer.pal(5,"Paired"))(length(V(g)))

V(g)$space <- V(g)$width/4

ggraph(g, x=x, y=y) +
geom_node_rect(aes(xmin=xmin, xmax=xmin+space, fill=I(color_one), filter=type=="ortholog"))+
geom_node_rect(aes(xmin=xmin+space, xmax=xmin+2*space, fill=I(color_two), filter=type=="ortholog"))+
geom_node_rect(aes(xmin=xmin+2*space, xmax=xmin+3*space, fill=I(color_three), filter=type=="ortholog"))+
geom_node_rect(aes(xmin=xmin+3*space, xmax=xmin+4*space, fill=I(color_four), filter=type=="ortholog"))+
ggfx::with_outer_glow(geom_node_text(aes(label=name %>%
strsplit(":") %>%
sapply("[", 2) %>%
strsplit(" ") %>%
sapply("[", 1),
filter=type=="ortholog"),
size=2), colour="white", expand=1)+
theme_void()
alt

5Global maps展示

更宏观的展示结果。🤩

pathway("ko01200") %>% 
process_reaction() %>%
activate(nodes) %>%
mutate(x=NULL, y=NULL,
comp=convert_id("compound")) %>%
mutate(degree=centrality_degree(mode="all")) %>%
ggraph(layout="kk")+
geom_node_point(aes(color=degree,
filter=type=="compound"))+
geom_edge_parallel(
color="grey",
end_cap=circle(1,"mm"),
start_cap=circle(1,"mm"),
arrow=arrow(length=unit(1,"mm"),type="closed"))+
geom_node_text(aes(label=comp,filter=degree>15),
repel=TRUE, bg.colour="white")+
theme_graph()
alt

6highlight指定nodes和edges

可以使用highligh_set_edgeshighlight_set_nodes函数突出你想要突出的nodesedges。😘

pathway("ko01230") %>% 
process_line() %>%
activate(nodes) %>%
mutate(
compound=convert_id("compound"),
M00002=highlight_set_nodes(module("M00002")@reaction_components)) %>%
activate(edges) %>%
mutate(M00002=highlight_set_edges(module("M00002")@definition_components)) %>%
ggraph(x=x, y=y)+
geom_edge_link()+
with_outer_glow(geom_edge_link(aes(color=M00002, filter=M00002)),
colour="pink")+
geom_node_point(shape=21,aes(filter=type!="line"))+
with_outer_glow(geom_node_point(shape=21, aes(filter=M00002, color=M00002)),
colour="pink")+
geom_node_text(aes(label=compound, filter=M00002), repel=TRUE,
bg.colour="white", size=2)+
theme_void()
alt

我们试着突出一下代谢相关pathwayko01100),需要用到M00021module。😋

g <- pathway("ko01100") %>% 
process_line() %>%
highlight_module(module("M00021")) %>%
mutate(compound=convert_id("compound"))

g %>% ggraph(x=x, y=y) +
geom_node_point(size=1, aes(color=I(fgcolor),
filter=fgcolor!="none" & type!="line"))+
geom_edge_link(width=0.1, aes(color=I(fgcolor),
filter=type=="line"& fgcolor!="none"))+
with_outer_glow(
geom_edge_link(width=1,
aes(color=I(fgcolor),
filter=fgcolor!="none" & M00021)),
colour="red", expand=3
)+
with_outer_glow(
geom_node_point(size=2,
aes(color=I(fgcolor),
filter=fgcolor!="none" & M00021)),
colour="red", expand=3
)+
theme_void()
alt

可以看到多个module涉及Cysteinemethionine的代谢,我们可以通过使用ggforce来高亮M00017。😘

list_of_modules <- c("M00021","M00338","M00609","M00017","M00034","M00035","M00368")
for (mm in list_of_modules) {
g <- g %>% highlight_module(module(mm))
}

ggraph(g,x=x,y=y,layout="manual") +
geom_edge_link0(width=0.5, color="grey")+
geom_edge_link(color="red",aes(filter=M00017|M00021|M00338|M00609|M00034|M00035|M00368))+
geom_node_point(size=2, color="red",aes(filter=M00017|M00021|M00338|M00609|M00034|M00035|M00368))+
ggforce::geom_mark_rect(aes(fill=M00017,
label=module("M00017")@name,
x=x, y=y,
group=M00017,
filter=M00017),
label.fill = "transparent",
label.fontsize = 10,
expand=unit(1,"mm"))+
theme_void()
alt

可视化一下compounds,可以用geom_node_text,ggrepel, 和shadowtext。🤪

Rg %>% ggraph(x=x, y=y) +
geom_node_point(size=1, aes(color=I(fgcolor),
filter=fgcolor!="none" & type!="line"))+
geom_edge_link(width=0.1, aes(color=I(fgcolor),
filter=type=="line"& fgcolor!="none"))+
with_outer_glow(
geom_edge_link(width=1,
aes(color=I(fgcolor),
filter=fgcolor!="none" & M00021)),
colour="red", expand=3
)+
with_outer_glow(
geom_node_point(size=2,
aes(color=I(fgcolor),
filter=fgcolor!="none" & M00021)),
colour="red", expand=3
)+
geom_node_text(aes(label=compound, filter=M00021),
repel=T, bg.colour="white", size=5)+
theme_void()
alt

局部放大一下!~😘

annot <- g %>%  ggraph(x=x, y=y)+
with_outer_glow(
geom_edge_link(width=1,
aes(color=I(fgcolor),
filter=fgcolor!="none" & M00021)),
colour="red", expand=3
)+
with_outer_glow(
geom_node_point(size=2,
aes(color=I(fgcolor),
filter=fgcolor!="none" & M00021)),
colour="red", expand=3
)+
geom_node_text(aes(label=compound, filter=M00021),
repel=TRUE, bg.colour="white", size=5)
g %>%
ggraph(x=x, y=y) +
geom_node_point(size=1, aes(color=I(fgcolor),
filter=fgcolor!="none" & type!="line"))+
geom_edge_link(width=0.1, aes(color=I(fgcolor),
filter=type=="line"& fgcolor!="none"))+
with_outer_glow(
geom_edge_link(width=1,
aes(color=I(fgcolor),
filter=fgcolor!="none" & M00021)),
colour="red", expand=3
)+
with_outer_glow(
geom_node_point(size=2,
aes(color=I(fgcolor),
filter=fgcolor!="none" & M00021)),
colour="red", expand=3
)+
annotation_custom(ggplotify::as.grob(annot),
ymin=-1500, ymax=0, xmin=0, xmax=1500)+
theme_void()
alt

alt
最后祝大家早日不卷!~

点个在看吧各位~ ✐.ɴɪᴄᴇ ᴅᴀʏ 〰

📍 往期精彩

📍 🤩 LASSO | 不来看看怎么美化你的LASSO结果吗!?
📍 🤣 chatPDF | 别再自己读文献了!让chatGPT来帮你读吧!~
📍 🤩 WGCNA | 值得你深入学习的生信分析方法!~
📍 🤩 ComplexHeatmap | 颜狗写的高颜值热图代码!
📍 🤥 ComplexHeatmap | 你的热图注释还挤在一起看不清吗!?
📍 🤨 Google | 谷歌翻译崩了我们怎么办!?(附完美解决方案)
📍 🤩 scRNA-seq | 吐血整理的单细胞入门教程
📍 🤣 NetworkD3 | 让我们一起画个动态的桑基图吧~
📍 🤩 RColorBrewer | 再多的配色也能轻松搞定!~
📍 🧐 rms | 批量完成你的线性回归
📍 🤩 CMplot | 完美复刻Nature上的曼哈顿图
📍 🤠 Network | 高颜值动态网络可视化工具
📍 🤗 boxjitter | 完美复刻Nature上的高颜值统计图
📍 🤫 linkET | 完美解决ggcor安装失败方案(附教程)
📍 ......

alt

alt

alt

本文由 mdnice 多平台发布

http://www.ds6.com.cn/news/12160.html

相关文章:

  • 聊城做企业网站的头条新闻今日头条官方版本
  • 苏州专业高端网站建设公司哪家好网站点击软件排名
  • 贵阳市做网站的公司有哪些代运营网店公司
  • 邢台168交友最新信息百度seo教程
  • 网站建设与管理 教学视频广州seo快速排名
  • wordpress子目录多站点设置平台推广怎么做
  • 淘宝上做微请帖的在哪个网站免费正规大数据查询平台
  • 阿里巴巴上怎样做自己的网站seo机构
  • 泉州网站建设推广网络科技公司
  • 网站建设管理做什么长春seo
  • 网站开发的系统设计怎么写百度地图排名怎么优化
  • 信息技术课做网站域名备案查询
  • 设计网站有哪些海外品牌推广
  • 51zwd做网站百度指数数据官网
  • 淘宝网站750海报怎么做优化大师官方正版下载
  • 优秀网站设计作品分析深圳seo优化排名公司
  • 国家企业信息公示信息官网哪里有网站推广优化
  • 如何自己做网站界面千峰培训出来好就业吗
  • 网站备案时网站没有内容可以百度app浏览器下载
  • 青岛出版集团网站百度搜索引擎优化
  • 中山网站建设是什么意思如何制作一个网页链接
  • 揭阳seo网站管理大数据营销系统多少钱
  • 全屏网站模板发稿吧
  • 枣庄专业做网站搜索竞价排名
  • 做政府网站预算建立企业网站步骤
  • 嘉定建站公司2023引流软件
  • 做外单网站有哪些国外seo比较好的博客网站
  • 河北省住房城乡建设局网站首页营销策划书格式及范文
  • 可信网站 收费网站设计培训
  • 珠宝网站建设方案网络整合营销的特点有