Rosetta  2021.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
protocols::legacy_sewing::Hasher Class Reference

#include <Hasher.hh>

Inheritance diagram for protocols::legacy_sewing::Hasher:
Inheritance graph
[legend]

Public Member Functions

 Hasher ()
 default constructor More...
 
ScoreResult score_one (Model const &m1, SewResidue const &m1_basis, Model const &m2, SewResidue const &m2_basis, core::Size box_length)
 
void insert (Model const &model)
 Insert this model into the hash table. More...
 
ScoreResults score (Model const &model, core::Size num_segment_matches, core::Size min_segment_score, core::Size max_clash_score, std::set< core::Size > const &score_segments, bool store_atoms, core::Size box_length) const
 
ScoreResults score (Model const &model, core::Size num_segment_matches, core::Size min_segment_score, core::Size max_clash_score, bool store_atoms, core::Size box_length) const
 Score the given model against the models in the hash table. More...
 
void score_basis (ScoreResults &alignment_scores, Model const &transformed_model, SewResidue const &basis_residue, bool store_atoms) const
 
void score_basis_125 (ScoreResults &alignment_scores, Model const &transformed_model, SewResidue const &basis_residue, bool store_atoms) const
 
void trim_scores (ScoreResults &scores, core::Size num_segment_matches, core::Size min_segment_score, core::Size max_clash_score) const
 Trim the ScoreResults to remove weak hits. More...
 
ScoreResults remove_duplicates (ScoreResults const &scores) const
 keep only best scoring alignment between two models More...
 
void remove_connection_inconsistencies (std::map< int, Model > const &models, ScoreResults &scores) const
 remove edges between segments that both have 'next' or 'previous' segments More...
 
HashMap const & hash_map () const
 const accessor to the underlying hash map More...
 
void neighborhood_lookup (HashKey const &key, utility::fixedsizearray1< HashMap::const_iterator, 27 > &hit_its) const
 retrive hits from the bin corresponding to the key (3D voxel) and all neighboring quarter-angstrom bins More...
 
void neighborhood_lookup_125 (HashKey const &key, utility::fixedsizearray1< HashMap::const_iterator, 125 > &hit_its) const
 retrive hits from the bin corresponding to the key (3D voxel) and all neighboring quarter-angstrom bins More...
 
Model transform_model (Model const &model, SewResidue const &basis_residue) const
 Transform all features to the local coordinate frame of the basis set. More...
 
void hash_model (Model const &transformed_model, SewResidue const &basis_residue)
 Hash the transformed residues into the HashMap. More...
 
HashKey generate_key (SewAtom const &atom) const
 Create the HashKey from a SewAtom. More...
 
void write_to_disk (std::string filename) const
 Serialize hash table to disk. More...
 
void read_from_disk (std::string filename)
 Populate the hash table from one on disk. More...
 

Private Attributes

HashMap hash_map_
 

Constructor & Destructor Documentation

protocols::legacy_sewing::Hasher::Hasher ( )

default constructor

References hash_map_.

Member Function Documentation

HashKey protocols::legacy_sewing::Hasher::generate_key ( SewAtom const &  atom) const

Create the HashKey from a SewAtom.

References protocols::legacy_sewing::SewAtom::coords_.

Referenced by hash_model(), score_basis(), and score_basis_125().

HashMap const & protocols::legacy_sewing::Hasher::hash_map ( ) const

const accessor to the underlying hash map

References hash_map_.

void protocols::legacy_sewing::Hasher::hash_model ( Model const &  transformed_model,
SewResidue const &  basis_residue 
)
void protocols::legacy_sewing::Hasher::insert ( Model const &  model)

Insert this model into the hash table.

Insert the features into the HashMap. This is done by iterating through all possible basis sets (coordinate frames defined by atom positions), and for each set transform all features to the corresponding local coordinates and then insert then into the hash table. The complexity of this operation should be O(m^4) where m is the number of features. The total size of the HashMap should be O(N * m^4) where N is the number of hashed objects.

References protocols::legacy_sewing::SewResidue::basis_atoms_, hash_model(), protocols::legacy_sewing::Model::segments_, and transform_model().

Referenced by protocols::legacy_sewing::LegacyAppendAssemblyMover::hash_pdb_model().

