title: How to get the node order of phylogenetic tree in R?
body: <p>I used the R package <strong>ggtree</strong> to plot a phylogenetic tree and I need to know the order of the tips so that I can combine it with specific information for each tip. Of course I can manually record the order, but I have a lot of these trees. What's more, tr$tip.label gives me a different order of nodes comparing to the order showing in the tree plot.</p>
  
  <p>I need is some R scripts that can get a correct order of tips from a phylogenetic tree object, which should be the same order when R plot the tree.</p>
  
  <p>The tree:
  <img src="https://i.stack.imgur.com/7hEAJ.png" alt=""></p>
  
  <p><code>tr$tip.label</code> gives:</p>
  
  <blockquote>
    <p>"seq6"  "seq16" "seq12" "seq34" "seq5"  "seq35" "seq41" "seq19" "seq22" "seq54" "seq7"  "seq26" "seq9"  "seq14" "seq4"  "seq8" 
     "seq33" "seq11" "seq2"  "seq13" "seq45" "seq42" "seq50" "seq3"  "seq18" "seq29" "seq52" "seq53" "seq32" "seq21" "seq38" "seq51"
     "seq24" "seq47" "seq48" "seq43" "seq39" "seq23" "seq28" "seq1"  "seq25" "seq40" "seq46" "seq36" "seq15" "seq49"</p>
  </blockquote>
  
  <p>What I want:
  <img src="https://i.stack.imgur.com/wucX3.png" alt=""></p>
  
  <p>Each tree tip aligns to a line with a specific color.</p>