Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create function to decompose phylogenetic tree according to designated nodes #2

Open
caseywdunn opened this issue May 31, 2015 · 2 comments

Comments

@caseywdunn
Copy link
Owner

Originally reported by: Casey Dunn (Bitbucket: caseywdunn, GitHub: caseywdunn)


Build the function decompose based on the following template.

#!r

#' Decomposes a single tree into a series of subtrees designated by internal
#' node numbers
#' 
#' @param phy The tree to be decomposed, as an ape phylo object
#' @param x A vector of internal node numbers. The tree phy will be cut on each branch 
#' that subtends each of these nodes.
#' @return A list of phylo objects 
decompose <- function( phy, x ){}

@caseywdunn
Copy link
Owner Author

Original comment by Casey Dunn (Bitbucket: caseywdunn, GitHub: caseywdunn):


if x is empty, then it returns a list with one element - the original tree.

@caseywdunn
Copy link
Owner Author

Original comment by Casey Dunn (Bitbucket: caseywdunn, GitHub: caseywdunn):


decompose now passing test, re issue #2. Still need to clean up node names after decomposing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant