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

#include <LoopHashLibrary.hh>

Inheritance diagram for protocols::loophash::LoopHashLibrary:
Inheritance graph
[legend]

Public Member Functions

 LoopHashLibrary (const utility::vector1< core::Size > &init_sizes=utility::vector1< core::Size >(), const core::Size num_partitions=1, const core::Size assigned_num=0)
 
void extract_data_from_pose (core::pose::Pose &pose, core::Size nres, protocols::frag_picker::VallChunkOP chunk=nullptr)
 
void extract_data_from_pose (core::pose::Pose &pose)
 
bool test_saving_library (core::pose::Pose, core::Size ir, bool deposit)
 
void test_loop_sample (core::pose::Pose &pose, core::Size nres)
 
void apply_random (core::pose::Pose &pose, core::Size &fir, core::Size &fjr, core::Real min_rms, core::Real max_rms)
 
void get_all (core::pose::Pose &pose, std::vector< core::io::silent::SilentStructOP > &lib_structs, core::Size start_res=1, core::Size stop_res=0, core::Real min_bbrms=0.0, core::Real max_bbrms=100000.0, core::Real min_rms=0.0, core::Real max_rms=100.0)
 
void apply (core::pose::Pose &pose) override
 Main Method. More...
 
protocols::moves::MoverOP clone () const override
 Return a clone of the Mover object. More...
 
std::string get_name () const override
 Each derived class must specify its name. The class name. More...
 
protocols::moves::MoverOP fresh_instance () const override
 Generates a new Mover object freshly created with the default ctor. More...
 
void setup_hash_maps ()
 
LoopHashMap const & gethash (core::Size size) const
 
LoopHashMapgethash (core::Size size)
 
std::vector< core::Size > const & hash_sizes () const
 Return a list of the loop lengths present in the library. More...
 
BackboneDB const & backbone_database () const
 
std::pair< core::Size, core::Sizeloopdb_range () const
 
void save_db () const
 
void load_db ()
 
void load_mergeddb ()
 
void delete_db ()
 
void merge (LoopHashLibraryOP second_lib, utility::vector1< core::Real > rms_cutoffs)
 Take two LoopHash libraries and merge them. More...
 
bool merge_bbdb (const BackboneDB &second_bbdb, core::Size &index_offset)
 Take two backbone databases and merge them. More...
 
void sort ()
 
void create_db ()
 
void set_create_db (bool setting=true)
 
void set_db_path (std::string setting)
 
void graft_loop (const core::pose::Pose &src_pose, core::pose::Pose &tgt_pose, protocols::loops::Loop myloop)
 
void set_default_score_functions ()
 
void mem_foot_print () const
 
bool get_extra () const
 
- Public Member Functions inherited from protocols::moves::Mover
 Mover ()
 
virtual MoverOP create ()
 
MoverCOP get_self_ptr () const
 
MoverOP get_self_ptr ()
 
MoverCAP get_self_weak_ptr () const
 
MoverAP get_self_weak_ptr ()
 
 Mover (std::string const &type_name)
 sets the type for a mover; name_ has been removed (2010/05/14) More...
 
virtual void test_move (Pose &pose)
 : Unit test support function. Apply one move to a given pose. Allows extra test specific functions to be called before applying More...
 
