An R-sig-phylo query asked the following:
I'd like to sample independent subclades of greater than N tips from a phylogenetic tree much greater than N, say (number of tips >= 10*N). I can extract all subclades of greater than N taxa, but sampling independent subclades seems to be a harder problem.
Well - I'm not completely sure if this what he's asking for, but here is a function that will get all the subtrees in a binary tree that cannot be further subdivided into two subtrees of size >= clade.size.
any(x < cs),cs=clade.size)
The way this works is as follows. First, we get the number of tips descended from each node in the tree:
Right now, the function will only work on binary trees - but there is no check to assure that your tree is binary. I will fix that and add to phytools.
Post a Comment
Note: due to the very large amount of spam, all comments are now automatically submitted for moderation.