Public Member Functions | Public Attributes | List of all members
protocols::cluster::calibur::Clustering Class Reference

#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< StruOPreadDecoys (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
core::Real xPercentile
bool autoAdjustPercentile
core::Real xFactor
std::string mInputFileName
StringVec names_
std::vector< StruOPPDBs_
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::RealmD2C
std::vector< int > num_neighbors_
core::Real bestClusMargin
int bestClusSize
std::vector< AdjacentListOPadjacent_lists_
std::vector< core::Realreferences_
int mFinalDecoy
std::vector< AdjacentListOPmFinalClusters
std::vector< int > remaining_list_
std::vector< int > remaining_list_index_
int mRemainingSize
bool spaceAllocatedForRMSD

Constructor & Destructor Documentation

◆ Clustering()

protocols::cluster::calibur::Clustering::Clustering ( )

Member Function Documentation

◆ allocateSpaceForRMSD()

void protocols::cluster::calibur::Clustering::allocateSpaceForRMSD ( int  len)

References result_coords, and spaceAllocatedForRMSD.

Referenced by readDecoys().

◆ auxClustering()

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_, CLU_RADIUS, estD(), eucD(), mCen, mCluCen, mD2C, n_pdbs_, pref_use_scud, pref_use_sig, refBound(), and trueD().

Referenced by cluster().

◆ buildAdjacentLists()

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_, 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().

◆ cluster()

void protocols::cluster::calibur::Clustering::cluster ( )

◆ destroyRandomDecoys()