void protocols::legacy_sewing::Hasher::neighborhood_lookup ( HashKey const &  key,
utility::fixedsizearray1< HashMap::const_iterator, 27 > &  hit_its 
) const

retrive hits from the bin corresponding to the key (3D voxel) and all neighboring quarter-angstrom bins

when doing a lookup, look in each of the quarter angstrom bins surrounding the query key. This should prevent issues of close matches being missed due to being across bin boundaries.

References hash_map_.

Referenced by score_basis().

void protocols::legacy_sewing::Hasher::neighborhood_lookup_125 ( HashKey const &  key,
utility::fixedsizearray1< HashMap::const_iterator, 125 > &  hit_its 
) const

retrive hits from the bin corresponding to the key (3D voxel) and all neighboring quarter-angstrom bins

when doing a lookup, look in each of the quarter angstrom bins surrounding the query key. This should prevent issues of close matches being missed due to being across bin boundaries.

References hash_map_.

Referenced by score_basis_125().

void protocols::legacy_sewing::Hasher::read_from_disk ( std::string  filename)
void protocols::legacy_sewing::Hasher::remove_connection_inconsistencies ( std::map< int, Model > const &  models,
ScoreResults scores 
) const
ScoreResults protocols::legacy_sewing::Hasher::remove_duplicates ( ScoreResults const &  scores) const

keep only best scoring alignment between two models

Keep only the segment matches between two models that has the most aligned atoms.

References protocols::legacy_sewing::TR().

Referenced by score().

ScoreResults protocols::legacy_sewing::Hasher::score ( Model const &  model,
core::Size  num_segment_matches,
core::Size  min_segment_score,
core::Size  max_clash_score,
std::set< core::Size > const &  score_segments,
bool  store_atoms,
core::Size  box_length 
) const

Tally the score of each model/basis_set in the HashMap against the input pose. This is very similar to the insert function, but instead of populating the hash with the transformed features, you tally the number of HashMap hits corresponding to each structure/basis_set pair.

References protocols::legacy_sewing::Model::model_id_, remove_duplicates(), score_basis(), score_basis_125(), protocols::legacy_sewing::Model::segments_, protocols::legacy_sewing::TR(), transform_model(), and trim_scores().

Referenced by protocols::legacy_sewing::LegacyAppendAssemblyMover::hash_pdb_model(), and score().

ScoreResults protocols::legacy_sewing::Hasher::score ( Model const &  model,
core::Size  num_segment_matches,
core::Size  min_segment_score,
core::Size  max_clash_score,
bool  store_atoms,
core::Size  box_length 
) const

Score the given model against the models in the hash table.

References score(), protocols::legacy_sewing::Model::segments_, and protocols::legacy_sewing::TR().

void protocols::legacy_sewing::Hasher::score_basis ( ScoreResults alignment_scores,
Model const &  transformed_model,
SewResidue const &  basis_residue,
bool  store_atoms 
) const
void protocols::legacy_sewing::Hasher::score_basis_125 ( ScoreResults alignment_scores,
Model const &  transformed_model,
SewResidue const &  basis_residue,
bool  store_atoms 
) const
ScoreResult protocols::legacy_sewing::Hasher::score_one ( Model const &  m1,
SewResidue const &  m1_basis,
Model const &  m2,
SewResidue const &  m2_basis,
core::Size  box_length 
)
Model protocols::legacy_sewing::Hasher::transform_model ( Model const &  model_in,
SewResidue const &  basis_residue 
) const
void protocols::legacy_sewing::Hasher::trim_scores ( ScoreResults scores,
core::Size  num_segment_matches,
core::Size  min_segment_score,
core::Size  max_clash_score 
) const

Trim the ScoreResults to remove weak hits.

trim the given ScoreResults based on the number of segments that match between two models, the number of atom matches for each of these segments, and the clash score (number of hits between atoms of different atom_types)

References protocols::legacy_sewing::TR().

Referenced by score().

void protocols::legacy_sewing::Hasher::write_to_disk ( std::string  filename) const

Serialize hash table to disk.

write the hash table to disk!

References hash_map_.

Member Data Documentation

HashMap protocols::legacy_sewing::Hasher::hash_map_
private

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