🤔 drawCell | 不会画细胞结构图就用这个R包吧~ Su
写在前面
我们在paper
中经常需要画到细胞结构图
,新手ppt
一点一点画,高手可能会用AI
手搓,土豪直接使用BioRender
。🤒
今天给大家大家分享一个代码画细胞结构图
的R包
,如果你觉得自己不会写代码,不想看了,那你就错过了哦。😜
这个R包
还开发了shiny
,实现交互,鼠标点点就可以完成。🤩
真希望有一天开发出个AI
,人们描绘一下要画什么样的图,就有了,而且还特别有创意,解放我等科研狗的双手。🤣
用到的包
rm(list = ls())
# devtools::install_github("svalvaro/drawCell")
library(drawCell)
library(tidyverse)
Shiny交互式绘图
3.1 开启Shiny
现在做Shinyapp
的越来越多了,方便大家的使用。😙
这里也是一样的,大家运行下面这段代码,开启Shiny
。🤠
drawCell::drawCellShiny()

3.2 选择细胞类型
这里我们做几个示范吧,都很简单。🐶

大家可以选择自己需要的细胞类型,还是挺多的,这个包是基于SwissBioPics API
开发的,所以图片都是来自SwissBioPics
:👇
https://www.swissbiopics.org/

3.3 标记细胞核
我们试着点一下细胞核
,这样就标记上了。🤪

3.4 换个颜色
接着我们试试换一下颜色,这里貌似不能直接输入色号,是个问题。🤨

3.5 标记线粒体
最后再标记一下线粒体
,然后就download
你的图片吧。😘


代码实现绘图
4.1 示例一
我们试着标记人类细胞的内质网
,线粒体
和高尔基体
吧。🤩
颜色的话大家可以去各种取色网站获取,挑选你自己的心头好。😉
drawCell(organism_identifier = '9606',
list_sl_colors = list("SL0173" = "#00337C", "SL0101" = "#03C988","SL0135" = "#FEC868"))

4.2 示例二
画个肌细胞
吧,我们标记一下肌纤维
,线粒体
和细胞桥粒
。😜
drawCell(organism_identifier = '6072',
list_sl_colors = list("SL0312" = "#579BB1", "SL0173" = "#58287F", "SL0092" = "#FBC252"))

4.3 示例三
最后再画个神经元
,我们标记一下髓鞘
,细胞核
和高尔基体
。😜
drawCell(organism_identifier = '6072',
list_sl_colors = list("SL0176" = "#C0DEFF", "SL0191" = "#2B3467", "SL0135" = "#FAAB78"))

补充一下
5.1 物种ID
大家在寻找你需要的物种时,可能不知道对应的代号是什么,其实这个是基于taxonomy id
,大家可以在下面这里查到:👇
https://www.ncbi.nlm.nih.gov/taxonomy/

5.2 亚细胞结构ID
对于需要标记的亚细胞结构
,如细胞核
,线粒体
等,对应的SL codes
可以在这里Uniprot
和uniprotkb_sl2go
找到:👇
1️⃣ https://www.uniprot.org/help?query=subcell

2️⃣ http://current.geneontology.org/ontology/external2go/uniprotkb_sl2go


<center>最后祝大家早日不卷!~</center>
点个在看吧各位~ ✐.ɴɪᴄᴇ ᴅᴀʏ 〰
<center> <b>📍 往期精彩 <b> </center>
📍 <font size=1>🤩 ComplexHeatmap | 颜狗写的高颜值热图代码!</font>
📍 <font size=1>🤥 ComplexHeatmap | 你的热图注释还挤在一起看不清吗!?</font>
📍 <font size=1>🤨 Google | 谷歌翻译崩了我们怎么办!?(附完美解决方案)</font>
📍 <font size=1>🤩 scRNA-seq | 吐血整理的单细胞入门教程</font>
📍 <font size=1>🤣 NetworkD3 | 让我们一起画个动态的桑基图吧~</font>
📍 <font size=1>🤩 RColorBrewer | 再多的配色也能轻松搞定!~</font>
📍 <font size=1>🧐 rms | 批量完成你的线性回归</font>
📍 <font size=1>🤩 CMplot | 完美复刻Nature上的曼哈顿图</font>
📍 <font size=1>🤠 Network | 高颜值动态网络可视化工具</font>
📍 <font size=1>🤗 boxjitter | 完美复刻Nature上的高颜值统计图</font>
📍 <font size=1>🤫 linkET | 完美解决ggcor安装失败方案(附教程)</font>
📍 <font size=1>......</font>
本文由mdnice多平台发布