SCM

[#570] Create replace method for 'rootNode'

Date:
2009-08-17 00:04
Priority:
3
State:
Open
Submitted by:
François Michonneau (francois)
Assigned to:
Steven Kembel (skembel)
Target Version:
None
Summary:
Create replace method for 'rootNode'

Detailed description
The replace method for rootNode is not implemented.

Comments:

Message  ↓
Date: 2009-08-25 19:35
Sender: Peter Cowan

+1 for escalating this.

I'm willing to write a native function to handle this, but I won't be able to do it this week.

Date: 2009-08-23 17:22
Sender: Ben Bolker

my conclusion so far is that this is totally intentional in ape, a result of resolve.root=TRUE, and I really don't understand what's going on in root() well enough yet. At least one of the NAs is explicit.

I am tempted to "escalate" this feature to a bug, since it's one of the few things I think we would like to resolve before release ...

Date: 2009-08-22 23:38
Sender: Ben Bolker

does this represent a misfeature/bug in ape? if so -- should we harden phylobase, ask Emmanuel to fix ape, or both?

Date: 2009-08-21 22:45
Sender: François Michonneau

I attached a R object that illustrates the problem. It contains the variable 'step1' which represents the object before being submitted to the function root from ape.

load(file="geoUniqLbl.Rout")
step1$node.label
step2 <- root(step1, node=17, resolve.root=TRUE)
step2$node.label

returns:
[1] "n17" NA "n16" NA "n18" "n19" "n20" "n21" "n22" "n23" "n24" "n25"
[13] "n26" "n27"

There shouldn't be any NA in this vector.

This is with ape 2.3-2

Date: 2009-08-21 22:28
Sender: François Michonneau

oops... I removed exGeo4 from the examples...but geospiza fails similarly.

The problems comes from the fact that there are NA in the node labels returned by ape's root.

Date: 2009-08-21 22:22
Sender: Steven Kembel

Here's one example that wasn't working:
> example(phylo4d)
> rootNode(exGeo4)
> rootNode(exGeo4) <- 17
Error in .createLabels(node.label, ntips = ntips, nnodes = nnodes, type = "internal") :
Number of labels does not match number of nodes.

Date: 2009-08-21 22:01
Sender: Ben Bolker

at your convenience, could you post some test cases that don't work?

Date: 2009-08-21 21:52
Sender: Steven Kembel

Wrote this code using the ape::root function but it does not work properly for all trees. Trying to figure out why, it may be a problem with phylo<>phylo4 roundtrip or a bug in the ape::root function. Code attached for now.

Date: 2009-08-18 23:03
Sender: Steven Kembel

This will take a fair bit of work.

1) Rerooting a tree requires all internal nodes to be renumbered to respect convention (enforced by checkTree) that root node # = nTips+1.
2) Rerooting a rooted tree will generate unbranched internal nodes - should we collapse these when rerooting (= ape default behaviour)?

For now I suggest we can reroot trees using ape's root function.

Attached Files:

Attachments:
Size Name Date By Download
1 KiBrootNode methods.R2009-08-21 21:52skembelrootNode methods.R
523 bytesgeoUniqLbl.Rout2009-08-21 22:45francoisgeoUniqLbl.Rout

Changes

Field Old Value Date By
File Added26: geoUniqLbl.Rout2009-08-21 22:45francois
File Added24: rootNode methods.R2009-08-21 21:52skembel
assigned_tonone2009-08-18 16:29bbolker
Thanks to:
Vienna University of Economics and Business Powered By FusionForge