virtual bool reinitialize_for_each_job () const
 Inform the Job Distributor (August '08 vintage) whether this object needs to be freshly regenerated on each use. More...
 
virtual bool reinitialize_for_new_input () const
 Inform the Job Distributor (August '08 vintage) whether this object needs to be regenerated when the input pose is about to change, (for example, if the Mover has special code on the first apply() that is only valid for that one input pose). More...
 
MoverStatus get_last_move_status () const
 end parser interface, start Job Distributor interface///////////// More...
 
void reset_status ()
 resets status to SUCCESS, meant to be used before an apply(). The job distributor (august 08 vintage) uses this to ensure non-accumulation of status across apply()s. More...
 
virtual core::pose::PoseOP get_additional_output ()
 Mechanism by which a mover may return multiple output poses from a single input pose. More...
 
void set_type (std::string const &setting)
 Set the 'type' string. More...
 
std::string get_type () const
 
void type (const std::string &type_in)
 Set the 'type' string. More...
 
std::string const & type () const
 Get the set 'type' string. More...
 
virtual void set_input_pose (PoseCOP pose)
 setter for poses contained for rms More...
 
virtual void set_native_pose (PoseCOP pose)
 setter for native poses contained for rms -— we should get rid of this method? it is widely used, but a bit unsafe More...
 
PoseCOP get_input_pose () const
 
PoseCOP get_native_pose () const
 
virtual void parse_my_tag (TagCOP tag, basic::datacache::DataMap &data)
 Called by MoverFactory when constructing new Movers. Takes care of the specific mover's parsing. More...
 
void set_current_job (protocols::jobdist::BasicJobCOP job)
 
jobdist::BasicJobCOP get_current_job () const
 
virtual void set_current_tag (std::string const &new_tag)
 
std::string get_current_tag () const
 A tag is a unique identifier used to identify structures produced by this Mover. get_current_tag() returns the tag, and set_current_tag( std::string tag ) sets the tag. This functionality is not intended for use with the 2008 job distributor. More...
 
virtual void show (std::ostream &output=std::cout) const
 Outputs details about the Mover, including current settings. More...
 
virtual core::Real last_proposal_density_ratio ()
 
virtual void clear_info ()
 Strings container can be used to return miscellaneous info (as std::string) from a mover, such as notes about the results of apply(). The job distributor (Apr 09 vintage) will check this function to see if your protocol wants to add string info to the Job that ran this mover. One way this can be useful is that later, a JobOutputter may include/append this info to an output file. More...
 
virtual Stringsinfo ()
 non-const accessor More...
 
virtual Strings const & info () const
 const accessor More...
 
virtual bool mover_provides_citation_info () const
 Does this mover provide information about how to cite it? More...
 
virtual utility::vector1
< basic::citation_manager::CitationCollectionCOP > 
provide_citation_info () const
 Provide the citation. More...
 
virtual bool mover_is_unpublished () const
 Does this mover indicate that it is unpublished (and, by extension, that the author should be included in publications resulting from it)? More...
 
virtual utility::vector1
< basic::citation_manager::UnpublishedModuleInfoCOP > 
provide_authorship_info_for_unpublished () const
 Provide a list of authors and their e-mail addresses, as strings. More...
 

Private Attributes

BackboneDB bbdb_
 The backbone library for this HashLibrary (the actual data) More...
 
std::map< core::Size, LoopHashMaphash_
 A map of Hashmaps, each for a different loop size. More...
 
std::vector< core::Sizehash_sizes_
 Kind-of a redundant store of sizes (remove this?) More...
 
std::string db_path_
 Path to database. More...
 
core::Size num_partitions_
 The number of partitions the database is split into. More...
 
core::Size assigned_num_
 Which partition slice is assigned to this library. More...
 
std::string assigned_string_
 Need so we can set the database string once. More...
 
bool extra_
 Whether this database holds extra data in the backbone database or not. More...
 
std::pair< core::Size, core::Sizeloopdb_range_
 The proteins of the backbone database that are loaded (when loading a merged database, otherwise (0,0)) More...
 
bool do_sanity_check_
 
bool create_db_
 
core::scoring::ScoreFunctionOP scorefxn_rama_cst_
 
core::scoring::ScoreFunctionOP scorefxn_cen_cst_
 
core::optimization::MinimizerOptions options_
 
core::optimization::MinimizerOptions options2_
 

Additional Inherited Members

- Public Types inherited from protocols::moves::Mover
typedef utility::tag::TagCOP TagCOP
 
typedef core::pose::Pose Pose
 
typedef core::pose::PoseCOP PoseCOP
 
typedef std::list< std::string > Strings
 
- Static Public Member Functions inherited from protocols::moves::Mover
static std::string name ()
 
static void register_options ()
 Overload this static method if you access options within the mover. More...
 
- Protected Member Functions inherited from protocols::moves::Mover
void set_last_move_status (MoverStatus status)
 nonvirtual setter for MoverStatus last_status_. Protected means that only the mover itself will be able to change its own status. The job distributor (august 08 vintage) is aware of status set with this function and will do what the MoverStatus says. More...
 

Constructor & Destructor Documentation

protocols::loophash::LoopHashLibrary::LoopHashLibrary ( const utility::vector1< core::Size > &  init_sizes = utility::vector1< core::Size >(),
const core::Size  num_partitions = 1,
const core::Size  assigned_num = 0 
)

Member Function Documentation

void protocols::loophash::LoopHashLibrary::apply ( core::pose::Pose )
overridevirtual
void protocols::loophash::LoopHashLibrary::apply_random ( core::pose::Pose pose,
core::Size fir,
core::Size fjr,
core::Real  min_rms,
core::Real  max_rms 
)
BackboneDB const& protocols::loophash::LoopHashLibrary::backbone_database ( ) const
inline

References bbdb_.

Referenced by test_saving_library().

protocols::moves::MoverOP protocols::loophash::LoopHashLibrary::clone ( ) const
inlineoverridevirtual

Return a clone of the Mover object.

clone is meant to return an OP'ed deep copy of this object. This really should be a pure virtual in the base class, but adding pure virtuals to Mover would massively disrupt the code. This default implementation crashes at runtime instead of compiletime if you try to call it. If this code is causing you problems, your Mover needs to override this function.

Reimplemented from protocols::moves::Mover.

void protocols::loophash::LoopHashLibrary::create_db ( )
void protocols::loophash::LoopHashLibrary::delete_db ( )
void protocols::loophash::LoopHashLibrary::extract_data_from_pose ( core::pose::Pose pose,
core::Size  nres,
protocols::frag_picker::VallChunkOP  chunk = nullptr 
)
void protocols::loophash::LoopHashLibrary::extract_data_from_pose ( core::pose::Pose pose)
protocols::moves::MoverOP protocols::loophash::LoopHashLibrary::fresh_instance ( ) const
inlineoverridevirtual

Generates a new Mover object freshly created with the default ctor.

fresh_instance is meant to return a new object of this class, created with the default constructor. This really should be a pure virtual in the base class, but adding pure virtuals to Mover would massively disrupt the code. This default implementation crashes at runtime instead of compiletime if you try to call it. If this code is causing you problems, your Mover needs to override this function. This is used by the August 08 job distributor.

Reimplemented from protocols::moves::Mover.

void protocols::loophash::LoopHashLibrary::get_all ( core::pose::Pose pose,
std::vector< core::io::silent::SilentStructOP > &  lib_structs,
core::Size  start_res = 1,
core::Size  stop_res = 0,
core::Real  min_bbrms = 0.0,
core::Real  max_bbrms = 100000.0,
core::Real  min_rms = 0.0,
core::Real  max_rms = 100.0 
)
bool protocols::loophash::LoopHashLibrary::get_extra ( ) const
inline

References extra_.

std::string protocols::loophash::LoopHashLibrary::get_name ( ) const
inlineoverridevirtual

Each derived class must specify its name. The class name.

Implements protocols::moves::Mover.

LoopHashMap const & protocols::loophash::LoopHashLibrary::gethash ( core::Size  size) const
LoopHashMap & protocols::loophash::LoopHashLibrary::gethash ( core::Size  size)

References hash_.

void protocols::loophash::LoopHashLibrary::graft_loop ( const core::pose::Pose src_pose,
core::pose::Pose tgt_pose,
protocols::loops::Loop  myloop 
)
std::vector< core::Size > const& protocols::loophash::LoopHashLibrary::hash_sizes ( ) const
inline

Return a list of the loop lengths present in the library.

References hash_sizes_.

void protocols::loophash::LoopHashLibrary::load_db ( )

Only support reading from text, extra data is mandatory. Used when created merged text db.

References assigned_string_, bbdb_, db_path_, extra_, hash_, hash_sizes_, protocols::loophash::BackboneDB::read_db(), core::id::to_string(), and protocols::loophash::TR().

void protocols::loophash::LoopHashLibrary::load_mergeddb ( )

Only support reading from merged text. Extra data is optional and handled by extra_.

References assigned_num_, assigned_string_, bbdb_, db_path_, extra_, hash_, hash_sizes_, loopdb_range_, num_partitions_, protocols::loophash::BackboneDB::read_db(), core::id::to_string(), and protocols::loophash::TR().

std::pair< core::Size, core::Size > protocols::loophash::LoopHashLibrary::loopdb_range ( ) const
inline

References loopdb_range_.

void protocols::loophash::LoopHashLibrary::mem_foot_print ( ) const
void protocols::loophash::LoopHashLibrary::merge ( LoopHashLibraryOP  second_lib,
utility::vector1< core::Real rms_cutoffs 
)

Take two LoopHash libraries and merge them.

Throws out non-unique fragments defined as follows: if a new fragment is in a bucket with a key also in the master library, and if the RMS between the new fragment and the members of the master bucket is lower than the rms_cutoff, it is non-unique. Thus, an rms_cutoff of zero will not throw away any fragments.

References protocols::loophash::LoopHashMap::add_leap(), bbdb_, protocols::loophash::LoopHashMap::bbdb_range(), extra_, protocols::loophash::BackboneDB::get_backbone_segment(), protocols::loophash::LoopHashMap::get_peptide(), protocols::loophash::get_rmsd(), gethash(), hash_sizes_, protocols::loophash::LeapIndex::index, protocols::loophash::LeapIndex::key, merge_bbdb(), protocols::loophash::LeapIndex::offset, protocols::loophash::LoopHashMap::radial_lookup_withkey(), protocols::sic_dock::range(), and protocols::loophash::TR().

bool protocols::loophash::LoopHashLibrary::merge_bbdb ( const BackboneDB second_bbdb,
core::Size index_offset 
)
void protocols::loophash::LoopHashLibrary::save_db ( ) const
void protocols::loophash::LoopHashLibrary::set_create_db ( bool  setting = true)
inline

References create_db_.

void protocols::loophash::LoopHashLibrary::set_db_path ( std::string  setting)
inline

References db_path_.

void protocols::loophash::LoopHashLibrary::set_default_score_functions ( )
void protocols::loophash::LoopHashLibrary::setup_hash_maps ( )
void protocols::loophash::LoopHashLibrary::sort ( )

This function destroys the backbone_index_map reference, so sorting is only done when the hash will not longer be used. Required after merging, before saving so that merged db can be loaded as slices.

References hash_, and hash_sizes_.

void protocols::loophash::LoopHashLibrary::test_loop_sample ( core::pose::Pose pose,
core::Size  nres 
)
bool protocols::loophash::LoopHashLibrary::test_saving_library ( core::pose::Pose  pose,
core::Size  ir,
bool  deposit 
)

Member Data Documentation

core::Size protocols::loophash::LoopHashLibrary::assigned_num_
private

Which partition slice is assigned to this library.

Referenced by create_db(), load_mergeddb(), and LoopHashLibrary().

std::string protocols::loophash::LoopHashLibrary::assigned_string_
private

Need so we can set the database string once.

Referenced by create_db(), delete_db(), load_db(), load_mergeddb(), LoopHashLibrary(), and save_db().

BackboneDB protocols::loophash::LoopHashLibrary::bbdb_
private
bool protocols::loophash::LoopHashLibrary::create_db_
private

Referenced by set_create_db().

std::string protocols::loophash::LoopHashLibrary::db_path_
private
bool protocols::loophash::LoopHashLibrary::do_sanity_check_
private
bool protocols::loophash::LoopHashLibrary::extra_
private

Whether this database holds extra data in the backbone database or not.

Referenced by create_db(), get_extra(), load_db(), load_mergeddb(), LoopHashLibrary(), merge(), and merge_bbdb().

std::map< core::Size, LoopHashMap > protocols::loophash::LoopHashLibrary::hash_
private

A map of Hashmaps, each for a different loop size.

Referenced by gethash(), load_db(), load_mergeddb(), mem_foot_print(), save_db(), setup_hash_maps(), and sort().

std::vector< core::Size > protocols::loophash::LoopHashLibrary::hash_sizes_
private
std::pair< core::Size, core::Size > protocols::loophash::LoopHashLibrary::loopdb_range_
private

The proteins of the backbone database that are loaded (when loading a merged database, otherwise (0,0))

Referenced by load_mergeddb(), loopdb_range(), and LoopHashLibrary().

core::Size protocols::loophash::LoopHashLibrary::num_partitions_
private

The number of partitions the database is split into.

Referenced by create_db(), load_mergeddb(), and LoopHashLibrary().

core::optimization::MinimizerOptions protocols::loophash::LoopHashLibrary::options2_
private

Referenced by get_all().

core::optimization::MinimizerOptions protocols::loophash::LoopHashLibrary::options_
private

Referenced by get_all().

core::scoring::ScoreFunctionOP protocols::loophash::LoopHashLibrary::scorefxn_cen_cst_
private
core::scoring::ScoreFunctionOP protocols::loophash::LoopHashLibrary::scorefxn_rama_cst_
private

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