• 主页
  • 课程

    关于课程

    • 课程归档
    • 成为一名讲师
    • 讲师信息
    教学以及管理操作教程

    教学以及管理操作教程

    ¥1,000.00 ¥100.00
    阅读更多
  • 特色
    • 展示
    • 关于我们
    • 问答
  • 事件
  • 个性化
  • 博客
  • 联系
  • 站点资源
    有任何问题吗?
    (00) 123 456 789
    weinfoadmin@weinformatics.cn
    注册登录
    恒诺新知
    • 主页
    • 课程

      关于课程

      • 课程归档
      • 成为一名讲师
      • 讲师信息
      教学以及管理操作教程

      教学以及管理操作教程

      ¥1,000.00 ¥100.00
      阅读更多
    • 特色
      • 展示
      • 关于我们
      • 问答
    • 事件
    • 个性化
    • 博客
    • 联系
    • 站点资源

      老俊俊的生信笔记

      • 首页
      • 博客
      • 老俊俊的生信笔记
      • sankeywheel 绘制唯美桑基图

      sankeywheel 绘制唯美桑基图

      • 发布者 weinfoadmin
      • 分类 老俊俊的生信笔记
      • 日期 2022年3月29日
      测试开头

      sankeywheel 绘制唯美桑基图

      点击上方关注老俊俊

      1引言

      分享一个包 sankeywheel 来绘制唯美的桑基图,横的和环形的皆可。这个包也是整合了 circlize, networkD3, 和 ggalluvial 三个强大的 R 包来进行可视化的。

      2安装

      devtools::install_github('czxa/sankeywheel', build_vignettes = TRUE)
      # or just use git
      devtools::install_git("https://github.com/czxa/sankeywheel.git", build_vignettes = TRUE)

      # CRAN
      install.packages("sankeywheel")

      3使用

      加载内置测试数据:

      library(sankeywheel)

      data(sankeydf)

      # check
      head(sankeydf,3)
      #     from       to weight
      # 1 Brazil Portugal      5
      # 2 Brazil   France      1
      # 3 Brazil    Spain      1

      环形:

      sankeywheel(from = sankeydf$from,
                  to = sankeydf$to,
                  weight = sankeydf$weight,
                  type = "dependencywheel",
                  width = "100%")
      sankeywheel 绘制唯美桑基图

      点击右边按钮可以下载:

      sankeywheel 绘制唯美桑基图

      横向:

      sankeywheel(from = sankeydf$from,
                  to = sankeydf$to,
                  weight = sankeydf$weight,
                  type = "sankey",
                  width = "100%")
      sankeywheel 绘制唯美桑基图

      作者还给了多个不同的主题可以选择:

      install.packages('manipulateWidget')
      library(manipulateWidget)

      combineWidgets(
        sankeywheel(from = sankeydf$from,
                  to = sankeydf$to,
                  weight = sankeydf$weight,
                  type = "sankey",
                  width = "100%",
                  theme = "sunset",
                  title = "SUNSET"),
        sankeywheel(from = sankeydf$from,
                  to = sankeydf$to,
                  weight = sankeydf$weight,
                  type = "dependencywheel",
                  width = "100%",
                  theme = "sunset",
                  title = "SUNSET"),
        byrow = TRUE, ncol = 2, width = "100%", height = "300px"
      )
      sankeywheel 绘制唯美桑基图

      其它参数:

      sankeywheel(from = sankeydf$from,
                  to = sankeydf$to,
                  weight = sankeydf$weight,
                  type = "dependencywheel",
                  seriesName = "Random data: ",
                  width = "100%",
                  height = "400px",
                  theme = "sunset",
                  title = "SUNSET",
                  titleAlign = "center",
                  titleSize = "18px",
                  titleColor = "black",
                  subtitle = "czxa.top",
                  subtitleAlign = "center",
                  subtitleSize = "14px",
                  subtitleColor = "black")
      sankeywheel 绘制唯美桑基图

      4所有主题绘制

      combineWidgets(
        sankeywheel(from = sankeydf$from,
                    to = sankeydf$to,
                    weight = sankeydf$weight,
                    type = "dependencywheel",
                    width = "100%",
                    theme = "darkgreen",
                    title = "darkgreen"),
        sankeywheel(from = sankeydf$from,
                    to = sankeydf$to,
                    weight = sankeydf$weight,
                    type = "dependencywheel",
                    width = "100%",
                    theme = "darkblue",
                    title = "darkblue"),
        sankeywheel(from = sankeydf$from,
                    to = sankeydf$to,
                    weight = sankeydf$weight,
                    type = "dependencywheel",
                    width = "100%",
                    theme = "avocado",
                    title = "avocado"),
        sankeywheel(from = sankeydf$from,
                    to = sankeydf$to,
                    weight = sankeydf$weight,
                    type = "dependencywheel",
                    width = "100%",
                    theme = "darkunica",
                    title = "darkunica"),
        sankeywheel(from = sankeydf$from,
                    to = sankeydf$to,
                    weight = sankeydf$weight,
                    type = "dependencywheel",
                    width = "100%",
                    theme = "gray",
                    title = "gray"),
        sankeywheel(from = sankeydf$from,
                    to = sankeydf$to,
                    weight = sankeydf$weight,
                    type = "dependencywheel",
                    width = "100%",
                    theme = "gridlight",
                    title = "gridlight"),
        sankeywheel(from = sankeydf$from,
                    to = sankeydf$to,
                    weight = sankeydf$weight,
                    type = "dependencywheel",
                    width = "100%",
                    theme = "grid",
                    title = "grid"),
        sankeywheel(from = sankeydf$from,
                    to = sankeydf$to,
                    weight = sankeydf$weight,
                    type = "dependencywheel",
                    width = "100%",
                    theme = "sandsignika",
                    title = "sandsignika"),
        sankeywheel(from = sankeydf$from,
                    to = sankeydf$to,
                    weight = sankeydf$weight,
                    type = "dependencywheel",
                    width = "100%",
                    theme = "sunset",
                    title = "sunset"),
        byrow = TRUE, ncol = 3, width = "100%", height = "800px"
      )
      sankeywheel 绘制唯美桑基图

      那么你喜欢哪一个呢?

      sankeywheel 绘制唯美桑基图



      sankeywheel 绘制唯美桑基图


      欢迎加入生信交流群。加我微信我也拉你进 微信群聊 老俊俊生信交流群 哦,数据代码已上传至QQ群,欢迎加入下载。

      群二维码:

      sankeywheel 绘制唯美桑基图


      老俊俊微信:


      sankeywheel 绘制唯美桑基图

      知识星球:


      sankeywheel 绘制唯美桑基图


      所以今天你学习了吗?

      今天的分享就到这里了,敬请期待下一篇!

      最后欢迎大家分享转发,您的点赞是对我的鼓励和肯定!

      如果觉得对您帮助很大,赏杯快乐水喝喝吧!



       往期回顾 





      ◀ggplot 绘制小提琴图+箱线图+统计检验

      ◀Ribo-seq 数据上游分析

      ◀关于序列提取的问题思考

      ◀跟着 Cell Reports 学做图-CLIP-seq 数据可视化

      ◀m6A enrichment on peak center

      ◀m6A metagene distribution 纠正坐标

      ◀ggplot 绘制箱线图

      ◀python 查找字符串

      ◀tornadoplot 绘制富集热图

      ◀m6A metagene distribution 计算详解

      ◀...

      测试结尾

      请关注“恒诺新知”微信公众号,感谢“R语言“,”数据那些事儿“,”老俊俊的生信笔记“,”冷🈚️思“,“珞珈R”,“生信星球”的支持!

      • 分享:
      作者头像
      weinfoadmin

      上一篇文章

      ggplot 绘制小提琴图+箱线图+统计检验
      2022年3月29日

      下一篇文章

      pysam 读取 bam 文件准备 Ribo-seq 质控数据
      2022年3月30日

      你可能也喜欢

      8-1651542331
      跟着Nature学绘图(2) 箱线图-累积分布曲线图
      2 5月, 2022
      9-1651542322
      Julia 笔记之字符串
      2 5月, 2022
      0-1651542343
      Julia 笔记之数学运算和初等函数
      1 5月, 2022

      搜索

      分类

      • R语言
      • TCGA数据挖掘
      • 单细胞RNA-seq测序
      • 在线会议直播预告与回放
      • 数据分析那些事儿分类
      • 未分类
      • 生信星球
      • 老俊俊的生信笔记

      投稿培训

      免费

      alphafold2培训

      免费

      群晖配置培训

      免费

      最新博文

      Nature | 单细胞技术揭示衰老细胞与肌肉再生
      301月2023
      lncRNA和miRNA生信分析系列讲座免费视频课和课件资源包,干货满满
      301月2023
      如何快速批量修改 Git 提交记录中的用户信息
      261月2023
      logo-eduma-the-best-lms-wordpress-theme

      (00) 123 456 789

      weinfoadmin@weinformatics.cn

      恒诺新知

      • 关于我们
      • 博客
      • 联系
      • 成为一名讲师

      链接

      • 课程
      • 事件
      • 展示
      • 问答

      支持

      • 文档
      • 论坛
      • 语言包
      • 发行状态

      推荐

      • iHub汉语代码托管
      • iLAB耗材管理
      • WooCommerce
      • 丁香园论坛

      weinformatics 即 恒诺新知。ICP备案号:粤ICP备19129767号

      • 关于我们
      • 博客
      • 联系
      • 成为一名讲师

      要成为一名讲师吗?

      加入数以千计的演讲者获得100%课时费!

      现在开始

      用你的站点账户登录

      忘记密码?

      还不是会员? 现在注册

      注册新帐户

      已经拥有注册账户? 现在登录

      close
      会员购买 你还没有登录,请先登录
      • ¥99 VIP-1个月
      • ¥199 VIP-半年
      • ¥299 VIP-1年
      在线支付 激活码

      立即支付
      支付宝
      微信支付
      请使用 支付宝 或 微信 扫码支付
      登录
      注册|忘记密码?