src/matOptimize/main_helper.cpp
//Usher expect parent of condensed node have no mutation, so before outputing usher compatible protobuf,
//add intermediate nodes to carry mutations of condensed nodes
Usher expect parent of condensed node have no mutation, so before outputing usher compatible protobuf,
add intermediate nodes to carry mutations of condensed nodes
Usher expect parent of condensed node have no mutation so before outputing usher compatible protobuf add intermediate nodes to carry mutations of condensed nodes
void fix_condensed_nodes(MAT::Tree *tree) {
    std::vector<MAT::Node *> nodes_to_fix;
    for (auto iter : tree->all_nodes) {
        if (tree->condensed_nodes.count(iter.first) &&
                (!iter.second->mutations.empty())) {
            nodes_to_fix.push_back(iter.second);
        }
    }
    for (auto node : nodes_to_fix) {
        std::string ori_identifier(node->identifier);
        tree->rename_node(ori_identifier,
                          std::to_string(++tree->curr_internal_node));
        tree->create_node(ori_identifier, node);
    }
}
void fix_condensed_nodes ( MAT :: Tree * tree ) { std :: vector < MAT :: Node * > nodes_to_fix ; for ( auto iter : tree -> all_nodes ) { if ( tree -> condensed_nodes . count ( iter . first ) && ( ! iter . second -> mutations . empty ( ) ) ) { nodes_to_fix . push_back ( iter . second ) ; } } for ( auto node : nodes_to_fix ) { std :: string ori_identifier ( node -> identifier ) ; tree -> rename_node ( ori_identifier , std :: to_string ( ++ tree -> curr_internal_node ) ) ; tree -> create_node ( ori_identifier , node ) ; } }
Usher expect parent of condensed node have no mutation, so before outputing usher compatible protobuf,
add intermediate nodes to carry mutations of condensed nodes
Usher expect parent of condensed node have no mutation so before outputing usher compatible protobuf add intermediate nodes to carry mutations of condensed nodes