0

I want to mark different branches on a phylogenetic tree using 3 different line widths. How can I especify that branch 2 has width= 2, line 10 has width= 4 and the remaining lines have width=1? For example, there are 88 branches in the bird.orders dataset

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!

Santi XGR
  • 185
  • 2
  • 13

1 Answers1

0

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':

  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

Once obtained the map of the edges, one must build a vector with the desired widths for each branch. Wector position matches edge position. 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):

plot(bird.orders, edge.width = c(4,4,4,4,4))
Santi XGR
  • 185
  • 2
  • 13