Rosetta Protocols  2014.35
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
protocols::loophash::LoopHashMap Class Reference

the loop hash map stores LeapIndexes and a hashmap to access those LeapIndexes quickly by their 6D coordinates. More...

#include <LoopHashMap.hh>

Classes

struct  by_index
 A functor for sort() More...
 

Public Member Functions

 LoopHashMap (core::Size loop_size=10)
 Constructor - must give loop_size. More...
 
 LoopHashMap (LoopHashMap const &other)
 
LoopHashMap operator= (LoopHashMap const &other)
 
void add_leap (const LeapIndex &leap_index, numeric::geometry::hashing::Real6 &transform)
 Add a leap/loop to the HashMap. More...
 
void add_leap (const LeapIndex &leap_index, boost::uint64_t key)
 Add a leap/loop to the HashMap with a key, skipping hashing. More...
 
void add_legacyleap (const LegacyLeapIndex &legacyleap_index)
 Add an legacy leap/loop to the HashMap. More...
 
const LeapIndexget_peptide (core::Size index)
 Obtain an index to a given peptide saved. More...
 
core::Size n_loops () const
 
void radial_lookup_withkey (boost::uint64_t key, core::Size radius, std::vector< core::Size > &result)
 Return a vector of loops with equal keys given a key. More...
 
void lookup_withkey (boost::uint64_t key, std::vector< core::Size > &result)
 Return a vector of loops with equal keys given a key. More...
 
void lookup (numeric::geometry::hashing::Real6 transform, std::vector< core::Size > &result)
 Append to a bucket of vectors in the appropriate bin, lookup by transform. More...
 
void radial_lookup (core::Size radius, numeric::geometry::hashing::Real6 transform, std::vector< core::Size > &result)
 Append to a bucket of vectors in the appropriate bin, radial lookup by transform. More...
 
core::Size radial_count (core::Size radius, numeric::geometry::hashing::Real6 center) const
 count hits in the appropriate bin, radial lookup by transform More...
 
void lookup (core::Size index, std::vector< core::Size > &result)
 Append to a bucket of vectors in the appropriate bin, lookup by bin index. More...
 
void bbdb_range (std::pair< BackboneIndexMap::iterator, BackboneIndexMap::iterator > &range)
 Returns begin() and end() of backbone_index_map_. More...
 
boost::uint64_t return_key (core::Size bb_index)
 Returns a hashmap key given a member of a bucket Don't think boost implements this, have to manually look it up. More...
 
core::Size get_loop_size () const
 Query the loopsize of this LoopHashMap. More...
 
void read_legacydb (std::string filename)
 Reads legacy binary dbs. More...
 
void write_db (std::string filename)
 Basic IO functionality - allows reading and writing text states to/from disk. More...
 
void read_db (std::string filename, std::pair< core::Size, core::Size > loopdb_range, std::map< core::Size, bool > &homolog_index)
 Basic IO functionality - allows reading and writing text states to/from disk. More...
 
void read_db (std::string filename)
 
void mem_foot_print ()
 Return the memory usage of this class. More...
 
void sort ()
 Sorts the loopdb_ by leap_index.index. More...
 

Private Member Functions

void setup (core::Size loop_size)
 Setup this class give a loop_size. More...
 
void hash_index (numeric::geometry::hashing::Real6 transform, core::Size data)
 Add a given piece of data to the hash. More...
 

Private Attributes

numeric::geometry::hashing::SixDCoordinateBinnerOP hash_
 A class that will take a 6D rigid body transform and turn it into a serial hashbin number for hashing. THis is the actual hash so to speak. More...
 
BackboneIndexMap backbone_index_map_
 The actual Boost-based hashmap. More...
 
std::vector< LeapIndexloopdb_
 List of LeadIndexes. More...
 
core::Size loop_size_
 The length of the the loops in number of residues. More...
 

Detailed Description

the loop hash map stores LeapIndexes and a hashmap to access those LeapIndexes quickly by their 6D coordinates.

Constructor & Destructor Documentation

protocols::loophash::LoopHashMap::LoopHashMap ( core::Size  loop_size = 10)

Constructor - must give loop_size.

References setup.

protocols::loophash::LoopHashMap::LoopHashMap ( LoopHashMap const &  other)

Member Function Documentation

void protocols::loophash::LoopHashMap::add_leap ( const LeapIndex leap_index,
numeric::geometry::hashing::Real6 transform 
)
void protocols::loophash::LoopHashMap::add_leap ( const LeapIndex leap_index,
boost::uint64_t  key 
)

Add a leap/loop to the HashMap with a key, skipping hashing.

