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

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

#include <SecondaryMatcherToUpstreamResidue.hh>

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

Public Types

typedef DownstreamAlgorithm parent
 
typedef
utility::fixedsizearray1
< core::Size, 2 > 
Size2
 
typedef utility::OrderedTuple
< Size2
Size2Tuple
 
typedef std::pair
< SecMatchResiduePairEvaluatorCOP,
core::Size
Evaluator_MCFI_ID_Pair
 
typedef std::list
< Evaluator_MCFI_ID_Pair
EvaluatorSet
 
- Public Types inherited from protocols::match::downstream::DownstreamAlgorithm
typedef core::Size Size
 
typedef core::Vector Vector
 

Public Member Functions

 SecondaryMatcherToUpstreamResidue (core::Size geom_cst_id)
 
 ~SecondaryMatcherToUpstreamResidue () override
 
DownstreamAlgorithmOP clone () const override
 
std::list< Hitbuild_hits_at_all_positions (Matcher &matcher) override
 Main driver function for hit generation. This DownstreamAlgorithm structures it's iteration over the hits from previous rounds as follows: for i = 1:n_build_positions recover_rotamer_coordinates_from_previous_round( hits_for_build_point_i ); initialize rotcoord data for all downstream algorithms with the same geom_cst_id #omp parallel for /// All class access below this point is const and parallelizable for j = 1:n_build_positions /// call this function to start k loop: matcher.upstream_builder[ geom_cst_id() ]->build( j ) for k = 1:n_rotamers_j /// call to start l loop: downstream_algorithm->build( j, k, rotamer_k ) ) for l = 1:n_rotamers_from_build_point_i if ( respair_evaluator_->evaluate_residues( rotamer_k, rotamer_l ) hit_list.append( Hit( j, k, ... )); return hit_list There are two important consequences to this hit-generation layout. More...
 
void respond_to_primary_hitlist_change (Matcher &matcher, core::Size round_just_completed) override
 Prune hits away from the target_geomcst's hit list following a change to the hits for my geom_cst_id(). Pruning hits from the target_geomcst's hit list will trigger a round of peripheral-hitlist-change responses. More...
 
void respond_to_peripheral_hitlist_change (Matcher &matcher) override
 Remove my hits if my target_geomcst's hit list has been shortened. This will not trigger a round of peripheral-hitlist-change responses. 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 hits from a particular upstream build point i that were generated in a previous round, and see if the geometry of the input upstream_residue has "satisfactory interactions" with the hits from upstream-build-point i; if so, it appends a Hit to the hitlist returned at the end of the method. (Also, see comments for the build_at_all_positions method.) More...
 
bool upstream_only () const override
 returns true; this secondary matcher does not describe the location of the downstream partner More...
 
bool generates_primary_hits () const override
 This method returns 'false' since this matcher does not describe the coordinates of the downstream partner at all. More...
 
void prepare_for_match_enumeration (Matcher const &matcher) override
 Prepare a map between upstream hits of the target-geomcst and a list of Hit const *'s of this geom_cst_id(). This map will be used in the function hits_to_include_with_partial_match. More...
 
HitPtrListCOP hits_to_include_with_partial_match (match_dspos1 const &m) const override
 Return the set of hits to be iterated across. More...
 
core::Size n_possible_hits_per_upstream_conformation () const override
 
void set_target_geomcst_id (core::Size target_geomcst_id)
 
void add_target_restype (core::chemical::ResidueTypeCOP target_restype)
 
void add_evaluator_for_target_restype (core::chemical::ResidueTypeCOP target_restype, SecMatchResiduePairEvaluatorCOP evaluator, core::Size mcfi_id_for_evaluator)
 
void process_hit (Hit const &hit, core::conformation::Residue const &upstream_conformation)
 Invoked by SecondaryMatchUpstreamResProcessor; avoids multiple inherritance, while letting the SecondaryMatcherToUpstreamResidue. More...
 
- 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
 
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 Member Functions

void prepare_for_hit_generation (Matcher &matcher)
 
