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

A class for an algorithm. Given a conformation of the upstream partner, the algorithm is responsible for producing a set of hits. More...

#include <DownstreamAlgorithm.hh>

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

Public Types

typedef core::Size Size
 
typedef core::Vector Vector
 

Public Member Functions

 DownstreamAlgorithm (core::Size geom_cst_id)
 
 DownstreamAlgorithm (DownstreamAlgorithm const &)
 
DownstreamAlgorithm const & operator= (DownstreamAlgorithm const &)
 
 ~DownstreamAlgorithm () override
 
virtual DownstreamAlgorithmOP clone () const =0
 
virtual std::list< Hitbuild_hits_at_all_positions (Matcher &matcher)
 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...
 
virtual void respond_to_primary_hitlist_change (Matcher &matcher, core::Size round_just_completed)
 Reset appropriate Matcher data to spawn the deletion of hits from other rounds following either hit generation by this geometric constraint, or following hit generation by another geometric constraint which caused the deletion of hits from this geometric constraint. The classic match algorithm, for example, resets the occupied-space hash so that other classic-match algorithms can delete their non-viable hits in subsequent calls to respond_to_peripheral_hitlist_change. More...
 
virtual void respond_to_peripheral_hitlist_change (Matcher &matcher)
 Following the change in the number of hits of some other round – either from the conclusion of that round in which a new set of hits has been generated, or from the cascading change to the hits from round A which were deleted after the conclusion of round B. More...
 
virtual std::list< Hitbuild (core::Size const scaffold_build_point_id, core::Size const upstream_conf_id, core::conformation::Residue const &upstream_residue) const =0
 Return a set of hits given a conformation of an upstream residue. This method must be bit-wise constant and parallelizable in derived classes. More...
 
virtual bool upstream_only () const =0
 This method returns 'false' if the hits generated by this DownstreamAlgorithm store the 6-dimensional coordinate of the downstream partner in hit.second(), and therefore intend for the Matcher to find matches for this algorithm's hits by hashing the 6-dimensional coordinate. This method returns 'true' if the DownstreamAlgorithm does not use hit.second to store a point in 6D and instead intends the Matcher to find matches by querying this DownstreamAlgorithm's hits_to_include_with_partial_match method. More...
 
virtual bool generates_primary_hits () const =0
 This method returns 'true' if the Real6 portion of the returned hits are "original" descriptions of the downstream coordinates, and not merely duplicates of the downstream coordinates from previous rounds. This method returns 'false' if the downstream portion of the returned hits are duplications of previous-round geometries or if the hits returned by this class do not describe the geometry of the downstream coordinates. More...
 
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...
 
virtual HitPtrListCOP hits_to_include_with_partial_match (match_dspos1 const &m) const =0
 This method is invoked by the Matcher as it enumerates matches should this class return "true" in it's upstream_only. method. The Matcher will enumerate matches placing hits into the match for all of the geometric-constraints which describe the downstream partner's 6D coordinates in their hits, and then for all other geometric constraints in ascending order. The hits for upstream residues 1 to geom_cst_id() - 1 are all valid; the hit for geom-cst i, given that i > geom_cst_id() - 1 is valid if and only if the downstream algorithm for geom-cst i returns true in it's upstream_only(). The Hit const * list should point at the Matcher's hits. Between prepare-for-match enumeration and note_match_enumeration_completed, the Matcher provides a guarantee to the downstream algorithm that it's hit lists have not changed, and therefore all Hit *'s remain valid. The Matcher is providing a "match_dspos1 const &" instead of a "match const &" because this DownstreamAlgorithm should not be examining the 6D coordinates of the downstream partner according to other geometric constraints, and because the Matcher's match_dspos1-enumeration technique could not readily construct a match, the Matcher's match-enumeration technique can readily construct a match_dspos1. Data in the input match_dspos1 relating to the downstream partner is undefined. More...
 
void set_bb_grid (BumpGridCOP bbgrid)
 
void set_active_site_grid (ActiveSiteGridCOP active_site_grid)
 
virtual core::Size n_possible_hits_per_upstream_conformation () const =0
 
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
 

Protected Member Functions

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...
 

Private Attributes

core::Size geom_cst_id_
 
BumpGridCOP bbgrid_
 
ActiveSiteGridCOP active_site_grid_
 
DownstreamBuilderOP dsbuilder_
 

Detailed Description

A class for an algorithm. Given a conformation of the upstream partner, the algorithm is responsible for producing a set of hits.

Member Typedef Documentation

Constructor & Destructor Documentation

protocols::match::downstream::DownstreamAlgorithm::DownstreamAlgorithm ( core::Size  geom_cst_id)
protocols::match::downstream::DownstreamAlgorithm::DownstreamAlgorithm ( DownstreamAlgorithm const &  other)
protocols::match::downstream::DownstreamAlgorithm::~DownstreamAlgorithm ( )
overridedefault

Member Function Documentation

