Reconciliation of an unrooted protein tree with a rooted reference tree. Successive subtree prune-and-regraft (edits) operations (edits) are applied to the reference tree (b), until (ideally) all topologies, or for complex comparisons at least one topology, consistent with the protein tree (a), is obtained. In this example, only a single operation is needed to generate a tree (c) with which the tree in a is topologically congruent. Four alternative edits, indicated with arrows representing the direction of gene flow, can reconcile the reference and protein trees in a single step (thus with an edit path of length 1). The tree in c is the result of the edit operation implied by the boldface arrow in the tree in b: an ancestor of taxon B donates genetic material to an ancestor of taxon C. This is implemented algorithmically by breaking the terminal edge subtending C and reannealing it along the terminal edge subtending B. The resulting rooted tree (c) contains no bipartitions that are discordant with protein tree (see supporting information for details). In this simple example there is no obligate edit path; (B,C) and (D,E) are possible (but mutually exclusive) partner pairs in the implied LGT event.