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

Produce hits by hashing building the coordinates of the downstream partner The downstream partner is responsible for building itself from the coordinate frame of three of its atoms. The ExternalGeomSampler describes the ways to orient the downstream partner given the coordinates of the upstream partner. More...

#include <ClassicMatchAlgorithm.hh>

Inheritance diagram for protocols::match::downstream::ClassicMatchAlgorithm:
Inheritance graph
[legend]

Public Types

typedef DownstreamAlgorithm parent
 
typedef core::Size Size
 
typedef core::Real Real
 
typedef
numeric::HomogeneousTransform
< Real
HTReal
 
- Public Types inherited from protocols::match::downstream::DownstreamAlgorithm
typedef core::Size Size
 
typedef core::Vector Vector
 

Public Member Functions

 ClassicMatchAlgorithm (core::Size geom_cst_id)
 
 ~ClassicMatchAlgorithm () override
 
DownstreamAlgorithmOP clone () const override
 
void set_build_round1_hits_twice ()
 Enable a strategy where the first round hits are discarded after they are generated and then, after the second round completes, they are regenerated but respecting the occ-space hash, thereby decreasing the memory use dramatically. That is, the hits for the first geometric constraint (round 1 hits) are discarded, but their presence in the occupied space hash is recorded. Then the hits for the second round are collected, but only the ones that fall into the regions of 6D where the hits from the first round fell. At the end of round 2, the occ-space hash is updated to reflect the regions of 6D where both rounds produced hits. Then the round 1 hits are generated a second time, and this time saved. More...
 
std::list< Hitbuild_hits_at_all_positions (Matcher &matcher) override
 Main driver function for hit generation. The algorithm is responsible for generating hits at all scaffold build points that are valid for this geometric constraint. The base class provides an iterate-across-all-positions-and-splice-together-hit-lists implementation, however, derived classes may overload this function. The base class function is parallelizable with OpenMP. The returned hit list must be in sorted order by 1) hit.scaffold_build_id() and then by 2) hit.upstream_conf_id(). More...
 
std::list< Hitbuild_and_discard_first_round_hits_at_all_positions (Matcher &matcher)
 
void respond_to_primary_hitlist_change (Matcher &matcher, core::Size round_just_completed) override
 Reset the occupied space grid for the matcher so that only those regions which contain hits from this geometric constraint are marked as occupied. More...
 
void respond_to_peripheral_hitlist_change (Matcher &matcher) override
 Delete hits for this geometric constraint if they fall into now-empty regions of 6D. This step can be avoided if the occupied-space-grid's revision ID has not changed since the last time this function was invoked. More...
 
std::list< Hitbuild (core::Size const scaffold_build_point_id, core::Size const upstream_conf_id, core::conformation::Residue const &upstream_residue) const override
 Iterate across the external geom samplers that describe the rigid body orientations of the downstream partner from the coordinates of the upstream partner. More...
 
bool upstream_only () const override
 This method returns 'false' since the classic match algorithm builds coordinates of the downstream partner and its hits should be hashed in 6D to generate matches. More...
 
bool generates_primary_hits () const override
 This method returns 'true' since the classic matcher builds the downstream coordinates from scratch. More...
 
HitPtrListCOP hits_to_include_with_partial_match (match_dspos1 const &m) const override
 This method should not be invoked on the ClassicMatchAlgorithm, since it returns "false" in its upstream_only method. More...
 
core::Size n_possible_hits_per_upstream_conformation () const override
 
std::list< Hitbuild_from_three_coords (core::Size const which_external_sampler, core::Size const scaffold_build_point_id, core::Size const upstream_conf_id, core::conformation::Residue const &upstream_residue) const
 This function completes the building of the downstream conformation once the coordinates of the upstream conformation are known (and deemed non-colliding or, generally, pass any filter the upstream builder would use). More...
 
void set_residue_type (core::chemical::ResidueTypeCOP restype)
 
void add_external_geom_sampler (utility::vector1< toolbox::match_enzdes_util::ExternalGeomSampler > const &sampler, core::Size const exgeom_id, std::string const &atom1, std::string const &atom2, std::string const &atom3, DownstreamBuilderCOP downstream_builder)
 
void clear_external_geom_samplers ()
 
