美文网首页Data scienceR plot
在线作图|如何绘制一张相关性桑基图

在线作图|如何绘制一张相关性桑基图

作者: 维凡生物 | 来源:发表于2021-09-06 08:47 被阅读0次

相关性桑基图

桑基图即桑基能量分流图,用来展示数据的“流动”变化,分支的宽度表示流量的大小,应用于能量流向等数据的可视化。桑基图主要由边、流量和支点组成,其中边代表了流动的数据,流量代表了流动数据的具体数值,节点代表了不同分类。边的宽度与流量成比例的显示,边越宽,数值越大。
相关性桑基图属于桑基图的一种,在交互式的网页中,红色和蓝色连线分别表示正负相关,连线宽度和相关性强度成正比,节点按预定于的环境属性分类赋值颜色,鼠标停留位置可以在图中显示节点/连线的属性信息,并可以从图中拖动调整节点位置。

应用举例:
There was a large degree of mismatch between farmer reports and DNA fngerprinting results, with only 28% of farmers (n=989 out of 3543 samples identifed using DNA fngerprinting) able to provide a name for the variety they have grown that exactly matched the corre_x0002_sponding DNA result from the same plot. Mismatches for eight widely grown varieties are illustrated in Fig. 2. Ambiguity was also much higher using farmer recall with 49% (1917 out of 3880 farmer reports) classed as “unimproved/local”, “improved” or “unknown”—i.e. not assigned to any known variety. A large proportion of the farmer reports were either “local” or “unimproved” (n=1233; 32% of reports), but DNA results generally did not support this farmer classifcation. Based on DNA data, the majority of these farmers were actually grow_x0002_ing released improved varieties, albeit of varying age post release. Te bulk of unidentifed samples from DNA fngerprinting (4% of 3771 genotyped samples) were actually Triticale and not wheat. Te DNA fngerprinting could thus potentially be made even more accurate by expanding the reference library, possibly including wheat related species such as Triticale where relevant.

Figure 2. Sankey diagram illustrating the relationship between widely grown wheat varieties identified by DNA fingerprinting (left) and corresponding wheat variety names given by farmers (right) for the same plot. Box height indicates the percentage of total varieties, while lines illustrate the relationship [created by MJ using R 4.0.2 https://www.r-graph-gallery.com/sankey-diagram.html]. 参考文献:Ethiopia’s transforming wheat landscape: tracking variety use through DNA fingerprinting. (Figure 2)

TUTU云工具使用

云图图可以画!!操作步骤如下:
①登录网址:https://www.cloudtutu.com/#/index(推荐使用360或者谷歌浏览器)
②输入用户名和密码(已经填好了),输入验证码后即可登录,无需注册,直接使用;
③登录后在工具一栏(全部工具)里找到相关性桑基图,点击进入;
④请按照界面右侧的说明书或者下文进行操作。

Step 01 上传文件

※目前平台仅支持.txt(制表符分隔)文本文件或者.csv文件的文件上传。(平台可对不规范的数据格式进行部分处理,但还是请您尽量按照示例数据的格式调整数据,以便机器可以识别)
a)准备一个数据矩阵(形式参照示例数据);
b)表格需要带表头和列名,每一列为各种指标数据名,每一行为样本名;
c)请提交txt(制表符分隔)文本文件或者.csv文件。操作方法为:全选excel中的所有内容(ctrl+A),复制到记事本中,将记事本文件另存后点击“上传”按钮上传该文件。

image

Step 02 参数设置

2.1 在界面右侧编辑分组信息:需要对各指标进行分组,本网站支持在线修改分组名称的功能。有在线输入(方式一)和手动粘贴(方式二)两种方式。(绘图前必须检查分组名称)


image.png

2.2 方法选择:本平台提供spearman、pearson两种方法选择

Step 03 网页预览

点击“运行”开始作图,出图后可选择“网页预览”的方式进行在线查看。预览小工具使用方法如下:

image

Step 04 下载文件

点击“运行”开始作图,点击“下载”保存PDF格式的矢量图。PDF格式的文件可通过矢量图编辑工具进行编辑。

image

Step 05 作图后处理

TUTU云平台提供的是PDF格式的矢量图,可通过矢量图处理软件进行编辑和调整(如:文字字体,文字大小,图片分辨率等)。

相关文章

网友评论

    本文标题:在线作图|如何绘制一张相关性桑基图

    本文链接:https://www.haomeiwen.com/subject/nlcoiltx.html