src/matUtils/filter.cpp
/*
Functions in this module take a MAT and a set of samples and return the a smaller MAT
representing those samples in an optimal manner.
*/
Functions in this module take a MAT and a set of samples and return the a smaller MAT
representing those samples in an optimal manner.
Functions in this module take a MAT and a set of samples and return the a smaller MAT representing those samples in an optimal manner .
MAT::Tree filter_master(const MAT::Tree& T, std::vector<std::string> sample_names, bool prune, bool keep_clade_annotations) {
    MAT::Tree subtree;
    assert (sample_names.size() > 0);
    if (prune) {
        subtree = prune_leaves(T, sample_names);
    } else if (sample_names.size() < 10000) {
        subtree = get_sample_subtree(T, sample_names, keep_clade_annotations);
    } else {
        subtree = get_sample_prune(T, sample_names, keep_clade_annotations);
    }
    return subtree;
}
MAT :: Tree filter_master ( const MAT :: Tree & T , std :: vector < std :: string > sample_names , bool prune , bool keep_clade_annotations ) { MAT :: Tree subtree ; assert ( sample_names . size ( ) > 0 ) ; if ( prune ) { subtree = prune_leaves ( T , sample_names ) ; } else if ( sample_names . size ( ) < 10000 ) { subtree = get_sample_subtree ( T , sample_names , keep_clade_annotations ) ; } else { subtree = get_sample_prune ( T , sample_names , keep_clade_annotations ) ; } return subtree ; }
Functions in this module take a MAT and a set of samples and return the a smaller MAT
representing those samples in an optimal manner.
Functions in this module take a MAT and a set of samples and return the a smaller MAT representing those samples in an optimal manner .
//for retaining only a subtree, get_subtree is the most effective method //for subtress up to about 10 thousand samples in size; after that, pruning //all other nodes becomes more efficient, because get_subtree scales with //the size of the input sample set, while prune takes a similar time for //any sample set size, while scaling on total tree size