diff --git a/_sources/tutorial/tutorial_trees.rst.txt b/_sources/tutorial/tutorial_trees.rst.txt index 0394574bb..c4cdb43f9 100644 --- a/_sources/tutorial/tutorial_trees.rst.txt +++ b/_sources/tutorial/tutorial_trees.rst.txt @@ -1386,7 +1386,7 @@ Solving multifurcations When a tree contains a polytomy (a node with more than 2 children), the method :func:`resolve_polytomy` can be used to convert the node -into a randomly bifurcated structure. This is really not a solution +into an arbitrarily bifurcated structure. This is really not a solution for the polytomy but it allows to export the tree as a strictly bifurcated newick structure, which is a requirement for some external software. @@ -1396,7 +1396,7 @@ of the tree intact by disabling the :attr:`recursive` flag. Example:: - t = Tree('(((a,b,c),(d,e,f,g)),(f,i,h));') + t = Tree('(((a,b,c),(d,e,f,g)),(h,i,j));') print(t) # ╭╴a @@ -1406,38 +1406,38 @@ Example:: # │ ╰─┼╴e # ─┤ ├╴f # │ ╰╴g - # │ ╭╴f + # │ ╭╴h # ╰─┼╴i - # ╰╴h + # ╰╴j polynode = t.common_ancestor(['a', 'b']) - polynode.resolve_polytomy(recursive=False) + polynode.resolve_polytomy(descendants=False) print(t) - # ╭─┬╴b - # ╭─┤ ╰╴c - # ╭─┤ ╰╴a + # ╭─┬╴a + # ╭─┤ ╰╴b + # ╭─┤ ╰╴c # │ │ ╭╴d # │ ╰─┼╴e # ─┤ ├╴f # │ ╰╴g - # │ ╭╴f + # │ ╭╴h # ╰─┼╴i - # ╰╴h + # ╰╴j - t.resolve_polytomy(recursive=True) + t.resolve_polytomy(descendants=True) print(t) - # ╭─┬╴b - # ╭─┤ ╰╴c - # │ ╰╴a - # ╭─┤ ╭─┬╴f - # │ │ ╭─┤ ╰╴g - # ─┤ ╰─┤ ╰╴e - # │ ╰╴d - # │ ╭─┬╴i - # ╰─┤ ╰╴h - # ╰╴f + # ╭─┬╴a + # ╭─┤ ╰╴b + # │ ╰╴c + # ╭─┤ ╭─┬╴d + # │ │ ╭─┤ ╰╴e + # ─┤ ╰─┤ ╰╴f + # │ ╰╴g + # │ ╭─┬╴h + # ╰─┤ ╰╴i + # ╰╴j Tree rooting diff --git a/reference/reference_smartview.html b/reference/reference_smartview.html index 1f4ba7b57..955476dfd 100644 --- a/reference/reference_smartview.html +++ b/reference/reference_smartview.html @@ -92,7 +92,7 @@
Resolve all polytomies under the current node, randomly.
+resolve_polytomy(self, descendants=True)¶ +Convert node to a series of dicotomies if it is a polytomy.
A polytomy is a node that has more than 2 children. This -function resolves them by creating an arbitrary dicotomic -structure among the affected nodes. It randomly modifies the -current tree topology and should only be used for -compatibility reasons (like to later use programs that reject -multifurcated nodes).
+function changes them to a ladderized series of dicotomic +branches. The tree topology modification is arbitrary (no +important results should depend on it!).recursive – If True, resolve all polytomies under this -node too. Otherwise, only the current node will be -checked and fixed.
defaults – Dictionary of properties to use for new nodes.
descendants – If True, resolve all polytomies under this +node too. Otherwise, do it only for the current node.
When a tree contains a polytomy (a node with more than 2 children),
the method resolve_polytomy()
can be used to convert the node
-into a randomly bifurcated structure. This is really not a solution
+into an arbitrarily bifurcated structure. This is really not a solution
for the polytomy but it allows to export the tree as a strictly
bifurcated newick structure, which is a requirement for some external
software.
The method can be used on a very specific node while keeping the rest
of the tree intact by disabling the recursive
flag.
Example:
-t = Tree('(((a,b,c),(d,e,f,g)),(f,i,h));')
+t = Tree('(((a,b,c),(d,e,f,g)),(h,i,j));')
print(t)
# ╭╴a
@@ -1493,38 +1493,38 @@ Concatenating trees<
# │ ╰─┼╴e
# ─┤ ├╴f
# │ ╰╴g
-# │ ╭╴f
+# │ ╭╴h
# ╰─┼╴i
-# ╰╴h
+# ╰╴j
polynode = t.common_ancestor(['a', 'b'])
-polynode.resolve_polytomy(recursive=False)
+polynode.resolve_polytomy(descendants=False)
print(t)
-# ╭─┬╴b
-# ╭─┤ ╰╴c
-# ╭─┤ ╰╴a
+# ╭─┬╴a
+# ╭─┤ ╰╴b
+# ╭─┤ ╰╴c
# │ │ ╭╴d
# │ ╰─┼╴e
# ─┤ ├╴f
# │ ╰╴g
-# │ ╭╴f
+# │ ╭╴h
# ╰─┼╴i
-# ╰╴h
+# ╰╴j
-t.resolve_polytomy(recursive=True)
+t.resolve_polytomy(descendants=True)
print(t)
-# ╭─┬╴b
-# ╭─┤ ╰╴c
-# │ ╰╴a
-# ╭─┤ ╭─┬╴f
-# │ │ ╭─┤ ╰╴g
-# ─┤ ╰─┤ ╰╴e
-# │ ╰╴d
-# │ ╭─┬╴i
-# ╰─┤ ╰╴h
-# ╰╴f
+# ╭─┬╴a
+# ╭─┤ ╰╴b
+# │ ╰╴c
+# ╭─┤ ╭─┬╴d
+# │ │ ╭─┤ ╰╴e
+# ─┤ ╰─┤ ╰╴f
+# │ ╰╴g
+# │ ╭─┬╴h
+# ╰─┤ ╰╴i
+# ╰╴j