ActiveSiteGrid const& protocols::match::downstream::DownstreamAlgorithm::active_site_grid ( ) const
inlineprotected
bool protocols::match::downstream::DownstreamAlgorithm::active_site_grid_set ( ) const
inlineprotected
bool protocols::match::downstream::DownstreamAlgorithm::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
BumpGrid const& protocols::match::downstream::DownstreamAlgorithm::bbgrid ( ) const
inlineprotected
virtual std::list< Hit > protocols::match::downstream::DownstreamAlgorithm::build ( core::Size const  scaffold_build_point_id,
core::Size const  upstream_conf_id,
core::conformation::Residue const &  upstream_residue 
) const
pure virtual

Return a set of hits given a conformation of an upstream residue. This method must be bit-wise constant and parallelizable in derived classes.

Implemented in protocols::match::downstream::SecondaryMatcherToUpstreamResidue, protocols::match::downstream::SecondaryMatcherToDownstreamResidue, protocols::match::downstream::ClassicMatchAlgorithm, and protocols::match::output::WriteUpstreamCoordinateKinemage.

std::list< Hit > protocols::match::downstream::DownstreamAlgorithm::build_hits_at_all_positions ( Matcher matcher)
virtual

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 in protocols::match::downstream::SecondaryMatcherToUpstreamResidue, protocols::match::downstream::SecondaryMatcherToDownstreamResidue, and protocols::match::downstream::ClassicMatchAlgorithm.

References default_build_hits_at_all_positions().

virtual DownstreamAlgorithmOP protocols::match::downstream::DownstreamAlgorithm::clone ( ) const
pure virtual
std::list< Hit > protocols::match::downstream::DownstreamAlgorithm::default_build_hits_at_all_positions ( Matcher const &  matcher) const
protected

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.

References core::sequence::end, geom_cst_id_, protocols::match::Matcher::per_constraint_build_points(), and protocols::match::Matcher::upstream_builder().

Referenced by build_hits_at_all_positions(), and protocols::match::downstream::ClassicMatchAlgorithm::build_hits_at_all_positions().

virtual bool protocols::match::downstream::DownstreamAlgorithm::generates_primary_hits ( ) const
pure virtual

This method returns 'true' if the Real6 portion of the returned hits are "original" descriptions of the downstream coordinates, and not merely duplicates of the downstream coordinates from previous rounds. This method returns 'false' if the downstream portion of the returned hits are duplications of previous-round geometries or if the hits returned by this class do not describe the geometry of the downstream coordinates.

Implemented in protocols::match::downstream::SecondaryMatcherToUpstreamResidue, protocols::match::downstream::SecondaryMatcherToDownstreamResidue, protocols::match::downstream::ClassicMatchAlgorithm, and protocols::match::output::WriteUpstreamCoordinateKinemage.

DownstreamAlgorithm::Size protocols::match::downstream::DownstreamAlgorithm::geom_cst_id ( ) const

References geom_cst_id_.

Referenced by protocols::match::downstream::ClassicMatchAlgorithm::build_and_discard_first_round_hits_at_all_positions(), protocols::match::downstream::ClassicMatchAlgorithm::build_hits_at_all_positions(), protocols::match::downstream::SecondaryMatcherToDownstreamResidue::build_hits_at_all_positions(), protocols::match::downstream::SecondaryMatcherToUpstreamResidue::build_hits_at_all_positions(), protocols::match::Matcher::erase_hit(), protocols::match::downstream::SecondaryMatcherToDownstreamResidue::prepare_for_hit_generation(), protocols::match::downstream::SecondaryMatcherToUpstreamResidue::prepare_for_hit_generation(), protocols::match::downstream::SecondaryMatcherToUpstreamResidue::prepare_for_hit_generation_at_target_build_point(), protocols::match::downstream::SecondaryMatcherToDownstreamResidue::prepare_for_hit_generation_for_geomcst(), protocols::match::downstream::SecondaryMatcherToUpstreamResidue::prepare_for_match_enumeration(), protocols::match::downstream::ClassicMatchAlgorithm::respond_to_peripheral_hitlist_change(), protocols::match::downstream::SecondaryMatcherToDownstreamResidue::respond_to_peripheral_hitlist_change(), protocols::match::downstream::SecondaryMatcherToUpstreamResidue::respond_to_peripheral_hitlist_change(), protocols::match::downstream::ClassicMatchAlgorithm::respond_to_primary_hitlist_change(), protocols::match::downstream::SecondaryMatcherToDownstreamResidue::respond_to_primary_hitlist_change(), protocols::match::downstream::SecondaryMatcherToUpstreamResidue::respond_to_primary_hitlist_change(), and protocols::match::downstream::ClassicMatchAlgorithm::set_build_round1_hits_twice().

DownstreamBuilderOP protocols::match::downstream::DownstreamAlgorithm::get_dsbuilder ( ) const
virtual HitPtrListCOP protocols::match::downstream::DownstreamAlgorithm::hits_to_include_with_partial_match ( match_dspos1 const &  m) const
pure virtual