core::chemical::ResidueType const & restype () const
 Accessors. More...
 
utility::vector1
< toolbox::match_enzdes_util::ExternalGeomSampler >
const & 
external_sampler (core::Size external_geom_id) const
 
core::Size launch_atom (core::Size external_geom_id, core::Size which_point) const
 
core::Size n_external_samplers () const
 
- Public Member Functions inherited from protocols::match::downstream::DownstreamAlgorithm
 DownstreamAlgorithm (core::Size geom_cst_id)
 
 DownstreamAlgorithm (DownstreamAlgorithm const &)
 
DownstreamAlgorithm const & operator= (DownstreamAlgorithm const &)
 
 ~DownstreamAlgorithm () override
 
virtual void prepare_for_match_enumeration (Matcher const &)
 Called at the conclusion of matching, the Matcher signals to the downstream algorithm that it's time to prepare for match generation; if the downstream algorithm needs to enumerate compatible hits in response to the invokation of its hits_to_include_with_partial_match method, then now is the time to prepare for those calls. Base class has a noop implementation. More...
 
void set_bb_grid (BumpGridCOP bbgrid)
 
void set_active_site_grid (ActiveSiteGridCOP active_site_grid)
 
core::Size geom_cst_id () const
 
void set_dsbuilder (DownstreamBuilderOP dsbuilder)
 
DownstreamBuilderOP get_dsbuilder () const
 
bool are_colliding (core::conformation::Residue const &us_res, core::conformation::Residue const &ds_res, utility::vector1< core::id::AtomID > const &ds_atoms, utility::vector1< core::Size > const &catalytic_atoms) const
 

Private Attributes

core::chemical::ResidueTypeCOP restype_
 
utility::vector1
< utility::vector1
< toolbox::match_enzdes_util::ExternalGeomSampler > > 
external_samplers_
 
utility::vector1
< utility::fixedsizearray1
< core::Size, 3 > > 
launch_points_
 
utility::vector1
< DownstreamBuilderCOP
dsbuilders_
 
utility::vector1< core::Sizeexgeom_ids_
 
core::Size occspace_rev_id_at_last_update_
 
bool build_round1_hits_twice_
 control whether this algorithm expects to rebuild round 1 hits after round 2 completes. Only used if the geom_cst_id() for this instance is 1. More...
 
bool completed_first_round1_hit_building_
 

Additional Inherited Members

- Protected Member Functions inherited from protocols::match::downstream::DownstreamAlgorithm
BumpGrid const & bbgrid () const
 
bool active_site_grid_set () const
 
ActiveSiteGrid const & active_site_grid () const
 
std::list< Hitdefault_build_hits_at_all_positions (Matcher const &matcher) const
 Non-virtual, const method for generating hits by first iterating across all build points and then invoking upstream_builder->build( build_point_i ) and splicing together the results. This method is invoked by default if the derived class does not override build_hits_at_all_positions. More...
 

Detailed Description

Produce hits by hashing building the coordinates of the downstream partner The downstream partner is responsible for building itself from the coordinate frame of three of its atoms. The ExternalGeomSampler describes the ways to orient the downstream partner given the coordinates of the upstream partner.

Member Typedef Documentation

typedef numeric::HomogeneousTransform< Real > protocols::match::downstream::ClassicMatchAlgorithm::HTReal

Constructor & Destructor Documentation

protocols::match::downstream::ClassicMatchAlgorithm::ClassicMatchAlgorithm ( core::Size  geom_cst_id)
protocols::match::downstream::ClassicMatchAlgorithm::~ClassicMatchAlgorithm ( )
overridedefault

Member Function Documentation

void protocols::match::downstream::ClassicMatchAlgorithm::add_external_geom_sampler ( utility::vector1< toolbox::match_enzdes_util::ExternalGeomSampler > const &  sampler,
core::Size const  exgeom_id,
std::string const &  atom1,
std::string const &  atom2,
std::string const &  atom3,
DownstreamBuilderCOP  dsbuilder 
)

Precompute transforms for the external geom sampler as it is added so that the transforms are ready when build() is called.

References dsbuilders_, exgeom_ids_, external_samplers_, core::chemical::has(), launch_points_, and restype().

