前面也测试过好几个画饼图的方法。最近看到在展示单细胞数据的时候,别人展示的这个不同层的比例挺好看的,看了一下,是宏基因组领域展示物种分类常用的工具:krona。所以,我们学习测试一下krona来如何做多层饼图。

#下面是宏基因组物种的展示。

官方地址:https://github.com/marbl/Krona/releases/
网上说的有windows版本也有linux版本,但是我看windows版本只有2.4有:
https://github.com/marbl/Krona/releases/tag/xl2.4
======windows版本测试======
使用起来很简单,解压压缩文件,点击文件夹中的install_Windows.vbs文件,就可以安装了。使用的时候打开文件夹里面的Krona.xltm文件,类似打开excel文件。

其中数据格式方面:Granola1/2为样品值和颜色控制(网上建议:属于optional,可以不填),可添加或减少样品数量。最后一组Serving为值对应的名称和分类级别,并且允许注释值缺失。
然后点击Create chart就可以创建一个html的文件了。

现在我们测试NC那个paper中的结果,按例子的格式,把单细胞的结果替换进去。

从最里面到最外面的圆环分别是Cells下面对应不同的分类级别。

网上说点击页面snapshot,就可以将文件下载为svg格式了,用AI打开就是矢量图。可是我用firefox打开点击snapshot的时候一闪而过,不确定问题出在了哪里。
======linux版本测试======
安装:conda install -c bioconda krona #我喜欢用conda安装,所以就用从大了,当然官网也提供了源码安装
输入数据:数据不能有列名,数据的顺序分别是,第一列是数值,后面依次是第一、二、三级分类。将文件保存为text文件。分析也是ktImportText命令一行代码完成。

命令:ktImportText input.txt -o cell.html #可以看出和前面windows差不多的效果

网友评论