Skip to main content
`Ctrl`+`K`

# skbio.tree.TreeNode.compare_biparts

TreeNode.compare_biparts(other, proportion=True)

  Calculate the difference of bipartitions between two trees.

  Added in version 0.6.3.

  Parameters:
    other TreeNode

      The other tree to compare with.

    proportion bool, optional

      Whether to return count (False) or proportion (True, default) of different bipartitions.

  Returns:
    float

      The count or proportion of bipartitions that differ between the trees.

  See also

  `biparts`
  `compare_rfd`
  `compare_subsets`

  Notes

  This metric is equivalent to the Robinson-Foulds distance on unrooted trees.

  Only taxa shared between the two trees are considered.

  Examples

      >>> from skbio import TreeNode
      >>> tree1 = TreeNode.read(["((a,b),(c,d));"])
      >>> tree2 = TreeNode.read(["(((a,b),c),d);"])
      >>> tree1.compare_biparts(tree2)
      0.0