References backbone_index_map_, and loopdb_.

void protocols::loophash::LoopHashMap::add_legacyleap ( const LegacyLeapIndex legacyleap_index)
void protocols::loophash::LoopHashMap::bbdb_range ( std::pair< BackboneIndexMap::iterator, BackboneIndexMap::iterator > &  range)

Returns begin() and end() of backbone_index_map_.

References backbone_index_map_.

Referenced by protocols::loophash::LoopHashLibrary::merge().

core::Size protocols::loophash::LoopHashMap::get_loop_size ( ) const
inline
const LeapIndex& protocols::loophash::LoopHashMap::get_peptide ( core::Size  index)
inline
void protocols::loophash::LoopHashMap::hash_index ( numeric::geometry::hashing::Real6  transform,
core::Size  data 
)
private
void protocols::loophash::LoopHashMap::lookup ( numeric::geometry::hashing::Real6  transform,
std::vector< core::Size > &  result 
)
void protocols::loophash::LoopHashMap::lookup ( core::Size  index,
std::vector< core::Size > &  result 
)

Append to a bucket of vectors in the appropriate bin, lookup by bin index.

Using core::Size instead of boost::uinst64_t

References backbone_index_map_, begin, and end.

void protocols::loophash::LoopHashMap::lookup_withkey ( boost::uint64_t  key,
std::vector< core::Size > &  result 
)

Return a vector of loops with equal keys given a key.

References backbone_index_map_, and protocols::sic_dock::range().

Referenced by protocols::loophash::LoopHashLibrary::test_loop_sample().

void protocols::loophash::LoopHashMap::mem_foot_print ( )

Return the memory usage of this class.

References backbone_index_map_, loopdb_, and protocols::loophash::TR.

core::Size protocols::loophash::LoopHashMap::n_loops ( ) const
inline

References loopdb_.

LoopHashMap protocols::loophash::LoopHashMap::operator= ( LoopHashMap const &  other)
Size protocols::loophash::LoopHashMap::radial_count ( core::Size  radius,
numeric::geometry::hashing::Real6  center 
) const
void protocols::loophash::LoopHashMap::radial_lookup ( core::Size  radius,
numeric::geometry::hashing::Real6  transform,
std::vector< core::Size > &  result 
)
void protocols::loophash::LoopHashMap::radial_lookup_withkey ( boost::uint64_t  key,
core::Size  radius,
std::vector< core::Size > &  result 
)
void protocols::loophash::LoopHashMap::read_db ( std::string  filename,
std::pair< core::Size, core::Size loopdb_range,
std::map< core::Size, bool > &  homolog_index 
)

Basic IO functionality - allows reading and writing text states to/from disk.

References add_leap(), file, getline(), protocols::loophash::LeapIndex::index, protocols::loophash::LeapIndex::key, loopdb_, protocols::loophash::LeapIndex::offset, output, t, and protocols::loophash::TR.

Referenced by read_db().

void protocols::loophash::LoopHashMap::read_db ( std::string  filename)
inline
void protocols::loophash::LoopHashMap::read_legacydb ( std::string  filename)

Reads legacy binary dbs.

References add_legacyleap(), backbone_index_map_, file, loopdb_, and protocols::loophash::TR.

boost::uint64_t protocols::loophash::LoopHashMap::return_key ( core::Size  bb_index)

Returns a hashmap key given a member of a bucket Don't think boost implements this, have to manually look it up.

References get_peptide(), and protocols::loophash::LeapIndex::key.

void protocols::loophash::LoopHashMap::setup ( core::Size  loop_size)
private
void protocols::loophash::LoopHashMap::sort ( )

Sorts the loopdb_ by leap_index.index.

References loopdb_.

void protocols::loophash::LoopHashMap::write_db ( std::string  filename)

Basic IO functionality - allows reading and writing text states to/from disk.

References file, and loopdb_.

Member Data Documentation

BackboneIndexMap protocols::loophash::LoopHashMap::backbone_index_map_
private
numeric::geometry::hashing::SixDCoordinateBinnerOP protocols::loophash::LoopHashMap::hash_
private

A class that will take a 6D rigid body transform and turn it into a serial hashbin number for hashing. THis is the actual hash so to speak.

Referenced by hash_index(), lookup(), operator=(), radial_count(), radial_lookup(), radial_lookup_withkey(), and setup().

core::Size protocols::loophash::LoopHashMap::loop_size_
private

The length of the the loops in number of residues.

Referenced by get_loop_size(), operator=(), and setup().

std::vector< LeapIndex> protocols::loophash::LoopHashMap::loopdb_
private

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