![]() |
Rosetta
2021.16
|
#include <Clustering.hh>
Public Member Functions | |
| Clustering () | |
| void | initialize (std::string const &filename, core::Real threshold) |
| void | reinitialize (StringVec const &, std::vector< StruOP > const &, core::Real const threshold) |
| void | cluster () |
| void | showClusters (int) |
| void | getPDBs (StringVec &, std::vector< StruOP > &, std::vector< int > const &, int) |
| void | readDecoyNames () |
| void | readDecoys (StringVec const &, std::vector< StruOP > const &) |
| std::vector< StruOP > | readDecoys (StringVec const &) |
| void | getThresholdAndDecoys () |
| core::Real | get_threshold (std::vector< std::vector< core::Real > > const &nbors, int, int, int, int, core::Real, core::Real) |
| void | get_neighbor_list (std::vector< StruOP > const &, StringVec const &, int, std::vector< std::vector< core::Real > > &nbors) |
| void | get_neighbor_list (std::vector< StruOP > const &, int, core::Real &, core::Real &, std::vector< std::vector< core::Real > > &nbors) |
| void | estimateDist (StringVec const &, int, int, core::Real, core::Real &, core::Real &, core::Real &, core::Real &) |
| void | estimateDist (std::vector< StruOP > const &, core::Real, core::Real &, core::Real &, core::Real &, core::Real &) |
| std::vector< std::string > | getRandomDecoyNames (StringVec const &, int) |
| void | destroyRandomDecoys (StringVec const &, std::vector< StruOP > const &) |
| void | auxClustering () |
| void | buildAdjacentLists () |
| void | listAdjacentLists () |
| void | findLargestClusters () |
| int | findDecoyWithMostNeighbors () |
| void | removeDecoys (AdjacentList &adj) |
| void | initRef (int *index) |
| void | refBound (int i, int j, core::Real &lower, core::Real &upper) |
| void | realignDecoys (int ref) |
| void | superimposeAndReplace (std::vector< core::Real > &coor1, std::vector< core::Real > &coor2) |
| core::Real | eucD (int i, int j) |
| core::Real | estD (int i, int j) |
| core::Real | estD (Stru const &a, Stru const &b) |
| core::Real | trueD (Stru const &a, Stru const &b) |
| core::Real | trueD (int i, int j) |
| void | allocateSpaceForRMSD (int len) |
Public Attributes | |
| bool | pref_use_scud |
| bool | pref_use_sig |
| bool | pref_ref_use_first_few_decoys |
| EST_THRESHOLD_MODE | EST_THRESHOLD |
| bool | FILTER_MODE |
| core::Real | xPercentile |
| bool | autoAdjustPercentile |
| core::Real | xFactor |
| std::string | mInputFileName |
| StringVec | names_ |
| std::vector< StruOP > | PDBs_ |
| int | n_pdbs_ |
| int | mLen |
| core::Real | THRESHOLD |
| core::Real | CLU_RADIUS |
| std::vector< int > | mCluCen |
| std::vector< int > ** | auxiliary_clusters_ |
| std::vector< int > | mCen |
| std::vector< core::Real > | mD2C |
| std::vector< int > | num_neighbors_ |
| core::Real | bestClusMargin |
| int | bestClusSize |
| std::vector< AdjacentListOP > | adjacent_lists_ |
| std::vector< core::Real > | references_ |
| int | mFinalDecoy |
| std::vector< AdjacentListOP > | mFinalClusters |
| std::vector< int > | remaining_list_ |
| std::vector< int > | remaining_list_index_ |
| int | mRemainingSize |
| bool | spaceAllocatedForRMSD |
| core::Real * | result_coords |
| core::Real * | coord1 |
| core::Real * | coord2 |
| protocols::cluster::calibur::Clustering::Clustering | ( | ) |
References bestClusMargin, FILTER_MODE, mLen, and spaceAllocatedForRMSD.
| void protocols::cluster::calibur::Clustering::allocateSpaceForRMSD | ( | int | len | ) |
References result_coords, and spaceAllocatedForRMSD.
Referenced by readDecoys().
| void protocols::cluster::calibur::Clustering::auxClustering | ( | ) |
A simplistic clustering to help us find the adjacent lists — this is one of Calibur's strategy. In the output, each decoy either belongs to a cluster, or is a cluster center.
For each decoy from 0... n_pdbs_, If it is not within CLUS_RADIUS of any currently registered cluster center Add it as a cluster center Else add it to the cluster
References adjacent_lists_, auxiliary_clusters_, core::pack::dunbrack::c, CLU_RADIUS, estD(), eucD(), mCen, mCluCen, mD2C, n_pdbs_, pref_use_scud, pref_use_sig, refBound(), and trueD().
Referenced by cluster().
| void protocols::cluster::calibur::Clustering::buildAdjacentLists | ( | ) |
too slow bool Clustering::find(int which, std::vector<int> *elements) { int len=elements->size(); for (int i=0; i<len; i++) { if ((*elements)[i] == which) return true; } return false; } Subroutine for cluster(). Finds the neighbors for each decoy i within threshold and add these neighbors in adjacent_lists_[i]
References adjacent_lists_, auxiliary_clusters_, core::pack::dunbrack::c, CLU_RADIUS, estD(), eucD(), protocols::cluster::calibur::AdjacentList::list_mode_, protocols::cluster::calibur::LITE, mCen, mCluCen, mD2C, n_pdbs_, pref_use_scud, pref_use_sig, refBound(), THRESHOLD, and trueD().
Referenced by cluster().
| void protocols::cluster::calibur::Clustering::cluster | ( | ) |
Main call. Find all neighbors within threshold.
References protocols::cluster::calibur::_get_elapsed(), auxClustering(), bestClusMargin, bestClusSize, buildAdjacentLists(), findLargestClusters(), initRef(), mFinalClusters, names_, protocols::cluster::calibur::AdjacentList::num_neighbors_, num_neighbors_, protocols::loops::start, and protocols::cluster::calibur::AdjacentList::which_.
| void protocols::cluster::calibur::Clustering::destroyRandomDecoys | ( | StringVec const & | , |
| std::vector< StruOP > const & | |||
| ) |
Destroy the random decoys
Referenced by estimateDist(), and getThresholdAndDecoys().
| core::Real protocols::cluster::calibur::Clustering::estD | ( | int | i, |
| int | j | ||
| ) |
References core::pack::dunbrack::c, mLen, and PDBs_.
Referenced by auxClustering(), buildAdjacentLists(), and readDecoys().
| core::Real protocols::cluster::calibur::Clustering::estD | ( | Stru const & | a, |
| Stru const & | b | ||
| ) |
References core::pack::dunbrack::c, mLen, and protocols::cluster::calibur::Stru::signature_.
| void protocols::cluster::calibur::Clustering::estimateDist | ( | StringVec const & | allNames, |
| int | numTrials, | ||
| int | randDecoySize, | ||
| core::Real | xPercent, | ||
| core::Real & | minDist, | ||
| core::Real & | maxDist, | ||
| core::Real & | mostFreqDist, | ||
| core::Real & | xPercentileDist | ||
| ) |
Repeatedly estimate distances for numTrials trials, and get the average values of
References destroyRandomDecoys(), getRandomDecoyNames(), and readDecoys().
Referenced by getThresholdAndDecoys().
| void protocols::cluster::calibur::Clustering::estimateDist | ( | std::vector< StruOP > const & | decoys, |
| core::Real | xPercent, | ||
| core::Real & | minDist, | ||
| core::Real & | maxDist, | ||
| core::Real & | mostFreqDist, | ||
| core::Real & | xPercentileDist | ||
| ) |
Find: (1) min, max distances (2) most frequently occuring distance (3) the x percentile distance. using the x percentile distance is like claiming that there are only x percent of edges between decoys, and that these edges are the nearest ones. Note that if pairwise distances follows Gaussian distribution then case (2) should be the same as case (3) at x=50%.
References protocols::cluster::calibur::__cmp(), _OVER_RMSD_, core::pose::motif::a(), autoAdjustPercentile, protocols::match::upstream::b, MAX_PERCENTILE_FOR_THRESHOLD, MIN_PERCENTILE_FOR_THRESHOLD, names_, trueD(), and xPercentile.
| core::Real protocols::cluster::calibur::Clustering::eucD | ( | int | i, |
| int | j | ||
| ) |
References adjacent_lists_, protocols::antibody::l3, mLen, and PDBs_.
Referenced by auxClustering(), and buildAdjacentLists().
| int protocols::cluster::calibur::Clustering::findDecoyWithMostNeighbors | ( | ) |
Find from all AdjacentLists the one that is longest
References adjacent_lists_, mRemainingSize, and remaining_list_.
Referenced by findLargestClusters().
| void protocols::cluster::calibur::Clustering::findLargestClusters | ( | ) |
References adjacent_lists_, findDecoyWithMostNeighbors(), protocols::cluster::calibur::AdjacentList::list_mode_, protocols::cluster::calibur::LITE, mFinalClusters, mFinalDecoy, mRemainingSize, n_pdbs_, num_neighbors_, remaining_list_, remaining_list_index_, and removeDecoys().
Referenced by cluster().
| void protocols::cluster::calibur::Clustering::get_neighbor_list | ( | std::vector< StruOP > const & | decoys, |
| StringVec const & | nborsCandidates, | ||
| int | listLength, | ||
| std::vector< std::vector< core::Real > > & | nbors | ||
| ) |
For each decoy c in decoys, build a list of listLength nearest neighbors of c, taken from the list nborsCandidates. FIXME there is no way to tell if a decoy in sampleDecoys is the same as a decoy in nborsCandidates, and hence a decoy can be inserted into its own list.
References core::pose::motif::a(), protocols::match::upstream::b, mLen, core::chemical::element::N, pref_use_sig, and trueD().
Referenced by getThresholdAndDecoys().
| void protocols::cluster::calibur::Clustering::get_neighbor_list | ( | std::vector< StruOP > const & | decoys, |
| int | listLength, | ||
| core::Real & | minDist, | ||
| core::Real & | maxDist, | ||
| std::vector< std::vector< core::Real > > & | nbors | ||
| ) |
Builds neighbor lists using the input decoys. For use in ROSETTA mode. Same as the earlier get_neighbor_list but nborsCandidates is taken to be the same as decoys. Also, minDist and maxDist are computed so that they can be used to guarantee targetClusterSize is used in getThreshold().
References _OVER_RMSD_, core::pose::motif::a(), protocols::match::upstream::b, core::chemical::element::N, names_, and trueD().
| core::Real protocols::cluster::calibur::Clustering::get_threshold | ( | std::vector< std::vector< core::Real > > const & | nbors, |
| int | numLists, | ||
| int | listLength, | ||
| int | minSize, | ||
| int | size, | ||
| core::Real | minThres, | ||
| core::Real | maxThres | ||
| ) |
Find a decoy with the smallest distance x of N nearest neighbors, where minThres <= x <= maxThres.
Hence at threshold x, no other cluster has more elements than N.
We try for all sizes N in [minSize, maxSize] starting from size. The direction that N is searched depends on the starting size If there is no N within these set sizes such that minThres <= x <= maxThres, we use either minSize or maxSize, depending on which is nearer.
In which case,
For example, given the case -------------------------------—maxThres | | -------------------------------—minThres threshold | smallest x ______| ^ | at N _______/ |^x_1 | | ________/ | | |____/ | N = minSize N = maxSize —> N ...we would use x=x_1 and N=maxSize.
References _OVER_RMSD_, and protocols::hybridization::t.
Referenced by getThresholdAndDecoys().
| void protocols::cluster::calibur::Clustering::getPDBs | ( | StringVec & | Names, |
| std::vector< StruOP > & | PDBs, | ||
| std::vector< int > const & | list, | ||
| int | num_elements | ||
| ) |
Get the names and Strus of the (first num_elements) indices in list into Names and PDBs respectively.
References names_, protocols::mean_field::num_elements(), and PDBs_.
| std::vector< std::string > protocols::cluster::calibur::Clustering::getRandomDecoyNames | ( | StringVec const & | srcnames, |
| int | size | ||
| ) |
Randomly permute the numbers, and select the first size decoys
References core::scoring::rg, and protocols::hybridization::t.
Referenced by estimateDist(), and getThresholdAndDecoys().
| void protocols::cluster::calibur::Clustering::getThresholdAndDecoys | ( | ) |
Get these: names_, PDBs_, mLen
References _OVER_RMSD_, destroyRandomDecoys(), EST_THRESHOLD, estimateDist(), FILTER_MODE, get_neighbor_list(), get_threshold(), getRandomDecoyNames(), protocols::cluster::calibur::MIN_AVG_DIST_BASED, protocols::cluster::calibur::MOST_FREQ_BASED, names_, NUM_TRIALS_FOR_THRESHOLD, PDBs_, protocols::cluster::calibur::PERCENT_EDGES, RANDOM_DECOY_SIZE_FOR_FILTERING, RANDOM_DECOY_SIZE_FOR_THRESHOLD, readDecoyNames(), readDecoys(), protocols::cluster::calibur::ROSETTA, protocols::cluster::calibur::SAMPLED_ROSETTA, protocols::loops::start, THRESHOLD, xFactor, and xPercentile.
Referenced by initialize().
| void protocols::cluster::calibur::Clustering::initialize | ( | std::string const & | filename, |
| core::Real | threshold | ||
| ) |
Main aim: (1) read decoys into names_ and PDBs_. (2) decide THRESHOLD, CLUS_RADIUS (3) initialize data structure needed for auxiliary grouping, and (4) ...for clustering.
References _MATRIX_MODE_LIMIT_, adjacent_lists_, auxiliary_clusters_, core::pack::dunbrack::c, protocols::cluster::calibur::SimPDB::chains, CLU_RADIUS, EST_THRESHOLD, protocols::abinitio::filename(), FILTER_MODE, getThresholdAndDecoys(), protocols::cluster::calibur::LIST, protocols::cluster::calibur::AdjacentList::list_mode_, protocols::cluster::calibur::LITE, protocols::cluster::calibur::MATRIX, mCen, mCluCen, mD2C, mInputFileName, n_pdbs_, pref_use_scud, pref_use_sig, realignDecoys(), THRESHOLD, and protocols::cluster::calibur::USER_SPECIFIED.
| void protocols::cluster::calibur::Clustering::initRef | ( | int * | index | ) |
For each decoy j, and for each of the decoys i in index[], find and cache dist(i,j). index[] is of size REFERENCE_SIZE, and is initially set to decoys 1, 2, ..., REFERENCE_SIZE-1. This mNuPDBs_* distance is stored in references_
References adjacent_lists_, n_pdbs_, pref_ref_use_first_few_decoys, REFERENCE_SIZE, references_, and trueD().
Referenced by cluster().
| void protocols::cluster::calibur::Clustering::listAdjacentLists | ( | ) |
References adjacent_lists_, protocols::cluster::calibur::AdjacentList::dist, protocols::cluster::calibur::AdjacentList::getD(), protocols::cluster::calibur::LIST, protocols::cluster::calibur::AdjacentList::list_mode_, n_pdbs_, names_, protocols::cluster::calibur::AdjacentList::neigh, protocols::cluster::calibur::AdjacentList::num_neighbors_, and protocols::cluster::calibur::AdjacentList::which_.
| void protocols::cluster::calibur::Clustering::readDecoyNames | ( | ) |
Read from the input file the names of decoys
References protocols::cluster::calibur::PreloadedPDB::ADVISED_THRESHOLD, protocols::cluster::calibur::filetype(), protocols::cluster::calibur::PreloadedPDB::loadPDBFromList(), protocols::cluster::calibur::PreloadedPDB::loadSilentFile(), mInputFileName, protocols::cluster::calibur::PreloadedPDB::names_, names_, protocols::cluster::calibur::num_lines_in_file(), protocols::cluster::calibur::PDB_LIST, protocols::cluster::calibur::SimPDB::preloadedPDB, protocols::cluster::calibur::SimPDB::preloadPDB, and protocols::cluster::calibur::SILENT_FILE.
Referenced by getThresholdAndDecoys().
| void protocols::cluster::calibur::Clustering::readDecoys | ( | StringVec const & | randonames_, |
| std::vector< StruOP > const & | randomDecoys | ||
| ) |
Read from the input files all the decoys, filtering when necessary
References allocateSpaceForRMSD(), estD(), FILTER_MODE, mLen, n_pdbs_, names_, PDBs_, pref_use_sig, THRESHOLD, and trueD().
Referenced by estimateDist(), and getThresholdAndDecoys().
| std::vector< StruOP > protocols::cluster::calibur::Clustering::readDecoys | ( | StringVec const & | decoynames | ) |
Read from the input files the decoys and return them
References allocateSpaceForRMSD(), mLen, and pref_use_sig.
| void protocols::cluster::calibur::Clustering::realignDecoys | ( | int | ref | ) |
Realign decoys so that their point-wise distance to decoy "ref" is minimized
References n_pdbs_, PDBs_, protocols::loops::start, and superimposeAndReplace().
Referenced by initialize().
| void protocols::cluster::calibur::Clustering::refBound | ( | int | i, |
| int | j, | ||
| core::Real & | lower, | ||
| core::Real & | upper | ||
| ) |
References _OVER_RMSD_, REFERENCE_SIZE, references_, and core::simple_metrics::metrics::sum.
Referenced by auxClustering(), and buildAdjacentLists().
| void protocols::cluster::calibur::Clustering::reinitialize | ( | StringVec const & | nNames, |
| std::vector< StruOP > const & | nPDBs, | ||
| core::Real const | threshold | ||
| ) |
Useful for when we want to redo clustering with a set of already initialized PDBs.
References adjacent_lists_, auxiliary_clusters_, CLU_RADIUS, protocols::cluster::calibur::AdjacentList::list_mode_, protocols::cluster::calibur::MATRIX, mCen, mCluCen, mD2C, n_pdbs_, names_, num_neighbors_, PDBs_, and THRESHOLD.
| void protocols::cluster::calibur::Clustering::removeDecoys | ( | AdjacentList & | adj | ) |
Remove all the decoys in adj from all AdjacentList of all decoys.
References adjacent_lists_, mRemainingSize, protocols::cluster::calibur::AdjacentList::neigh, protocols::cluster::calibur::AdjacentList::num_neighbors_, remaining_list_, remaining_list_index_, and protocols::cluster::calibur::AdjacentList::which_.
Referenced by findLargestClusters().
| void protocols::cluster::calibur::Clustering::showClusters | ( | int | numClus | ) |
References adjacent_lists_, protocols::cluster::calibur::AdjacentList::list_mode_, protocols::cluster::calibur::LITE, mFinalClusters, mFinalDecoy, names_, protocols::cluster::calibur::AdjacentList::neigh, protocols::cluster::calibur::AdjacentList::num_neighbors_, and protocols::cluster::calibur::AdjacentList::which_.
| void protocols::cluster::calibur::Clustering::superimposeAndReplace | ( | std::vector< core::Real > & | coor1, |
| std::vector< core::Real > & | coor2 | ||
| ) |
References mLen, result_coords, protocols::cluster::calibur::RMSD(), and protocols::cluster::calibur::rotate().
Referenced by realignDecoys().
| core::Real protocols::cluster::calibur::Clustering::trueD | ( | Stru const & | a, |
| Stru const & | b | ||
| ) |
References protocols::cluster::calibur::Stru::calpha_vector_, protocols::cluster::calibur::fast_rmsd(), and mLen.
Referenced by auxClustering(), buildAdjacentLists(), estimateDist(), get_neighbor_list(), initRef(), and readDecoys().
| core::Real protocols::cluster::calibur::Clustering::trueD | ( | int | i, |
| int | j | ||
| ) |
References adjacent_lists_, protocols::cluster::calibur::fast_rmsd(), mLen, and PDBs_.
| std::vector< AdjacentListOP > protocols::cluster::calibur::Clustering::adjacent_lists_ |
| bool protocols::cluster::calibur::Clustering::autoAdjustPercentile |
Referenced by estimateDist().
| std::vector< int >** protocols::cluster::calibur::Clustering::auxiliary_clusters_ |
Referenced by auxClustering(), buildAdjacentLists(), initialize(), and reinitialize().
| core::Real protocols::cluster::calibur::Clustering::bestClusMargin |
Referenced by cluster(), and Clustering().
| int protocols::cluster::calibur::Clustering::bestClusSize |
Referenced by cluster().
| core::Real protocols::cluster::calibur::Clustering::CLU_RADIUS |
Referenced by auxClustering(), buildAdjacentLists(), initialize(), and reinitialize().
| core::Real* protocols::cluster::calibur::Clustering::coord1 |
| core::Real* protocols::cluster::calibur::Clustering::coord2 |
| EST_THRESHOLD_MODE protocols::cluster::calibur::Clustering::EST_THRESHOLD |
Referenced by getThresholdAndDecoys(), and initialize().
| bool protocols::cluster::calibur::Clustering::FILTER_MODE |
Referenced by Clustering(), getThresholdAndDecoys(), initialize(), and readDecoys().
| std::vector< int > protocols::cluster::calibur::Clustering::mCen |
Referenced by auxClustering(), buildAdjacentLists(), initialize(), and reinitialize().
| std::vector< int > protocols::cluster::calibur::Clustering::mCluCen |
Referenced by auxClustering(), buildAdjacentLists(), initialize(), and reinitialize().
| std::vector< core::Real > protocols::cluster::calibur::Clustering::mD2C |
Referenced by auxClustering(), buildAdjacentLists(), initialize(), and reinitialize().
| std::vector< AdjacentListOP > protocols::cluster::calibur::Clustering::mFinalClusters |
Referenced by cluster(), findLargestClusters(), and showClusters().
| int protocols::cluster::calibur::Clustering::mFinalDecoy |
Referenced by findLargestClusters(), and showClusters().
| std::string protocols::cluster::calibur::Clustering::mInputFileName |
Referenced by initialize(), and readDecoyNames().
| int protocols::cluster::calibur::Clustering::mLen |
Referenced by Clustering(), estD(), eucD(), get_neighbor_list(), readDecoys(), superimposeAndReplace(), and trueD().
| int protocols::cluster::calibur::Clustering::mRemainingSize |
Referenced by findDecoyWithMostNeighbors(), findLargestClusters(), and removeDecoys().
| int protocols::cluster::calibur::Clustering::n_pdbs_ |
Referenced by auxClustering(), buildAdjacentLists(), findLargestClusters(), initialize(), initRef(), listAdjacentLists(), readDecoys(), realignDecoys(), and reinitialize().
| StringVec protocols::cluster::calibur::Clustering::names_ |
| std::vector< int > protocols::cluster::calibur::Clustering::num_neighbors_ |
Referenced by cluster(), findLargestClusters(), and reinitialize().
| std::vector< StruOP > protocols::cluster::calibur::Clustering::PDBs_ |
Referenced by estD(), eucD(), getPDBs(), getThresholdAndDecoys(), readDecoys(), realignDecoys(), reinitialize(), and trueD().
| bool protocols::cluster::calibur::Clustering::pref_ref_use_first_few_decoys |
Referenced by initRef().
| bool protocols::cluster::calibur::Clustering::pref_use_scud |
Referenced by auxClustering(), buildAdjacentLists(), and initialize().
| bool protocols::cluster::calibur::Clustering::pref_use_sig |
Referenced by auxClustering(), buildAdjacentLists(), get_neighbor_list(), initialize(), and readDecoys().
| std::vector< core::Real > protocols::cluster::calibur::Clustering::references_ |
Referenced by initRef(), and refBound().
| std::vector< int > protocols::cluster::calibur::Clustering::remaining_list_ |
Referenced by findDecoyWithMostNeighbors(), findLargestClusters(), and removeDecoys().
| std::vector< int > protocols::cluster::calibur::Clustering::remaining_list_index_ |
Referenced by findLargestClusters(), and removeDecoys().
| core::Real* protocols::cluster::calibur::Clustering::result_coords |
Referenced by allocateSpaceForRMSD(), and superimposeAndReplace().
| bool protocols::cluster::calibur::Clustering::spaceAllocatedForRMSD |
Referenced by allocateSpaceForRMSD(), and Clustering().
| core::Real protocols::cluster::calibur::Clustering::THRESHOLD |
Referenced by buildAdjacentLists(), getThresholdAndDecoys(), initialize(), readDecoys(), and reinitialize().
| core::Real protocols::cluster::calibur::Clustering::xFactor |
Referenced by getThresholdAndDecoys().
| core::Real protocols::cluster::calibur::Clustering::xPercentile |
Referenced by estimateDist(), and getThresholdAndDecoys().
1.8.7