bool prepare_for_hit_generation_at_target_build_point (Matcher &matcher, upstream::ScaffoldBuildPoint const &target_build_point)
 
void set_target_rotamer_coords (TargetRotamerCoordsOP target_geomcst_coords)
 Allow another SecondaryMatcherToUpstreamResidue to set my TargetRotamerCoords object so that we can share this data. More...
 
void count_rotamer (core::conformation::Residue const &upstream_conformation)
 
void store_rotamer_coords (Hit const &hit, core::conformation::Residue const &upstream_conformation)
 
void reorder_restypes (upstream::UpstreamBuilder const &builder)
 

Private Attributes

utility::vector1< core::SizesmUR_pose_build_resids_
 
core::Size target_geomcst_id_
 
std::map
< core::chemical::ResidueTypeCOP,
core::Size
target_restype_index_map_
 
utility::vector1
< core::chemical::ResidueTypeCOP
target_restypes_
 
utility::vector1< EvaluatorSetrespair_evaluators_
 
bool count_rotamers_per_target_restype_
 
core::chemical::ResidueTypeCOP last_seen_restype_
 
core::Size last_seen_restype_index_
 
core::Size count_rotamer_for_lastseen_restype_
 
Matcher::HitListConstIterator target_hits_for_focused_build_point_begin_
 
Matcher::HitListConstIterator target_hits_for_focused_build_point_end_
 
Matcher::HitListConstIterator target_hits_end_
 
utility::vector1< core::Sizen_rotamers_per_target_restype_
 
TargetRotamerCoordsOP target_geomcst_coords_
 
std::map< Size2Tuple,
HitPtrListOP
my_hits_for_target_hit_map_
 
core::Size n_viable_target_hits_since_last_pruning_
 

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

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::SecondaryMatcherToUpstreamResidue::SecondaryMatcherToUpstreamResidue ( core::Size  geom_cst_id)
protocols::match::downstream::SecondaryMatcherToUpstreamResidue::~SecondaryMatcherToUpstreamResidue ( )
overridedefault

Member Function Documentation

void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::add_evaluator_for_target_restype ( core::chemical::ResidueTypeCOP  target_restype,
SecMatchResiduePairEvaluatorCOP  evaluator,
core::Size  mcfi_id_for_evaluator 
)
void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::add_target_restype ( core::chemical::ResidueTypeCOP  target_restype)
std::list< Hit > protocols::match::downstream::SecondaryMatcherToUpstreamResidue::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 hits from a particular upstream build point i that were generated in a previous round, and see if the geometry of the input upstream_residue has "satisfactory interactions" with the hits from upstream-build-point i; if so, it appends a Hit to the hitlist returned at the end of the method. (Also, see comments for the build_at_all_positions method.)

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

References protocols::match::Hit::first(), respair_evaluators_, protocols::match::Hit::second(), smUR_pose_build_resids_, target_geomcst_coords_, and core::conformation::Residue::type_ptr().

std::list< Hit > protocols::match::downstream::SecondaryMatcherToUpstreamResidue::build_hits_at_all_positions ( Matcher matcher)
overridevirtual

Main driver function for hit generation. This DownstreamAlgorithm structures it's iteration over the hits from previous rounds as follows: for i = 1:n_build_positions recover_rotamer_coordinates_from_previous_round( hits_for_build_point_i ); initialize rotcoord data for all downstream algorithms with the same geom_cst_id #omp parallel for /// All class access below this point is const and parallelizable for j = 1:n_build_positions /// call this function to start k loop: matcher.upstream_builder[ geom_cst_id() ]->build( j ) for k = 1:n_rotamers_j /// call to start l loop: downstream_algorithm->build( j, k, rotamer_k ) ) for l = 1:n_rotamers_from_build_point_i if ( respair_evaluator_->evaluate_residues( rotamer_k, rotamer_l ) hit_list.append( Hit( j, k, ... )); return hit_list There are two important consequences to this hit-generation layout.

  1. The coordinates for rotamer_k are computed n_build_position times.
  2. Only a single build-position i has it's hit coordinates in memory at any point in time. This is a clear trade-off between performance and memory with a few caveats: A. It is very easy to bound the volume of space where build-point i's rotamers lie, so it should be easy to prune rotamer building, so rotamer k will be build many fewer than n_build_position times. B. By not trying to store all rotamers in memory at once, we do not impose any undue restrictions on the number of rotamers that can be enumerated. This is especially important if we're using backbone flexibility to search a wider region of conformation space.

This DownstreamAlgorithm structures it's iteration over the target hits from previous rounds as follows: for i = 1:n_build_positions recover_rotamer_coordinates_from_previous_round( hits_for_build_point_i ); initialize rotcoord data for all downstream algorithms with the same geom_cst_id #omp parallel for /// All class access below this point is const and parallelizable for j = 1:n_build_positions /// call this function to start k loop: matcher.upstream_builder[ geom_cst_id() ]->build( j ) for k = 1:n_rotamers_j /// call to start l loop: downstream_algorithm->build( j, k, rotamer_k ) ) for l = 1:n_rotamers_from_build_point_i if ( respair_evaluator_->evaluate_residues( rotamer_k, rotamer_l ) hit_list.append( Hit( j, k, ... )); return hit_list There are two important consequences to this hit-generation layout.

  1. The coordinates for rotamer_k are computed n_build_position times.
  2. Only a single build-position i has it's hit coordinates in memory at any point in time. This is a clear trade-off between performance and memory with a few caveats: A. It is very easy to bound the volume of space where build-point i's rotamers lie, so it should be easy to prune rotamer building, so rotamer k will be build many fewer than n_build_position times. B. By not trying to store all rotamers in memory at once, we do not impose any undue restrictions on the number of rotamers that can be enumerated. This is especially important if we're using backbone flexibility to search a wider region of conformation space.

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

References protocols::fldsgn::topology::compare(), core::sequence::end, protocols::match::downstream::DownstreamAlgorithm::geom_cst_id(), protocols::match::Matcher::per_constraint_build_points(), prepare_for_hit_generation(), prepare_for_hit_generation_at_target_build_point(), target_geomcst_id_, protocols::match::downstream::TR(), and protocols::match::Matcher::upstream_builder().

DownstreamAlgorithmOP protocols::match::downstream::SecondaryMatcherToUpstreamResidue::clone ( ) const
overridevirtual
void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::count_rotamer ( core::conformation::Residue const &  upstream_conformation)
private
bool protocols::match::downstream::SecondaryMatcherToUpstreamResidue::generates_primary_hits ( ) const
overridevirtual

This method returns 'false' since this matcher does not describe the coordinates of the downstream partner at all.

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

HitPtrListCOP protocols::match::downstream::SecondaryMatcherToUpstreamResidue::hits_to_include_with_partial_match ( match_dspos1 const &  m) const
overridevirtual
SecondaryMatcherToUpstreamResidue::Size protocols::match::downstream::SecondaryMatcherToUpstreamResidue::n_possible_hits_per_upstream_conformation ( ) const
overridevirtual
void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::prepare_for_hit_generation ( Matcher matcher)
private
bool protocols::match::downstream::SecondaryMatcherToUpstreamResidue::prepare_for_hit_generation_at_target_build_point ( Matcher matcher,
upstream::ScaffoldBuildPoint const &  target_build_point 
)
private
void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::prepare_for_match_enumeration ( Matcher const &  matcher)
overridevirtual

Prepare a map between upstream hits of the target-geomcst and a list of Hit const *'s of this geom_cst_id(). This map will be used in the function hits_to_include_with_partial_match.

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

References protocols::match::downstream::DownstreamAlgorithm::geom_cst_id(), protocols::match::Matcher::hits(), and my_hits_for_target_hit_map_.