This method is invoked by the Matcher as it enumerates matches should this class return "true" in it's upstream_only. method. The Matcher will enumerate matches placing hits into the match for all of the geometric-constraints which describe the downstream partner's 6D coordinates in their hits, and then for all other geometric constraints in ascending order. The hits for upstream residues 1 to geom_cst_id() - 1 are all valid; the hit for geom-cst i, given that i > geom_cst_id() - 1 is valid if and only if the downstream algorithm for geom-cst i returns true in it's upstream_only(). The Hit const * list should point at the Matcher's hits. Between prepare-for-match enumeration and note_match_enumeration_completed, the Matcher provides a guarantee to the downstream algorithm that it's hit lists have not changed, and therefore all Hit *'s remain valid. The Matcher is providing a "match_dspos1 const &" instead of a "match const &" because this DownstreamAlgorithm should not be examining the 6D coordinates of the downstream partner according to other geometric constraints, and because the Matcher's match_dspos1-enumeration technique could not readily construct a match, the Matcher's match-enumeration technique can readily construct a match_dspos1. Data in the input match_dspos1 relating to the downstream partner is undefined.

Implemented in protocols::match::downstream::SecondaryMatcherToUpstreamResidue, protocols::match::downstream::SecondaryMatcherToDownstreamResidue, protocols::match::downstream::ClassicMatchAlgorithm, and protocols::match::output::WriteUpstreamCoordinateKinemage.

virtual core::Size protocols::match::downstream::DownstreamAlgorithm::n_possible_hits_per_upstream_conformation ( ) const
pure virtual
DownstreamAlgorithm const & protocols::match::downstream::DownstreamAlgorithm::operator= ( DownstreamAlgorithm const &  rhs)
void protocols::match::downstream::DownstreamAlgorithm::prepare_for_match_enumeration ( Matcher const &  )
virtual

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.

no-op

Reimplemented in protocols::match::downstream::SecondaryMatcherToUpstreamResidue.

void protocols::match::downstream::DownstreamAlgorithm::respond_to_peripheral_hitlist_change ( Matcher matcher)
virtual

Following the change in the number of hits of some other round – either from the conclusion of that round in which a new set of hits has been generated, or from the cascading change to the hits from round A which were deleted after the conclusion of round B.

Noop in base class.

Reimplemented in protocols::match::downstream::SecondaryMatcherToUpstreamResidue, protocols::match::downstream::SecondaryMatcherToDownstreamResidue, and protocols::match::downstream::ClassicMatchAlgorithm.

void protocols::match::downstream::DownstreamAlgorithm::respond_to_primary_hitlist_change ( Matcher matcher,
core::Size  round_just_completed 
)
virtual

Reset appropriate Matcher data to spawn the deletion of hits from other rounds following either hit generation by this geometric constraint, or following hit generation by another geometric constraint which caused the deletion of hits from this geometric constraint. The classic match algorithm, for example, resets the occupied-space hash so that other classic-match algorithms can delete their non-viable hits in subsequent calls to respond_to_peripheral_hitlist_change.

Noop in base class.

Reimplemented in protocols::match::downstream::SecondaryMatcherToUpstreamResidue, protocols::match::downstream::SecondaryMatcherToDownstreamResidue, and protocols::match::downstream::ClassicMatchAlgorithm.

void protocols::match::downstream::DownstreamAlgorithm::set_active_site_grid ( ActiveSiteGridCOP  active_site_grid)
void protocols::match::downstream::DownstreamAlgorithm::set_bb_grid ( BumpGridCOP  bbgrid)

References bbgrid(), and bbgrid_.

void protocols::match::downstream::DownstreamAlgorithm::set_dsbuilder ( DownstreamBuilderOP  dsbuilder)
virtual bool protocols::match::downstream::DownstreamAlgorithm::upstream_only ( ) const
pure virtual

This method returns 'false' if the hits generated by this DownstreamAlgorithm store the 6-dimensional coordinate of the downstream partner in hit.second(), and therefore intend for the Matcher to find matches for this algorithm's hits by hashing the 6-dimensional coordinate. This method returns 'true' if the DownstreamAlgorithm does not use hit.second to store a point in 6D and instead intends the Matcher to find matches by querying this DownstreamAlgorithm's hits_to_include_with_partial_match method.

Implemented in protocols::match::downstream::SecondaryMatcherToUpstreamResidue, protocols::match::downstream::SecondaryMatcherToDownstreamResidue, protocols::match::downstream::ClassicMatchAlgorithm, and protocols::match::output::WriteUpstreamCoordinateKinemage.

Member Data Documentation

ActiveSiteGridCOP protocols::match::downstream::DownstreamAlgorithm::active_site_grid_
private
BumpGridCOP protocols::match::downstream::DownstreamAlgorithm::bbgrid_
private

Referenced by bbgrid(), operator=(), and set_bb_grid().

DownstreamBuilderOP protocols::match::downstream::DownstreamAlgorithm::dsbuilder_
private

Referenced by get_dsbuilder(), and set_dsbuilder().

core::Size protocols::match::downstream::DownstreamAlgorithm::geom_cst_id_
private

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