def infer_ancestral(phylo, mapped_spp):
    """
    Infer the ancestral state of the most-recent common ancestor
    using maximum parsimony. Returns 1 for present in MRCA, 0 for
    absent in MRCA, -1 for ambiguous.
    """
    phylo.visit(lambda n: setattr(n, 'label', mapped_spp[n.name]), lambda n:
        n.is_leaf, mode='postorder')
    phylo.visit(lambda n: n.infer_labels(), lambda n: not n.is_leaf, mode=
        'postorder')
