![]() |
Rosetta
2021.16
|
#include <Hasher.hh>

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_ |
| protocols::legacy_sewing::Hasher::Hasher | ( | ) |
default constructor
References hash_map_.
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 | ||
| ) |
Hash the transformed residues into the HashMap.
For each of the transformed features, insert the appropriate key-value pair into the hash table. The key is the 3D-voxel (or bin) corresponding to the basis set. The value is the residues number for the residue that generated basis set that the transformed atom coordinates are in frame of
References protocols::legacy_sewing::ModelConstIterator< T >::atom(), protocols::legacy_sewing::HashValue::atomno, protocols::legacy_sewing::HashValue::basis_resnum, generate_key(), hash_map_, protocols::legacy_sewing::Model::model_begin(), protocols::legacy_sewing::Model::model_end(), protocols::legacy_sewing::HashValue::model_id, protocols::legacy_sewing::Model::model_id_, protocols::legacy_sewing::ModelConstIterator< T >::residue(), protocols::legacy_sewing::HashValue::resnum, protocols::legacy_sewing::SewResidue::resnum_, protocols::legacy_sewing::ModelConstIterator< T >::segment(), and protocols::legacy_sewing::HashValue::segment_id.
Referenced by insert(), and score_one().
| 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 | ) |
Populate the hash table from one on disk.
read the hash table from disk. This function clears the contents of the hash map
References protocols::legacy_sewing::HashValue::atomno, protocols::legacy_sewing::HashValue::basis_resnum, hash_map_, protocols::legacy_sewing::HashValue::model_id, protocols::legacy_sewing::HashValue::resnum, and protocols::legacy_sewing::HashValue::segment_id.
| void protocols::legacy_sewing::Hasher::remove_connection_inconsistencies | ( | std::map< int, Model > const & | models, |
| ScoreResults & | scores | ||
| ) | const |
remove edges between segments that both have 'next' or 'previous' segments
References protocols::legacy_sewing::SegmentGraph::has_next(), protocols::legacy_sewing::SegmentGraph::has_previous(), protocols::legacy_sewing::Model::segments_, and protocols::legacy_sewing::TR().
| 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 |
References protocols::legacy_sewing::ModelConstIterator< T >::atom(), protocols::legacy_sewing::SewAtom::atomno_, generate_key(), hash_map_, protocols::legacy_sewing::Model::model_begin(), protocols::legacy_sewing::Model::model_end(), protocols::legacy_sewing::Model::model_id_, neighborhood_lookup(), protocols::legacy_sewing::ModelConstIterator< T >::residue(), protocols::legacy_sewing::SewResidue::resnum_, protocols::legacy_sewing::ModelConstIterator< T >::segment(), and protocols::legacy_sewing::Model::segments_.
Referenced by score(), and score_one().
| void protocols::legacy_sewing::Hasher::score_basis_125 | ( | ScoreResults & | alignment_scores, |
| Model const & | transformed_model, | ||
| SewResidue const & | basis_residue, | ||
| bool | store_atoms | ||
| ) | const |
References protocols::legacy_sewing::ModelConstIterator< T >::atom(), protocols::legacy_sewing::SewAtom::atomno_, generate_key(), hash_map_, protocols::legacy_sewing::Model::model_begin(), protocols::legacy_sewing::Model::model_end(), protocols::legacy_sewing::Model::model_id_, neighborhood_lookup_125(), protocols::legacy_sewing::ModelConstIterator< T >::residue(), protocols::legacy_sewing::SewResidue::resnum_, and protocols::legacy_sewing::ModelConstIterator< T >::segment().
Referenced by score(), and score_one().
| 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 | ||
| ) |
References hash_model(), protocols::legacy_sewing::Model::model_id_, protocols::legacy_sewing::SewResidue::resnum_, score_basis(), score_basis_125(), protocols::legacy_sewing::TR(), and transform_model().
Referenced by protocols::legacy_sewing::Assembly::follow_edge(), and protocols::legacy_sewing::Assembly::get_score_result().
| Model protocols::legacy_sewing::Hasher::transform_model | ( | Model const & | model_in, |
| SewResidue const & | basis_residue | ||
| ) | const |
Transform all features to the local coordinate frame of the basis set.
Construct HomogenousTransform using the 3 points in the BasisSet. Use this HomogenousTransform to transform all features into the local coordinate frame
References protocols::legacy_sewing::ModelIterator< T >::atom(), protocols::legacy_sewing::SewResidue::basis_atoms_, protocols::legacy_sewing::Model::model_begin(), protocols::legacy_sewing::Model::model_end(), protocols::legacy_sewing::ModelIterator< T >::residue(), protocols::legacy_sewing::SewResidue::resnum_, protocols::legacy_sewing::ModelIterator< T >::segment(), and protocols::legacy_sewing::ModelIterator< T >::segment_valid().
Referenced by insert(), score(), and score_one().
| 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 |
|
private |
Referenced by hash_map(), hash_model(), Hasher(), neighborhood_lookup(), neighborhood_lookup_125(), read_from_disk(), score_basis(), score_basis_125(), and write_to_disk().
1.8.7