def newick_replace_otuids(tree, biomf):
    """
    Replace the OTU ids in the Newick phylogenetic tree format with truncated
    OTU names
    """
    for val, id_, md in biomf.iter(axis="observation"):
        otu_loc = find_otu(id_, tree)
        if otu_loc is not None:
            tree = tree[:otu_loc] + \
                   oc.otu_name(md["taxonomy"]) + \
                   tree[otu_loc + len(id_):]
    return tree
Replace the OTU ids in the Newick phylogenetic tree format with truncated
    OTU names