Correct answer, but no upvote?
1 answer
Negative branch lengths are possible in theory and might occur in the output of other programs (e.g. FastTree) as well. See the short section on negative branch lengths here for example. If your downstream analysis requires non-negative branch-lengths, a quick hack is to replace negative entries with zero (even though in theory you should add the difference to the adjacent branch length). The following should do (untested!):
sed -e 's,:-[0-9\.]\+,:0.0,g' in.tree > out.tree
Andreas
this answer gave me confidence on my results. But no better alternative solution and the sed command doesn't add the difference to the adjacent branch length. sorry for my strictness. ;P
You had a problem and I gave you an answer plus a solution. Not a really encouraging reply.
Log in to answer this question.