Skip to content

Instantly share code, notes, and snippets.

@dwinter
Last active March 10, 2016 21:15
Show Gist options
  • Save dwinter/473e73580b5fd512da14 to your computer and use it in GitHub Desktop.
Save dwinter/473e73580b5fd512da14 to your computer and use it in GitHub Desktop.
ape_nodes
```r
tr <- rtree(10)
tr$node.label <- paste0("Node_lab_", Ntip(tr):length(tr$edge.length)+1)
write.tree(tr)
```
```sh
[1] "((t1:0.9895939711,t7:0.7082487224)Node_lab_12:0.5267008557,(((t5:0.6487850151,t6:0.1765917828)Node_lab_15:0.6776126698,(t3:0.2011363888,t2:0.6406570079)Node_lab_16:0.4713614753)Node_lab_14:0.9677321229,(t8:0.1978681912,((t4:0.6891832552,t9:0.3251808353)Node_lab_19:0.4984181079,t10:0.7551706994)Node_lab_18:0.3928663374)Node_lab_17:0.4166005277)Node_lab_13:0.8827202818)Node_lab_11;"
```
Confirm the mapping is right:
```r
plot(tr, show.node.label=TRUE)
nodelabels()
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment