简体   繁体   English

指定地块中混凝土分支的宽度。

[英]especify width to concrete branches in a plot.phylo

I want to mark different branches on a phylogenetic tree using 3 different line widths. 我想使用3种不同的线宽在系统发育树上标记不同的分支。 How can I especify that branch 2 has width= 2, line 10 has width= 4 and the remaining lines have width=1? 我如何确定分支2的宽度为2,第10行的宽度为4,其余的行的宽度为1? For example, there are 88 branches in the bird.orders dataset 例如,bird.orders数据集中有88个分支

data(bird.orders)
bird.orders@edge

This, obviously does not do anything 这显然什么也没做

plot(bird.orders, edge.width = c(bird.orders$edge[2]==2, bird.orders$edge[10]==4, bird.orders$edge[-c(2,10)]==1))

Thank you! 谢谢!

First you need to figure out the edge order, which apparently follows these rules when the argument direction of plot.phylo() is set direction='leftwards' : 首先,您需要确定边缘顺序,当plot.phylo()的参数方向设置为direction='leftwards' plot.phylo() direction='leftwards'时,显然遵循这些规则:

  1. go left up to the farthest branch tip (leaf) 左转到最远的分支尖端(叶)
  2. then go right 然后往右走
  3. then go down 然后下去
  4. each time a branch splits, repeat 1 to 3 每次分支拆分时,重复1到3

Once obtained the map of the edges, one must build a vector with the desired widths for each branch. 一旦获得了边缘图,就必须为每个分支建立一个具有所需宽度的矢量。 Wector position matches edge position. Wector位置与边缘位置匹配。 Using the example in this question, this code will make branches 1 to 5 to have width=4, the rest will take the default width (1): 使用此问题中的示例,此代码将使分支1到5的宽度为4,其余的将采用默认宽度(1):

plot(bird.orders, edge.width = c(4,4,4,4,4))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM