Rosetta  2020.37
 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
core::pack::rotamer_set::RotamerSubset Class Reference

Container for a subset of rotamers that have been created by another rotamer set. This subset object copies pointers to the rotamers contained in another set, as opposed to cloning the rotamers. It's main purpose is to manage the bookkeeping involved in packing with a subset of rotamers (when it might be faster to use a subset and to create an interaction graph specifically for that subset than to simply pass an abreviated list of rotamers to the SimAnnealer with the "rot_to_pack" vector). More...

#include <RotamerSubset.hh>

Inheritance diagram for core::pack::rotamer_set::RotamerSubset:
Inheritance graph
[legend]

Public Types

typedef conformation::ResidueOP ResidueOP
 
typedef conformation::ResidueCOP ResidueCOP
 
typedef
scoring::trie::RotamerTrieBaseOP 
RotamerTrieBaseOP
 
- Public Types inherited from core::conformation::RotamerSetBase
typedef
basic::datacache::BasicDataCache 
BasicDataCache
 
typedef
basic::datacache::BasicDataCacheOP 
BasicDataCacheOP
 

Public Member Functions

 RotamerSubset (RotamerSet &rotset, utility::vector1< Size > const &rotamer_subset)
 
 ~RotamerSubset () override
 
void add_rotamer (conformation::Residue const &rotamer) override
 Append a rotamer to the list; it will not be sorted into the same group as other rotamers of the same group or amino acid unless the last group/amino acid is already the same. Instead it will sit at the end of the list of Rotamers. There are performance implications of using this function instead of add_rotamer_into_existing_group: there are several places in the code which scale quadratically with the number of amino acid groups (but where we assume that this number is small) so if you call this function N times oscilating between ASP and ASN rotamers, you will get O(N^2) performance. If you do not need your rotamers to appear in a particular order, use add_rotamer_into_existing_group instead. More...
 
void add_rotamer_into_existing_group (conformation::Residue const &rotamer) override
 Add a rotamer to the RotamerSet where you will group it with other residues of the same type or barring that, the same group. This will keep the total number of residue type groups down. It will not guarantee (it cannot guarantee) that the newly added rotamer will appear after existing rotamers or at the end of the list of rotamers – if you need that kind of guarantee, use add_rotamer instead. More...
 
Size get_n_residue_types () const override
 Return the number of different residue types; two residue types are considered different if they have a different address. More...
 
Size get_n_residue_groups () const override
 Return the number of different residue groups. Two residue types are considered to be part of the same block of residues if 1. they have the same address or 2. they have the same "name3" and the same neighbor radius. More...
 
Size get_residue_type_begin (Size which_restype) const override
 Return the first rotamer of a particular residue type. More...
 
Size get_residue_group_begin (Size which_resgroup) const override
 Return the first rotamer that belongs to a particular rotamer group. More...
 
Size get_n_rotamers_for_residue_type (Size which_restype) const override
 
Size get_n_rotamers_for_residue_group (Size which_resgroup) const override
 
Size get_residue_type_index_for_rotamer (Size which_rotamer) const override
 given a rotamer id, return an int which represents a type for this rotamer. More...
 
Size get_residue_group_index_for_rotamer (Size which_rotamer) const override
 given a rotamer id, return an int which represents a type for this rotamer. INCOMPLETELY IMPLEMENTED. ANDREW: FIX THIS. More...
 
Size num_rotamers () const override
 
Size id_for_current_rotamer () const override
 Return the index in the RotamerSet for the current rotamer. More...
 
conformation::ResidueCOP rotamer (Size rot_id) const override
 
basic::datacache::BasicDataCache & rotamer_data_cache (Size rot_id) const override
 
conformation::Residue const & rotamer_ref (Size rot_id) const override
 
Rotamers::const_iterator begin () const override
 
Rotamers::const_iterator end () const override
 
conformation::ResidueOP nonconst_rotamer (Size rot_id) override
 
void store_trie (Size method_enum_id, conformation::AbstractRotamerTrieOP trie) override
 
conformation::AbstractRotamerTrieCOP get_trie (Size method_enum_id) const override
 
void drop_rotamer (Size rot_id) override
 removes a single rotamer and causes a rotamer index update More...
 
void drop_rotamers (utility::vector1< bool > const &rotamers_to_delete) override
 rotamers_to_delete must be of size nrotmaers – each position in the array that's "true" is removed from the set of rotamers More...
 
void drop_rotamers_by_index (utility::vector1< Size > const &rotamer_indices_to_delete) override
 deletes the rotamers in the list with the given indices. The indices of these rotamers is presumed to be those before any delete operation. e.g. if there are four rotamers, and rotamer_indices_to_delete includes 1 & 3, then the rotamers that will remain are the rotamers originally indexed as 2 and 4, even though their new indices will be 1 & 2. More...
 
void initialize_pose_for_rotset_creation (pose::Pose &) const override
 Give the pose a chance to stash any data needed by the rotset need nonconst access to pose. More...
 
void show (std::ostream &out) const override
 
void build_rotamers (pose::Pose const &the_pose, scoring::ScoreFunction const &scorefxn, task::PackerTask const &task, utility::graph::GraphCOP packer_neighbor_graph, bool use_neighbor_context=true) override
 
void build_dependent_rotamers (RotamerSets const &rotamer_sets, pose::Pose const &pose, scoring::ScoreFunction const &scorefxn, task::PackerTask const &task, utility::graph::GraphCOP packer_neighbor_graph) override
 
virtual void build_pwat_rotamers (pose::Pose const &pose, core::Size resid, utility::vector1< Vector > const &new_pwat_rotset)
 
void compute_one_body_energies (pose::Pose const &pose, scoring::ScoreFunction const &scorefxn, task::PackerTask const &task, utility::graph::GraphCOP packer_neighbor_graph, utility::vector1< core::PackerEnergy > &energies, bool const no_update=false) const override
 
void compute_one_and_two_body_energies (pose::Pose const &pose, scoring::ScoreFunction const &scorefxn, task::PackerTask const &task, utility::graph::GraphCOP packer_neighbor_graph, utility::vector1< core::PackerEnergy > &one_body_energies, utility::vector1< utility::vector1< core::PackerEnergy > > &two_body_energies, utility::vector1< core::Size > &packable_neighbors) const override
 
void compute_one_body_energy_maps (pose::Pose const &pose, scoring::ScoreFunction const &scorefxn, task::PackerTask const &task, utility::graph::GraphCOP packer_neighbor_graph, utility::vector1< scoring::EnergyMap > &energies) const override
 for OptE More...
 
- Public Member Functions inherited from core::pack::rotamer_set::RotamerSet
 RotamerSet ()
 
 ~RotamerSet () override
 
void set_resid (Size resid)
 
Size resid () const override
 
- Public Member Functions inherited from core::conformation::RotamerSetBase
 RotamerSetBase ()
 
 ~RotamerSetBase () override
 
BasicDataCachedata ()
 BasicDataCache indexed by enum in core/pack/rotamer_set/RotamerSetCacheableDataType.hh. More...
 
BasicDataCache const & data () const
 BasicDataCache indexed by enum in core/pack/rotamer_set/RotamerSetCacheableDataType.hh. More...
 

Private Member Functions

 RotamerSubset (RotamerSubset const &)
 (private) No copy-constructor More...
 
void steal_rotamer (conformation::ResidueOP rotamer)
 declare that a new block of residue types has begun, and that new residues are about to be pushed back. NOT IMPLEMENTED. More...
 
void prepare_for_new_residue_type (core::chemical::ResidueType const &restype)
 declare that a new block of residue types has begun, and that new residues are about to be pushed back. More...
 
bool different_restype (core::chemical::ResidueType const &rt1, core::chemical::ResidueType const &rt2) const
 should two residue types be considered the same residue type? More...
 
bool different_resgroup (core::chemical::ResidueType const &rt1, core::chemical::ResidueType const &rt2) const
 should two residue types be considered to belong to the same residue-type group? More...
 
void new_residue_type ()
 This function should not be called directly – it ought to be called only from prepare_for_new_residue_type. More...
 
void new_residue_group ()
 This function should not be called directly – it ought to be called only from prepare_for_new_residue_type. More...
 
void push_back_rotamer (conformation::ResidueOP)
 appends a rotamer to the list of rotamers, and increments the count for the number of rotamers for the current value of n_residue_types. More...
 
void update_rotamer_offsets () const override
 Lazy update of rotamer indices and offsets and integration of those rotamers in the rotamers_waiting_for_sort_ list. More...
 

Private Attributes

Rotamers rotamers_
 
std::list< ResidueOProtamers_waiting_for_sort_
 
Size n_residue_types_
 
Size n_residue_groups_
 
utility::vector1< Sizeresidue_type_rotamers_begin_
 
utility::vector1< Sizeresidue_group_rotamers_begin_
 
utility::vector1< Sizen_rotamers_for_restype_
 
utility::vector1< Sizen_rotamers_for_resgroup_
 
utility::vector1< Sizeresidue_type_for_rotamers_
 
utility::vector1< Sizeresidue_group_for_rotamers_
 
utility::vector1
< conformation::AbstractRotamerTrieOP
cached_tries_
 
Size id_for_current_rotamer_
 
ResidueOP current_rotamer_copy_
 
bool rotamer_offsets_require_update_
 

Detailed Description

Container for a subset of rotamers that have been created by another rotamer set. This subset object copies pointers to the rotamers contained in another set, as opposed to cloning the rotamers. It's main purpose is to manage the bookkeeping involved in packing with a subset of rotamers (when it might be faster to use a subset and to create an interaction graph specifically for that subset than to simply pass an abreviated list of rotamers to the SimAnnealer with the "rot_to_pack" vector).

Member Typedef Documentation

Constructor & Destructor Documentation

core::pack::rotamer_set::RotamerSubset::RotamerSubset ( RotamerSet rotset,
utility::vector1< Size > const &  rotamer_subset 
)
core::pack::rotamer_set::RotamerSubset::~RotamerSubset ( )
overridedefault
core::pack::rotamer_set::RotamerSubset::RotamerSubset ( RotamerSubset const &  )
private

(private) No copy-constructor

Member Function Documentation

void core::pack::rotamer_set::RotamerSubset::add_rotamer ( conformation::Residue const &  rotamer)
overridevirtual

Append a rotamer to the list; it will not be sorted into the same group as other rotamers of the same group or amino acid unless the last group/amino acid is already the same. Instead it will sit at the end of the list of Rotamers. There are performance implications of using this function instead of add_rotamer_into_existing_group: there are several places in the code which scale quadratically with the number of amino acid groups (but where we assume that this number is small) so if you call this function N times oscilating between ASP and ASN rotamers, you will get O(N^2) performance. If you do not need your rotamers to appear in a particular order, use add_rotamer_into_existing_group instead.

Implements core::pack::rotamer_set::RotamerSet.

References core::conformation::Residue::clone(), prepare_for_new_residue_type(), push_back_rotamer(), and core::conformation::Residue::type().

void core::pack::rotamer_set::RotamerSubset::add_rotamer_into_existing_group ( conformation::Residue const &  rotamer)
overridevirtual

Add a rotamer to the RotamerSet where you will group it with other residues of the same type or barring that, the same group. This will keep the total number of residue type groups down. It will not guarantee (it cannot guarantee) that the newly added rotamer will appear after existing rotamers or at the end of the list of rotamers – if you need that kind of guarantee, use add_rotamer instead.

Implements core::pack::rotamer_set::RotamerSet.

References core::conformation::Residue::clone(), rotamer_offsets_require_update_, and rotamers_waiting_for_sort_.

Rotamers::const_iterator core::pack::rotamer_set::RotamerSubset::begin ( ) const
inlineoverridevirtual
void core::pack::rotamer_set::RotamerSubset::build_dependent_rotamers ( RotamerSets const &  rotamer_sets,
pose::Pose const &  pose,
scoring::ScoreFunction const &  scorefxn,
task::PackerTask const &  task,
utility::graph::GraphCOP  packer_neighbor_graph 
)
overridevirtual
void core::pack::rotamer_set::RotamerSubset::build_pwat_rotamers ( pose::Pose const &  pose,
core::Size  resid,
utility::vector1< Vector > const &  new_pwat_rotset 
)
virtual
void core::pack::rotamer_set::RotamerSubset::build_rotamers ( pose::Pose const &  the_pose,
scoring::ScoreFunction const &  scorefxn,
task::PackerTask const &  task,
utility::graph::GraphCOP  packer_neighbor_graph,
bool  use_neighbor_context = true 
)
overridevirtual
void core::pack::rotamer_set::RotamerSubset::compute_one_and_two_body_energies ( pose::Pose const &  pose,
scoring::ScoreFunction const &  scorefxn,
task::PackerTask const &  task,
utility::graph::GraphCOP  packer_neighbor_graph,
utility::vector1< core::PackerEnergy > &  one_body_energies,
utility::vector1< utility::vector1< core::PackerEnergy > > &  two_body_energies,
utility::vector1< core::Size > &  packable_neighbors 
) const
overridevirtual
void core::pack::rotamer_set::RotamerSubset::compute_one_body_energies ( pose::Pose const &  pose,
scoring::ScoreFunction const &  scorefxn,
task::PackerTask const &  task,
utility::graph::GraphCOP  packer_neighbor_graph,
utility::vector1< core::PackerEnergy > &  energies,
bool const  no_update = false 
) const
overridevirtual
void core::pack::rotamer_set::RotamerSubset::compute_one_body_energy_maps ( pose::Pose const &  pose,
scoring::ScoreFunction const &  scorefxn,
task::PackerTask const &  task,
utility::graph::GraphCOP  packer_neighbor_graph,
utility::vector1< scoring::EnergyMap > &  energies 
) const
overridevirtual
bool core::pack::rotamer_set::RotamerSubset::different_resgroup ( core::chemical::ResidueType const &  rt1,
core::chemical::ResidueType const &  rt2 
) const
private

should two residue types be considered to belong to the same residue-type group?

The logic to determine if two residue types should be classified as part of the same group. The thinking is as follows. Two residue types are in the same group if they have the same residue type. They're in the same group if their residue types differ, but they have the same name3 (HIS vs HIS_D have the same name3) and they have the same neighbor radius (SER and PhosphoSER should have different groups). The goal is to organize residue types together which will be packed together (as happens in multistate design with HIS and HISD) and that have the same reach (as is needed for the AANeighborSparseMatrix).

References core::chemical::ResidueTypeBase::name3(), and core::chemical::ResidueType::nbr_radius().

Referenced by prepare_for_new_residue_type(), and update_rotamer_offsets().

bool core::pack::rotamer_set::RotamerSubset::different_restype ( core::chemical::ResidueType const &  rt1,
core::chemical::ResidueType const &  rt2 
) const
private

should two residue types be considered the same residue type?

Referenced by prepare_for_new_residue_type(), and update_rotamer_offsets().

void core::pack::rotamer_set::RotamerSubset::drop_rotamer ( Size  rot_id)
overridevirtual

removes a single rotamer and causes a rotamer index update

O(n) operation; if you have a lot of rotamers you want to remove, use drop_rotamers() instead.

Implements core::pack::rotamer_set::RotamerSet.

References id_for_current_rotamer_, rotamer_offsets_require_update_, rotamers_, and update_rotamer_offsets().

void core::pack::rotamer_set::RotamerSubset::drop_rotamers ( utility::vector1< bool > const &  rotamers_to_delete)
overridevirtual

rotamers_to_delete must be of size nrotmaers – each position in the array that's "true" is removed from the set of rotamers

Implements core::pack::rotamer_set::RotamerSet.

References current_rotamer_copy_, id_for_current_rotamer_, rotamer_offsets_require_update_, rotamers_, and update_rotamer_offsets().

Referenced by drop_rotamers_by_index().

void core::pack::rotamer_set::RotamerSubset::drop_rotamers_by_index ( utility::vector1< Size > const &  rotamer_indices_to_delete)
overridevirtual

deletes the rotamers in the list with the given indices. The indices of these rotamers is presumed to be those before any delete operation. e.g. if there are four rotamers, and rotamer_indices_to_delete includes 1 & 3, then the rotamers that will remain are the rotamers originally indexed as 2 and 4, even though their new indices will be 1 & 2.

Implements core::pack::rotamer_set::RotamerSet.

References drop_rotamers(), and rotamers_.

Rotamers::const_iterator core::pack::rotamer_set::RotamerSubset::end ( ) const
inlineoverridevirtual
Size core::pack::rotamer_set::RotamerSubset::get_n_residue_groups ( ) const
overridevirtual

