Question: How To Prevent Neighbour-Joining Resulted Negative Branch Length For Phylogenetic Tree Drawing?
0
gravatar for Ken
7.2 years ago by
Ken10
Ken10 wrote:

Hi, I was using rapidNJ to perform neighbour-joining but it gave me a couple of nodes with negative branch length. Is there any way I can fix it? If rapidNJ won't do it, do you have any recommended program to do a better job? Thanks.

phylogenetics • 4.9k views
ADD COMMENTlink modified 7.1 years ago by Andreas2.4k • written 7.2 years ago by Ken10
2
gravatar for Andreas
7.2 years ago by
Andreas2.4k
Singapore
Andreas2.4k wrote:

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

ADD COMMENTlink modified 7.2 years ago • written 7.2 years ago by Andreas2.4k

Correct answer, but no upvote?

ADD REPLYlink written 7.2 years ago by Andreas2.4k

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

ADD REPLYlink written 7.2 years ago by Ken10

You had a problem and I gave you an answer plus a solution. Not a really encouraging reply.

ADD REPLYlink written 7.2 years ago by Andreas2.4k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 541 users visited in the last hour