Giter Site home page Giter Site logo

rutreebalance's Introduction

RUtreebalance

Robust, universal tree balance indices.

Publication: https://doi.org/10.1093/sysbio/syac027

The tree must be provided either as a phylo object or as a dataframe with column names Parent, Identity and (optionally) Population. The latter is similar to tree$edge, where tree is a phylo object; the differences are in class (dataframe versus matrix) and column names.

The dataframe may (but isn't required to) include a row for the root node.

If population sizes are omitted then internal nodes will be assigned population size zero and leaves will be assigned population size one.

For example, here are four ways of inputting the same tree with internal nodes labelled 4 (the root), 5 and 6, and leaves 1, 2 and 3:

# phylo object read from Newick format:
require(ape)
phylo_tree <- read.tree(text="((1)5,(2,3)6);")
J1_index(phylo_tree)

# dataframe omitting population sizes:
edges_tree <- data.frame(Parent = c(4,5,4,6,6), Identity = c(5,1,6,2,3))
J1_index(edges_tree)

# dataframe omitting population sizes and including a row for the root:
edges_tree_with_root <- data.frame(Parent = c(4,4,5,4,6,6), Identity = c(4,5,1,6,2,3))
J1_index(edges_tree_with_root)

# dataframe including population sizes:
edges_tree_with_pops <- data.frame(Parent = c(4,5,4,6,6), Identity = c(5,1,6,2,3), Population = c(0,1,0,1,1))
J1_index(edges_tree_with_pops)
 ____5____1
|
4     ____2
|    |
|____6
     |____3

rutreebalance's People

Contributors

robjohnnoble avatar

Watchers

 avatar

Forkers

evolandeco

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.