phylox.cherrypicking.base.add_roots_to_sequence
- phylox.cherrypicking.base.add_roots_to_sequence(sequence, reduced_trees_per_pair)
Modifies a cherry-picking sequence so that it represents a network with exactly one root. A sequence may be such that reconstructing a network from the sequence results in multiple roots This function adds some pairs to the sequence so that the network has a single root. :param sequence: the sequence to modify :param reduced_trees_per_pair: the sets of trees reduced by each pair in the sequence
- Returns:
the new sequence, and also the sets of trees reduced by each pair in the sequence, modified so that the new pairs are also represented (they reduce no trees)