void protocols::cluster::calibur::Clustering::destroyRandomDecoys ( StringVec const &  ,
std::vector< StruOP > const &   

Destroy the random decoys

Referenced by estimateDist(), and getThresholdAndDecoys().

◆ estD() [1/2]

core::Real protocols::cluster::calibur::Clustering::estD ( int  i,
int  j 

References mLen, and PDBs_.

Referenced by auxClustering(), buildAdjacentLists(), and readDecoys().

◆ estD() [2/2]

core::Real protocols::cluster::calibur::Clustering::estD ( Stru const &  a,
Stru const &  b 

◆ estimateDist() [1/2]

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.

◆ estimateDist() [2/2]

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

  1. min of pairwise distance,
  2. max of pairwise distance,
  3. most frequent distance,
  4. distance t at which xPercent of pairwise distances are below t, from all trials. The number of random decoys to use in each trial is stated in randDecoySize.

References destroyRandomDecoys(), getRandomDecoyNames(), and readDecoys().

Referenced by getThresholdAndDecoys().

◆ eucD()

core::Real protocols::cluster::calibur::Clustering::eucD ( int  i,
int  j 

◆ findDecoyWithMostNeighbors()

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().

◆ findLargestClusters()

void protocols::cluster::calibur::Clustering::findLargestClusters ( )

◆ get_neighbor_list() [1/2]

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().

◆ get_neighbor_list() [2/2]

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().

◆ get_threshold()

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().

◆ getPDBs()

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_.

◆ getRandomDecoyNames()

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().

◆ getThresholdAndDecoys()

void protocols::cluster::calibur::Clustering::getThresholdAndDecoys ( )

◆ initialize()

void protocols::cluster::calibur::Clustering::initialize ( std::string const &  filename,
core::Real  threshold 

◆ initRef()

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().

◆ listAdjacentLists()

void protocols::cluster::calibur::Clustering::listAdjacentLists ( )

◆ readDecoyNames()

void protocols::cluster::calibur::Clustering::readDecoyNames ( )

◆ readDecoys() [1/2]

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.

◆ readDecoys() [2/2]

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().

◆ realignDecoys()

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_, core::scoring::ref, protocols::loops::start, and superimposeAndReplace().

Referenced by initialize().

◆ refBound()

void protocols::cluster::calibur::Clustering::refBound ( int  i,
int  j,
core::Real lower,
core::Real upper 

◆ reinitialize()

void protocols::cluster::calibur::Clustering::reinitialize ( StringVec const &  nNames,
std::vector< StruOP > const &  nPDBs,
core::Real const  threshold 

◆ removeDecoys()

void protocols::cluster::calibur::Clustering::removeDecoys ( AdjacentList adj)

◆ showClusters()

void protocols::cluster::calibur::Clustering::showClusters ( int  numClus)

◆ superimposeAndReplace()

void protocols::cluster::calibur::Clustering::superimposeAndReplace ( std::vector< core::Real > &  coor1,
std::vector< core::Real > &  coor2 

◆ trueD() [1/2]

core::Real protocols::cluster::calibur::Clustering::trueD ( int  i,
int  j 

◆ trueD() [2/2]

core::Real protocols::cluster::calibur::Clustering::trueD ( Stru const &  a,
Stru const &  b 

Member Data Documentation

◆ adjacent_lists_

std::vector< AdjacentListOP > protocols::cluster::calibur::Clustering::adjacent_lists_

◆ autoAdjustPercentile

bool protocols::cluster::calibur::Clustering::autoAdjustPercentile

Referenced by estimateDist().

◆ auxiliary_clusters_

std::vector< int >** protocols::cluster::calibur::Clustering::auxiliary_clusters_

◆ bestClusMargin

core::Real protocols::cluster::calibur::Clustering::bestClusMargin

Referenced by cluster(), and Clustering().

◆ bestClusSize

int protocols::cluster::calibur::Clustering::bestClusSize

Referenced by cluster().


core::Real protocols::cluster::calibur::Clustering::CLU_RADIUS

◆ coord1

core::Real* protocols::cluster::calibur::Clustering::coord1

◆ coord2

core::Real* protocols::cluster::calibur::Clustering::coord2


EST_THRESHOLD_MODE protocols::cluster::calibur::Clustering::EST_THRESHOLD


bool protocols::cluster::calibur::Clustering::FILTER_MODE

◆ mCen

std::vector< int > protocols::cluster::calibur::Clustering::mCen

◆ mCluCen

std::vector< int > protocols::cluster::calibur::Clustering::mCluCen

◆ mD2C

std::vector< core::Real > protocols::cluster::calibur::Clustering::mD2C

◆ mFinalClusters

std::vector< AdjacentListOP > protocols::cluster::calibur::Clustering::mFinalClusters

◆ mFinalDecoy

int protocols::cluster::calibur::Clustering::mFinalDecoy

◆ mInputFileName

std::string protocols::cluster::calibur::Clustering::mInputFileName

Referenced by initialize(), and readDecoyNames().

◆ mLen

int protocols::cluster::calibur::Clustering::mLen

◆ mRemainingSize

int protocols::cluster::calibur::Clustering::mRemainingSize

◆ n_pdbs_

int protocols::cluster::calibur::Clustering::n_pdbs_

◆ names_

StringVec protocols::cluster::calibur::Clustering::names_

◆ num_neighbors_

std::vector< int > protocols::cluster::calibur::Clustering::num_neighbors_

◆ PDBs_

std::vector< StruOP > protocols::cluster::calibur::Clustering::PDBs_

◆ pref_ref_use_first_few_decoys

bool protocols::cluster::calibur::Clustering::pref_ref_use_first_few_decoys

Referenced by initRef().

◆ pref_use_scud

bool protocols::cluster::calibur::Clustering::pref_use_scud

◆ pref_use_sig

bool protocols::cluster::calibur::Clustering::pref_use_sig

◆ references_

std::vector< core::Real > protocols::cluster::calibur::Clustering::references_

Referenced by initRef(), and refBound().

◆ remaining_list_

std::vector< int > protocols::cluster::calibur::Clustering::remaining_list_

◆ remaining_list_index_

std::vector< int > protocols::cluster::calibur::Clustering::remaining_list_index_

◆ result_coords

core::Real* protocols::cluster::calibur::Clustering::result_coords

◆ spaceAllocatedForRMSD

bool protocols::cluster::calibur::Clustering::spaceAllocatedForRMSD

Referenced by allocateSpaceForRMSD(), and Clustering().


core::Real protocols::cluster::calibur::Clustering::THRESHOLD

◆ xFactor

core::Real protocols::cluster::calibur::Clustering::xFactor

Referenced by getThresholdAndDecoys().

◆ xPercentile

core::Real protocols::cluster::calibur::Clustering::xPercentile

The documentation for this class was generated from the following files: