Substitution mapping and ancestral sequence reconstruction