KlausVigo / phangorn

Phylogenetic analysis in R
http://klausvigo.github.io/phangorn/
205 stars 39 forks source link

designTree no longer returns a correct design Matrix #41

Closed BertrandServin closed 6 years ago

BertrandServin commented 6 years ago

Hi,

I have been using the designTree function in some of my scripts (thanks !) and became recently aware of a regression in this function, as it does not seem to return a correct design matrix anymore.

I tested two versions of the function on the same tree hapmap_tree.txt (attached file in Newick format). Here are the output obtained with two different versions of the package:

First using current version (2.3.1) and ape 5.0:

arbre = read.tree('hapmap_tree.txt') designTree(arbre) 5<->1 5<->2 5<->6 6<->3 6<->4 [1,] 0 0 1 1 0 [2,] 1 0 1 0 0 [3,] 0 1 1 0 0 [4,] 1 0 0 1 0 [5,] 0 1 0 1 0 [6,] 1 1 0 0 0

Notice the last column is only zeroes, this seems to be the problem here.

The sessioninfo:

sessionInfo() R version 3.4.3 (2017-11-30) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux buster/sid (...) attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] phangorn_2.3.1 ape_5.0

Now with and older version (1.99):

arbre=read.tree('hapmap_tree.txt') designTree(arbre) 5<->1 5<->2 5<->6 6<->3 6<->4 [1,] 0 0 1 1 0 [2,] 1 0 1 0 1 [3,] 0 1 1 0 1 [4,] 1 0 0 1 1 [5,] 0 1 0 1 1 [6,] 1 1 0 0 0

The last column looks correct.

sessionInfo() R version 3.1.2 (2014-10-31) Platform: x86_64-unknown-linux-gnu (64-bit) (...) attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] phangorn_1.99-1 rgl_0.95.1247 ape_3.0-11

I tried to look into differences between the two versions but that was too hard for me to identify where the regression comes from.

Thanks for your help

Bertrand

KlausVigo commented 6 years ago

Hi @BertrandServin this should be fixed with commit 5258b36b926dcd7c134a1f9fc9e8c722b641eb33, and it was tricky to figure out what's going on.
Regards, Klaus