Return the number of different residue groups. Two residue types are considered to be part of the same block of residues if 1. they have the same address or 2. they have the same "name3" and the same neighbor radius.

Implements core::pack::rotamer_set::RotamerSet.

References n_residue_groups_, and update_rotamer_offsets().

Referenced by show().

Size core::pack::rotamer_set::RotamerSubset::get_n_residue_types ( ) const
overridevirtual

Return the number of different residue types; two residue types are considered different if they have a different address.

Implements core::pack::rotamer_set::RotamerSet.

References n_residue_types_, and update_rotamer_offsets().

Referenced by show().

Size core::pack::rotamer_set::RotamerSubset::get_n_rotamers_for_residue_group ( Size  which_resgroup) const
overridevirtual
Size core::pack::rotamer_set::RotamerSubset::get_n_rotamers_for_residue_type ( Size  which_restype) const
overridevirtual
Size core::pack::rotamer_set::RotamerSubset::get_residue_group_begin ( Size  which_resgroup) const
overridevirtual

Return the first rotamer that belongs to a particular rotamer group.

Implements core::pack::rotamer_set::RotamerSet.

References n_residue_groups_, residue_group_rotamers_begin_, and update_rotamer_offsets().

Size core::pack::rotamer_set::RotamerSubset::get_residue_group_index_for_rotamer ( Size  which_rotamer) const
overridevirtual

given a rotamer id, return an int which represents a type for this rotamer. INCOMPLETELY IMPLEMENTED. ANDREW: FIX THIS.

Implements core::pack::rotamer_set::RotamerSet.

Size core::pack::rotamer_set::RotamerSubset::get_residue_type_begin ( Size  which_restype) const
overridevirtual

Return the first rotamer of a particular residue type.

Implements core::pack::rotamer_set::RotamerSet.

References n_residue_types_, residue_type_rotamers_begin_, and update_rotamer_offsets().

Size core::pack::rotamer_set::RotamerSubset::get_residue_type_index_for_rotamer ( Size  which_rotamer) const
overridevirtual

given a rotamer id, return an int which represents a type for this rotamer.

given a rotamer id, return an int which represents a type for this rotamer. INCOMPLETELY IMPLEMENTED. ANDREW: FIX THIS.

Implements core::pack::rotamer_set::RotamerSet.

conformation::AbstractRotamerTrieCOP core::pack::rotamer_set::RotamerSubset::get_trie ( Size  method_enum_id) const
overridevirtual
Size core::pack::rotamer_set::RotamerSubset::id_for_current_rotamer ( ) const
overridevirtual

Return the index in the RotamerSet for the current rotamer.

Implements core::pack::rotamer_set::RotamerSet.

References id_for_current_rotamer_.

void core::pack::rotamer_set::RotamerSubset::initialize_pose_for_rotset_creation ( pose::Pose ) const
inlineoverridevirtual

Give the pose a chance to stash any data needed by the rotset need nonconst access to pose.

Implements core::pack::rotamer_set::RotamerSet.

void core::pack::rotamer_set::RotamerSubset::new_residue_group ( )
private

This function should not be called directly – it ought to be called only from prepare_for_new_residue_type.

References n_residue_groups_, n_rotamers_for_resgroup_, num_rotamers(), and residue_group_rotamers_begin_.

Referenced by prepare_for_new_residue_type().

void core::pack::rotamer_set::RotamerSubset::new_residue_type ( )
private

This function should not be called directly – it ought to be called only from prepare_for_new_residue_type.

References n_residue_types_, n_rotamers_for_restype_, num_rotamers(), and residue_type_rotamers_begin_.

Referenced by prepare_for_new_residue_type().

conformation::ResidueOP core::pack::rotamer_set::RotamerSubset::nonconst_rotamer ( Size  rot_id)
overridevirtual

In handing out non-const data, the guarantee of rotamer-type contiguity within the rotamers_ array, and the correspondence of the rotamer offset data is lost. Future access to rotamer offset data first requires an update of the rotamer offset arrays.

Implements core::pack::rotamer_set::RotamerSet.

References rotamer_offsets_require_update_, and rotamers_.

