SCM

[#681] refactor prune methods to make phylo4d version more efficient

Date:
2009-10-08 02:42
Priority:
2
State:
Open
Submitted by:
Jim Regetz (regetz)
Assigned to:
Jim Regetz (regetz)
Operating System:
None
Severity:
enhancement
Resolution:
None
Component:
None
Version:
trunk
URL:
Summary:
refactor prune methods to make phylo4d version more efficient

Detailed description
Currently prune(phylo4d) calls prune(phylo4) twice: once to prune the user-supplied tree, and another time to prune a fully labeled tree in order to reconstruct which tips/nodes were pruned. This was necessary when prune was just a wrapper for ape::drop.tip, but doesn't seem necessary now that the code is all in phylobase.

A better approach might be to make prune(phylo4) a wrapper for prune(phylo4d), rather than the reverse. In other words, prune(phylo4d) would contain all the code that's currently in prune(phylo4), plus also deal with the data (if it exists). The prune(phylo4) method can then be reduced a simple wrapper for prune(phylo4d) that does something like (1) coerce tree to phylo4d, (2) call prune, and (3) apply extractTree to get result.

Comments:

No Comments Have Been Posted

Attached Files:

Changes

No Changes Have Been Made to This Item

Thanks to:
Vienna University of Economics and Business Powered By FusionForge