std::list< Hit > protocols::match::downstream::ClassicMatchAlgorithm::build ( core::Size const  scaffold_build_point_id,
core::Size const  upstream_conf_id,
core::conformation::Residue const &  upstream_residue 
) const
overridevirtual

Iterate across the external geom samplers that describe the rigid body orientations of the downstream partner from the coordinates of the upstream partner.

Implements protocols::match::downstream::DownstreamAlgorithm.

References build_from_three_coords(), external_samplers_, n_external_samplers(), core::conformation::Residue::name(), restype_, and core::conformation::Residue::type().

std::list< Hit > protocols::match::downstream::ClassicMatchAlgorithm::build_and_discard_first_round_hits_at_all_positions ( Matcher matcher)
std::list< Hit > protocols::match::downstream::ClassicMatchAlgorithm::build_from_three_coords ( core::Size const  which_external_sampler,
core::Size const  scaffold_build_point_id,
core::Size const  upstream_conf_id,
core::conformation::Residue const &  upstream_residue 
) const
std::list< Hit > protocols::match::downstream::ClassicMatchAlgorithm::build_hits_at_all_positions ( Matcher matcher)
overridevirtual

Main driver function for hit generation. The algorithm is responsible for generating hits at all scaffold build points that are valid for this geometric constraint. The base class provides an iterate-across-all-positions-and-splice-together-hit-lists implementation, however, derived classes may overload this function. The base class function is parallelizable with OpenMP. The returned hit list must be in sorted order by 1) hit.scaffold_build_id() and then by 2) hit.upstream_conf_id().

By initializing local std::list< Hit > variables inside the loop over all of the build points, and then splicing them into a central vector of hit lists, I can avoid expensive list-copy operations while guaranteeing OpenMP thread saftey.

Reimplemented from protocols::match::downstream::DownstreamAlgorithm.

References build_and_discard_first_round_hits_at_all_positions(), build_round1_hits_twice_, completed_first_round1_hit_building_, protocols::match::downstream::DownstreamAlgorithm::default_build_hits_at_all_positions(), protocols::match::Matcher::downstream_builders(), protocols::match::downstream::DownstreamAlgorithm::geom_cst_id(), and protocols::match::Matcher::occ_space_hash().

void protocols::match::downstream::ClassicMatchAlgorithm::clear_external_geom_samplers ( )
DownstreamAlgorithmOP protocols::match::downstream::ClassicMatchAlgorithm::clone ( ) const
overridevirtual
utility::vector1< toolbox::match_enzdes_util::ExternalGeomSampler > const& protocols::match::downstream::ClassicMatchAlgorithm::external_sampler ( core::Size  external_geom_id) const
inline

References external_samplers_.

bool protocols::match::downstream::ClassicMatchAlgorithm::generates_primary_hits ( ) const
overridevirtual

This method returns 'true' since the classic matcher builds the downstream coordinates from scratch.

Implements protocols::match::downstream::DownstreamAlgorithm.

HitPtrListCOP protocols::match::downstream::ClassicMatchAlgorithm::hits_to_include_with_partial_match ( match_dspos1 const &  m) const
overridevirtual

This method should not be invoked on the ClassicMatchAlgorithm, since it returns "false" in its upstream_only method.

If this function is causing an exit, then there is a bug within the Matcher's match-enumeration logic. There is no meaningful way forward after this function is invoked. It should not be invoked.

Implements protocols::match::downstream::DownstreamAlgorithm.

core::Size protocols::match::downstream::ClassicMatchAlgorithm::launch_atom ( core::Size  external_geom_id,
core::Size  which_point 
) const
inline

References launch_points_.

Referenced by build_from_three_coords().

core::Size protocols::match::downstream::ClassicMatchAlgorithm::n_external_samplers ( ) const
inline
ClassicMatchAlgorithm::Size protocols::match::downstream::ClassicMatchAlgorithm::n_possible_hits_per_upstream_conformation ( ) const
overridevirtual
void protocols::match::downstream::ClassicMatchAlgorithm::respond_to_peripheral_hitlist_change ( Matcher matcher)
overridevirtual

Delete hits for this geometric constraint if they fall into now-empty regions of 6D. This step can be avoided if the occupied-space-grid's revision ID has not changed since the last time this function was invoked.

