data.tree icon indicating copy to clipboard operation
data.tree copied to clipboard

toNewick() returns wrong branch length

Open Lan-h opened this issue 4 years ago • 1 comments

Hi, I tried to follow the vignette to convert a dataframe to Newick format, but I the branch length in the output are wrong, although the overall shape of the tree is correct. This is my current data.tree object: `

population = FromDataFrameTable(myTable, pathName = "LineageTracing", colLevels = c("TimeBranching") , na.rm = FALSE) print(population,"TimeBranching") levelName TimeBranching 1 1 0 2 ¦--2 1 3 ¦--3 5 4 ¦--4 9 5 ¦ °--6 1 6 °--5 10 and the way I tried to convert it to Newick format: ToNewick(population, heightAttribute = "TimeBranching") "(2:-1,3:-5,(6:8)4:-9,5:-10)1;" ` the output should be "(2:1,3:5,(6:1)4:9,5:10)1;" instead.

Is there a way to fix this issue ? Thank you in advance!

Lan-h avatar Jan 03 '22 11:01 Lan-h

Hey, sorry for the late reply. Could you please provide a reproducible example (specifically: what is myTable)? Thx.

gluc avatar Nov 11 '23 23:11 gluc