void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::process_hit ( Hit const &  hit,
core::conformation::Residue const &  upstream_conformation 
)
void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::reorder_restypes ( upstream::UpstreamBuilder const &  builder)
private
void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::respond_to_peripheral_hitlist_change ( Matcher matcher)
overridevirtual
void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::respond_to_primary_hitlist_change ( Matcher matcher,
core::Size  round_just_completed 
)
overridevirtual

Prune hits away from the target_geomcst's hit list following a change to the hits for my geom_cst_id(). Pruning hits from the target_geomcst's hit list will trigger a round of peripheral-hitlist-change responses.

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(), n_viable_target_hits_since_last_pruning_, target_geomcst_id_, and protocols::match::downstream::TR().

void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::set_target_geomcst_id ( core::Size  target_geomcst_id)

References target_geomcst_id_.

void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::set_target_rotamer_coords ( TargetRotamerCoordsOP  target_geomcst_coords)
private

Allow another SecondaryMatcherToUpstreamResidue to set my TargetRotamerCoords object so that we can share this data.

References target_geomcst_coords_.

void protocols::match::downstream::SecondaryMatcherToUpstreamResidue::store_rotamer_coords ( Hit const &  hit,
core::conformation::Residue const &  upstream_conformation 
)
private
bool protocols::match::downstream::SecondaryMatcherToUpstreamResidue::upstream_only ( ) const
overridevirtual

returns true; this secondary matcher does not describe the location of the downstream partner

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

Member Data Documentation

core::Size protocols::match::downstream::SecondaryMatcherToUpstreamResidue::count_rotamer_for_lastseen_restype_
private
bool protocols::match::downstream::SecondaryMatcherToUpstreamResidue::count_rotamers_per_target_restype_
private
core::chemical::ResidueTypeCOP protocols::match::downstream::SecondaryMatcherToUpstreamResidue::last_seen_restype_
private
core::Size protocols::match::downstream::SecondaryMatcherToUpstreamResidue::last_seen_restype_index_
private
std::map< Size2Tuple, HitPtrListOP > protocols::match::downstream::SecondaryMatcherToUpstreamResidue::my_hits_for_target_hit_map_
private
utility::vector1< core::Size > protocols::match::downstream::SecondaryMatcherToUpstreamResidue::n_rotamers_per_target_restype_
private
core::Size protocols::match::downstream::SecondaryMatcherToUpstreamResidue::n_viable_target_hits_since_last_pruning_
private
utility::vector1< EvaluatorSet > protocols::match::downstream::SecondaryMatcherToUpstreamResidue::respair_evaluators_
private
utility::vector1< core::Size > protocols::match::downstream::SecondaryMatcherToUpstreamResidue::smUR_pose_build_resids_
private

Referenced by build().

TargetRotamerCoordsOP protocols::match::downstream::SecondaryMatcherToUpstreamResidue::target_geomcst_coords_
private
core::Size protocols::match::downstream::SecondaryMatcherToUpstreamResidue::target_geomcst_id_
private

The id for the geom-cst that this SecondaryMatcher is dependent upon; the upstream geometries for residues generated by the target-geometric constraint are examined in the build() method.

Referenced by build_hits_at_all_positions(), hits_to_include_with_partial_match(), prepare_for_hit_generation(), prepare_for_hit_generation_at_target_build_point(), respond_to_peripheral_hitlist_change(), respond_to_primary_hitlist_change(), and set_target_geomcst_id().

Matcher::HitListConstIterator protocols::match::downstream::SecondaryMatcherToUpstreamResidue::target_hits_end_
private
Matcher::HitListConstIterator protocols::match::downstream::SecondaryMatcherToUpstreamResidue::target_hits_for_focused_build_point_begin_
private
Matcher::HitListConstIterator protocols::match::downstream::SecondaryMatcherToUpstreamResidue::target_hits_for_focused_build_point_end_
private
std::map< core::chemical::ResidueTypeCOP, core::Size > protocols::match::downstream::SecondaryMatcherToUpstreamResidue::target_restype_index_map_
private
utility::vector1< core::chemical::ResidueTypeCOP > protocols::match::downstream::SecondaryMatcherToUpstreamResidue::target_restypes_
private

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