Drop hits that had previously seemed viable after another round completed; during that round, certain previously occupied regions of 6D were not filled with new hits. Any previously-generated hit that falls into a region of 6D which is no longer occupied should be elminated since it could not ever result in a match; it is inviable.

Reimplemented from protocols::match::downstream::DownstreamAlgorithm.

References protocols::match::Matcher::erase_hit(), protocols::match::downstream::DownstreamAlgorithm::geom_cst_id(), protocols::match::Matcher::hit_list_begin(), protocols::match::Matcher::hit_list_end(), protocols::match::Matcher::hits(), protocols::match::Matcher::occ_space_hash(), occspace_rev_id_at_last_update_, and protocols::match::downstream::TR().

void protocols::match::downstream::ClassicMatchAlgorithm::respond_to_primary_hitlist_change ( Matcher matcher,
core::Size  round_just_completed 
)
overridevirtual

Reset the occupied space grid for the matcher so that only those regions which contain hits from this geometric constraint are marked as occupied.

Reset the occupied space hash that the matcher uses so that it reflects the hits generated this round; this will cause the invalidation of hits generated in previous rounds. These invalidated hits will be deleted in calls to respond_to_peripheral_hitlist_change.

Reimplemented from protocols::match::downstream::DownstreamAlgorithm.

References build_round1_hits_twice_, protocols::match::downstream::DownstreamAlgorithm::geom_cst_id(), protocols::match::Matcher::hits(), protocols::match::Matcher::occ_space_hash(), occspace_rev_id_at_last_update_, and protocols::match::downstream::TR().

core::chemical::ResidueType const& protocols::match::downstream::ClassicMatchAlgorithm::restype ( ) const
inline

Accessors.

References restype_.

Referenced by add_external_geom_sampler(), and set_residue_type().

void protocols::match::downstream::ClassicMatchAlgorithm::set_build_round1_hits_twice ( )

Enable a strategy where the first round hits are discarded after they are generated and then, after the second round completes, they are regenerated but respecting the occ-space hash, thereby decreasing the memory use dramatically. That is, the hits for the first geometric constraint (round 1 hits) are discarded, but their presence in the occupied space hash is recorded. Then the hits for the second round are collected, but only the ones that fall into the regions of 6D where the hits from the first round fell. At the end of round 2, the occ-space hash is updated to reflect the regions of 6D where both rounds produced hits. Then the round 1 hits are generated a second time, and this time saved.

References build_round1_hits_twice_, and protocols::match::downstream::DownstreamAlgorithm::geom_cst_id().

void protocols::match::downstream::ClassicMatchAlgorithm::set_residue_type ( core::chemical::ResidueTypeCOP  restype)
bool protocols::match::downstream::ClassicMatchAlgorithm::upstream_only ( ) const
overridevirtual

This method returns 'false' since the classic match algorithm builds coordinates of the downstream partner and its hits should be hashed in 6D to generate matches.

Implements protocols::match::downstream::DownstreamAlgorithm.

Member Data Documentation

bool protocols::match::downstream::ClassicMatchAlgorithm::build_round1_hits_twice_
private

control whether this algorithm expects to rebuild round 1 hits after round 2 completes. Only used if the geom_cst_id() for this instance is 1.

Referenced by build_hits_at_all_positions(), respond_to_primary_hitlist_change(), and set_build_round1_hits_twice().

bool protocols::match::downstream::ClassicMatchAlgorithm::completed_first_round1_hit_building_
private
utility::vector1< DownstreamBuilderCOP > protocols::match::downstream::ClassicMatchAlgorithm::dsbuilders_
private
utility::vector1< core::Size > protocols::match::downstream::ClassicMatchAlgorithm::exgeom_ids_
private
utility::vector1< utility::vector1< toolbox::match_enzdes_util::ExternalGeomSampler > > protocols::match::downstream::ClassicMatchAlgorithm::external_samplers_
private
utility::vector1< utility::fixedsizearray1< core::Size, 3 > > protocols::match::downstream::ClassicMatchAlgorithm::launch_points_
private
core::Size protocols::match::downstream::ClassicMatchAlgorithm::occspace_rev_id_at_last_update_
private
core::chemical::ResidueTypeCOP protocols::match::downstream::ClassicMatchAlgorithm::restype_
private

Referenced by build(), restype(), and set_residue_type().


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