thijsjanzen / nLTT

Repository for the R nLTT package
GNU General Public License v2.0
6 stars 4 forks source link

nltt_diff signals it cannot handle polytomies #23

Closed richelbilderbeek closed 7 years ago

richelbilderbeek commented 7 years ago

I create two phylogenies:

#
#          +---+ a
#      +---+
#          +---+ b
#
#      +---+---+
#     -2  -1   0 time (million years)
#
#
#               
#           +---+ a
#       +---+---+ b
#           +---+ c
#               + d
#
#       +---+---+
#      -2  -1   0 time (million years)
#
phylogeny_1 <- ape::read.tree(text = "(a:1,b:1):1;")
phylogeny_2 <- ape::read.tree(text = "((d:0.0000001,c:0.0000001):1,b:1,a:1):1;")
phylogeny_3 <- ape::read.tree(text = "(((d:0.0000001,c:0.0000001):1,b:1):0.0000001,a:1.0):1;")

phylogeny_2 and phylogeny_3 are both the lower phylogeny. Except phylogeny_3 does not have a polytomy.

nltt_stat_12 <- nLTT::nltt_diff(phylogeny_1, phylogeny_2)
nltt_stat_13 <- nLTT::nltt_diff(phylogeny_1, phylogeny_3)
print(nltt_stat_12) # Prints 0.333, incorrect
print(nltt_stat_13) # Prints 0.25, correct

It is not signalled clearly that nltt_diff does not handle polytomies.

richelbilderbeek commented 7 years ago

Closed on develop, so I'll close it here already.