Size core::pack::rotamer_set::RotamerSubset::num_rotamers ( ) const
overridevirtual
void core::pack::rotamer_set::RotamerSubset::prepare_for_new_residue_type ( core::chemical::ResidueType const &  restype)
private

declare that a new block of residue types has begun, and that new residues are about to be pushed back.

References different_resgroup(), different_restype(), n_residue_types_, new_residue_group(), new_residue_type(), num_rotamers(), and rotamers_.

Referenced by add_rotamer().

void core::pack::rotamer_set::RotamerSubset::push_back_rotamer ( conformation::ResidueOP  rotamer)
private

appends a rotamer to the list of rotamers, and increments the count for the number of rotamers for the current value of n_residue_types.

References n_residue_types_, n_rotamers_for_restype_, residue_type_for_rotamers_, and rotamers_.

Referenced by add_rotamer().

conformation::ResidueCOP core::pack::rotamer_set::RotamerSubset::rotamer ( Size  rot_id) const
overridevirtual
basic::datacache::BasicDataCache & core::pack::rotamer_set::RotamerSubset::rotamer_data_cache ( Size  rot_id) const
overridevirtual
conformation::Residue const & core::pack::rotamer_set::RotamerSubset::rotamer_ref ( Size  rot_id) const
overridevirtual
void core::pack::rotamer_set::RotamerSubset::show ( std::ostream &  out) const
overridevirtual
void core::pack::rotamer_set::RotamerSubset::steal_rotamer ( conformation::ResidueOP  rotamer)
private

declare that a new block of residue types has begun, and that new residues are about to be pushed back. NOT IMPLEMENTED.

declare that a new block of residue types has begun, and that new residues are about to be pushed back.

appends a rotamer to the list of rotamers, and increments the count for the number of rotamers for the current value of n_residue_types. NOT IMPLEMENTED. Borrow (steal) a rotamer held by another RotamerSet without cloning that rotamer. That is, both sets will now point at the same rotamer object, so if that rotamer changes for one set, it changes for both.

appends a rotamer to the list of rotamers, and increments the count for the number of rotamers for the current value of n_residue_types.

References rotamer_offsets_require_update_, and rotamers_.

Referenced by RotamerSubset().

void core::pack::rotamer_set::RotamerSubset::store_trie ( Size  method_enum_id,
conformation::AbstractRotamerTrieOP  trie 
)
overridevirtual
void core::pack::rotamer_set::RotamerSubset::update_rotamer_offsets ( ) const
overrideprivatevirtual

Member Data Documentation

utility::vector1< conformation::AbstractRotamerTrieOP > core::pack::rotamer_set::RotamerSubset::cached_tries_
private

Referenced by get_trie(), and store_trie().

ResidueOP core::pack::rotamer_set::RotamerSubset::current_rotamer_copy_
private

Referenced by drop_rotamers().

Size core::pack::rotamer_set::RotamerSubset::id_for_current_rotamer_
mutableprivate
Size core::pack::rotamer_set::RotamerSubset::n_residue_groups_
mutableprivate
Size core::pack::rotamer_set::RotamerSubset::n_residue_types_
mutableprivate
utility::vector1< Size > core::pack::rotamer_set::RotamerSubset::n_rotamers_for_resgroup_
mutableprivate
utility::vector1< Size > core::pack::rotamer_set::RotamerSubset::n_rotamers_for_restype_
mutableprivate
utility::vector1< Size > core::pack::rotamer_set::RotamerSubset::residue_group_for_rotamers_
mutableprivate

Referenced by update_rotamer_offsets().

utility::vector1< Size > core::pack::rotamer_set::RotamerSubset::residue_group_rotamers_begin_
mutableprivate
utility::vector1< Size > core::pack::rotamer_set::RotamerSubset::residue_type_for_rotamers_
mutableprivate
utility::vector1< Size > core::pack::rotamer_set::RotamerSubset::residue_type_rotamers_begin_
mutableprivate
bool core::pack::rotamer_set::RotamerSubset::rotamer_offsets_require_update_
mutableprivate
Rotamers core::pack::rotamer_set::RotamerSubset::rotamers_
mutableprivate
std::list< ResidueOP > core::pack::rotamer_set::RotamerSubset::rotamers_waiting_for_sort_
mutableprivate

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