Rosetta
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
core::pack::task::residue_selector::ClashBasedShellSelector Class Reference

Define a shell based on potential sidechain clashes with a set of residues being repacked or designed. More...

#include <ClashBasedShellSelector.hh>

Inheritance diagram for core::pack::task::residue_selector::ClashBasedShellSelector:
Inheritance graph
[legend]

Public Member Functions

 ClashBasedShellSelector ()=default
 Default constructor. More...
 
 ClashBasedShellSelector (ClashBasedShellSelector const &)=default
 Default copy constructor. More...
 
 ~ClashBasedShellSelector () override=default
 Default destructor. More...
 
 ClashBasedShellSelector (std::string resnums)
 
 ClashBasedShellSelector (core::select::residue_selector::ResidueSelectorCOP selector)
 Initialize from a residue selector. More...
 
 ClashBasedShellSelector (core::pack::task::TaskFactoryCOP task_factory, bool focus_on_designable=true)
 Initialize from a task factory. More...
 
 ClashBasedShellSelector (core::pack::task::PackerTaskCOP task, bool focus_on_designable=true)
 Initialize from a packer task. More...
 
 ClashBasedShellSelector (std::set< core::Size > resnums)
 Initialize from a set of residue indices. More...
 
 ClashBasedShellSelector (utility::vector1< bool > mask)
 Initialize from a boolean vector. More...
 
core::select::residue_selector::ResidueSelectorOP clone () const override
 Copy this object and return an owning pointer to the result. More...
 
core::select::residue_selector::ResidueSubset apply (core::pose::Pose const &pose) const override
 Select the residues that are clashing with any rotamer of the previously specified focus residues. More...
 
void parse_my_tag (utility::tag::TagCOP tag, basic::datacache::DataMap &datamap) override
 Initialize from a RosettaScripts tag. More...
 
std::string get_name () const override
 Return "ClashBasedShell". More...
 
void invert (bool inverted=true)
 Select the residues that aren't part of the clash-based shell. More...
 
void clear_focus ()
 Reset the focus residues. More...
 
void set_focus (std::string resnums)
 Specify the residues to build the shell around from a string containing a list of indices, e.g. "34-46,199-202". More...
 
void set_focus (core::select::residue_selector::ResidueSelectorCOP selector)
 Specify the residues to build the shell around from a residue selector. More...
 
void set_focus (core::pack::task::TaskFactoryCOP task_factory, bool focus_on_designable=DEFAULT_FOCUS_ON_DESIGNABLE)
 Specify the residues to build the shell around from a task factory. More...
 
void set_focus (core::pack::task::PackerTaskCOP task, bool focus_on_designable=DEFAULT_FOCUS_ON_DESIGNABLE)
 Specify the residues to build the shell around from a packer task. More...
 
void set_focus (std::set< core::Size > resnums)
 Specify the residues to build the shell around from a set of residue indices. More...
 
void set_focus (utility::vector1< bool > bool_mask)
 Specify the residues to build the shell around from a boolean vector. More...
 
void set_scorefxn (core::scoring::ScoreFunctionOP scorefxn)
 Set the score function to use when generating rotamers. More...
 
void set_include_focus (bool include_focus)
 If true, include the focus residues in the ultimate selection. More...
 
void set_num_shells (core::Size num_shells)
 Specify the number of shells to calculate. More...
 
void set_bump_overlap_factor (core::Real set_bump_overlap_factor)
 Control how close two atoms can be before they are considered to be clashing. More...
 
core::scoring::ScoreFunctionOP get_scorefxn () const
 Get the score function to use when generating rotamers. More...
 
core::Size get_num_shells () const
 Get the number of shells to calculate. More...
 
core::Real get_bump_overlap_factor () const
 Get how close two atoms can be before they are considered to be clashing. More...
 
bool get_include_focus () const
 Return whether the focus residues will be included in the ultimate selection. More...
 
bool is_inverted () const
 Return whether to selection will be inverted. More...
 
- Public Member Functions inherited from core::select::residue_selector::ResidueSelector
 ResidueSelector ()
 Constructor. More...
 
 ~ResidueSelector () override
 Destructor. More...
 
utility::vector1< core::Sizeselection_positions (core::pose::Pose const &pose) const
 Calls apply and returns the Rosetta numbering corresponding to the selected residues. More...
 
virtual void provide_citation_info (basic::citation_manager::CitationCollectionList &) const
 Provide citations to the passed CitationCollectionList Subclasses should add the info for themselves and any other classes they use. More...
 

Static Public Member Functions

static void provide_xml_schema (utility::tag::XMLSchemaDefinition &xsd)
 Define the expected RosettaScripts options. More...
 
static void provide_xml_schema_attributes (utility::tag::AttributeList &attributes)
 Define the attributes understood by this RosettaScripts tag. More...
 
static std::string class_name ()
 Return "ClashBasedShell". More...
 

Static Public Attributes

static core::Size const DEFAULT_NUM_SHELLS = 1
 
static core::Real const DEFAULT_BUMP_FACTOR = 0.5
 
static bool const DEFAULT_INVERT = false
 
static bool const DEFAULT_INCLUDE_FOCUS = true
 
static bool const DEFAULT_FOCUS_ON_DESIGNABLE = true
 

Private Attributes

std::string focus_str_
 
std::set< core::Sizefocus_set_
 
utility::vector1< bool > focus_mask_
 
core::select::residue_selector::ResidueSelectorCOP focus_selector_ = nullptr
 
core::pack::task::PackerTaskCOP focus_task_ = nullptr
 
core::pack::task::TaskFactoryCOP focus_task_factory_ = nullptr
 
core::scoring::ScoreFunctionOP scorefxn_ = nullptr
 
core::Size num_shells_ = DEFAULT_NUM_SHELLS
 
core::Real bump_overlap_factor_ = DEFAULT_BUMP_FACTOR
 
bool is_inverted_ = DEFAULT_INVERT
 
bool include_focus_ = DEFAULT_INCLUDE_FOCUS
 
bool focus_on_designable_ = DEFAULT_FOCUS_ON_DESIGNABLE
 

Detailed Description

Define a shell based on potential sidechain clashes with a set of residues being repacked or designed.

The most common reason to use a clash-based shell is to pick a minimal set of residues to repack around some positions you want to design. For most simple cases, the ClashBasedRepackShell task operation is the best way to do this. Use ClashBasedShellSelector if you want to combine the repack shell with other selections (e.g. repack everything that's in the first two repack shells but not more than 6Å from a certain residue), or do something else entirely.

The best way to specify which residues to build the shell around (called the "focus" residues, see set_focus()) is to use a TaskFactory. This is because task factories know which rotamers go in each position, so each one can be checked for clashes. You can also specify focus residues using a ResidueSelector. In this case rotamers will be generated for only the native amino acid (i.e. assuming the positions are being repacked) and checked for clashes as usual.

If you ask for more than one shell (see set_num_shells()), the shell calculation will be iterated, with the residues found at each step included as inputs for the next. The residues added in this manner are treated as repackable for the purpose of making shells (i.e. only rotamers of the native amino acid are considered).

This class mainly exists to provide a RosettaScripts interface for selecting clash-based shells. If you want to select such a shell from C++, the find_clashing_shells() function will be simpler and easier to use.

In order for a residue the be included in the clash-based shell, its sidechain must have a steric clash with one of the rotamers allowed for one of the focus residues. Furthermore, that rotamer must not have any backbone clashes with any other residue. Backbone clashes can't be resolved by the packer, so there's no point considering rotamers that clash with the backbone. Clashes are defined entirely by inter-atomic distance and do not depend on any particular score terms.

Think twice before using ClashBasedShellSelector or ClashBasedRepackShell if you're running many simulations with different backbones, because you may end up picking different shells in different simulations. Repacking different sets of residues can make scores hard to compare, especially if your input structure isn't relaxed.

If you want to understand exactly why ClashBasedShellSelector either included or excluded a particular residue, run rosetta with the -out:levels core.pack.task.residue_selector.ClashBasedShellSelector:trace flag.

Constructor & Destructor Documentation

◆ ClashBasedShellSelector() [1/8]

core::pack::task::residue_selector::ClashBasedShellSelector::ClashBasedShellSelector ( )
default

Default constructor.

◆ ClashBasedShellSelector() [2/8]

core::pack::task::residue_selector::ClashBasedShellSelector::ClashBasedShellSelector ( ClashBasedShellSelector const &  )
default

Default copy constructor.

◆ ~ClashBasedShellSelector()

core::pack::task::residue_selector::ClashBasedShellSelector::~ClashBasedShellSelector ( )
overridedefault

Default destructor.

◆ ClashBasedShellSelector() [3/8]

core::pack::task::residue_selector::ClashBasedShellSelector::ClashBasedShellSelector ( std::string  resnums)

Initialize from a string containing a list of indices, e.g. "34-46,199-202".

◆ ClashBasedShellSelector() [4/8]

core::pack::task::residue_selector::ClashBasedShellSelector::ClashBasedShellSelector ( core::select::residue_selector::ResidueSelectorCOP  selector)

Initialize from a residue selector.

◆ ClashBasedShellSelector() [5/8]

core::pack::task::residue_selector::ClashBasedShellSelector::ClashBasedShellSelector ( core::pack::task::TaskFactoryCOP  task_factory,
bool  focus_on_designable = true 
)

Initialize from a task factory.

◆ ClashBasedShellSelector() [6/8]

core::pack::task::residue_selector::ClashBasedShellSelector::ClashBasedShellSelector ( core::pack::task::PackerTaskCOP  task,
bool  focus_on_designable = true 
)

Initialize from a packer task.

It's usually a bad idea to use a packer task instead of a task factory, because you'll get bugs if the pose used to create the packer task is different than the one passed to this selector's apply() method.

◆ ClashBasedShellSelector() [7/8]

core::pack::task::residue_selector::ClashBasedShellSelector::ClashBasedShellSelector ( std::set< core::Size resnums)

Initialize from a set of residue indices.

◆ ClashBasedShellSelector() [8/8]

core::pack::task::residue_selector::ClashBasedShellSelector::ClashBasedShellSelector ( utility::vector1< bool >  mask)

Initialize from a boolean vector.

The vector should have the same number of indices as the pose ultimately passed to apply().

Member Function Documentation

◆ apply()

ResidueSubset core::pack::task::residue_selector::ClashBasedShellSelector::apply ( core::pose::Pose const &  pose) const
overridevirtual

Select the residues that are clashing with any rotamer of the previously specified focus residues.

Rotamers that are clashing with the backbone are ignored, since the idea is to identify residues that might need to be repacked, and backbone clashes can't be solved by repacking.

Implements core::select::residue_selector::ResidueSelector.

References core::pack::task::residue_selector::bool_mask_from_resnums(), core::pack::task::residue_selector::find_clashing_shells(), core::pack::task::residue_selector::freeze_repack_positions(), core::pose::get_resnum_list(), core::scoring::get_score_function(), core::pose::Pose::size(), core::pack::task::residue_selector::task_from_bool_mask(), and core::pack::task::residue_selector::task_from_resnums().

◆ class_name()

std::string core::pack::task::residue_selector::ClashBasedShellSelector::class_name ( )
static

◆ clear_focus()

void core::pack::task::residue_selector::ClashBasedShellSelector::clear_focus ( )

Reset the focus residues.

◆ clone()

ResidueSelectorOP core::pack::task::residue_selector::ClashBasedShellSelector::clone ( ) const
overridevirtual

Copy this object and return an owning pointer to the result.

Clone operator.

Copy this object and return an owning pointer to the new object.

Implements core::select::residue_selector::ResidueSelector.

◆ get_bump_overlap_factor()

Real core::pack::task::residue_selector::ClashBasedShellSelector::get_bump_overlap_factor ( ) const

Get how close two atoms can be before they are considered to be clashing.

◆ get_include_focus()

bool core::pack::task::residue_selector::ClashBasedShellSelector::get_include_focus ( ) const

Return whether the focus residues will be included in the ultimate selection.

◆ get_name()

std::string core::pack::task::residue_selector::ClashBasedShellSelector::get_name ( ) const
overridevirtual

Return "ClashBasedShell".

Implements core::select::residue_selector::ResidueSelector.

References class_name().

◆ get_num_shells()

Size core::pack::task::residue_selector::ClashBasedShellSelector::get_num_shells ( ) const

Get the number of shells to calculate.

◆ get_scorefxn()

ScoreFunctionOP core::pack::task::residue_selector::ClashBasedShellSelector::get_scorefxn ( ) const

Get the score function to use when generating rotamers.

◆ invert()

void core::pack::task::residue_selector::ClashBasedShellSelector::invert ( bool  inverted = true)

Select the residues that aren't part of the clash-based shell.

This is useful for creating a repack shell, because you typically start with everything being repackable and your goal is to freeze the residues that aren't in a clash-based shell.

◆ is_inverted()

bool core::pack::task::residue_selector::ClashBasedShellSelector::is_inverted ( ) const

Return whether to selection will be inverted.

◆ parse_my_tag()

void core::pack::task::residue_selector::ClashBasedShellSelector::parse_my_tag ( utility::tag::TagCOP  tag,
basic::datacache::DataMap datamap 
)
overridevirtual

◆ provide_xml_schema()

void core::pack::task::residue_selector::ClashBasedShellSelector::provide_xml_schema ( utility::tag::XMLSchemaDefinition &  xsd)
static

◆ provide_xml_schema_attributes()

void core::pack::task::residue_selector::ClashBasedShellSelector::provide_xml_schema_attributes ( utility::tag::AttributeList &  attributes)
static

Define the attributes understood by this RosettaScripts tag.

This is provided separately from provide_xml_schema() so other entities (namely ClashBasedRepackShell) can easily support all the same attributes.

References core::select::residue_selector::attributes_for_parse_residue_selector(), core::scoring::attributes_for_parse_score_function(), and core::pack::task::attributes_for_parse_task_operations().

◆ set_bump_overlap_factor()

void core::pack::task::residue_selector::ClashBasedShellSelector::set_bump_overlap_factor ( core::Real  set_bump_overlap_factor)

Control how close two atoms can be before they are considered to be clashing.

Two atoms are considered to clash when the squared distance between them is less than: bump_overlap_factor * {sum of Lennard-Jones radii}^2.

◆ set_focus() [1/6]

void core::pack::task::residue_selector::ClashBasedShellSelector::set_focus ( core::pack::task::PackerTaskCOP  task,
bool  focus_on_designable = DEFAULT_FOCUS_ON_DESIGNABLE 
)

Specify the residues to build the shell around from a packer task.

It's usually a bad idea to use a packer task instead of a task factory, because you'll get bugs if the pose used to create the packer task is different than the one passed to this selector's apply() method.

The shell will be built considering all rotamers allowed by the given packer task. By default, only positions that can design are considered (because usually you want to build a repack around a set of designable positions), but you can also include repack positions by setting focus_on_designable to false.

◆ set_focus() [2/6]

void core::pack::task::residue_selector::ClashBasedShellSelector::set_focus ( core::pack::task::TaskFactoryCOP  task_factory,
bool  focus_on_designable = DEFAULT_FOCUS_ON_DESIGNABLE 
)

Specify the residues to build the shell around from a task factory.

The shell will be built considering all rotamers allowed by the given task factory. By default, only positions that can design are considered (because usually you want to build a repack around a set of designable positions), but you can also include repack positions by setting focus_on_designable to false.

◆ set_focus() [3/6]

void core::pack::task::residue_selector::ClashBasedShellSelector::set_focus ( core::select::residue_selector::ResidueSelectorCOP  selector)

Specify the residues to build the shell around from a residue selector.

The shell will be built considering all rotamers of the native amino acids of the specified residues. Specify a TaskFactory if you want to account for design.

◆ set_focus() [4/6]

void core::pack::task::residue_selector::ClashBasedShellSelector::set_focus ( std::set< core::Size resnums)

Specify the residues to build the shell around from a set of residue indices.

The shell will be built considering all rotamers of the native amino acids of the specified residues. Specify a TaskFactory if you want to account for design.

◆ set_focus() [5/6]

void core::pack::task::residue_selector::ClashBasedShellSelector::set_focus ( std::string  resnums)

Specify the residues to build the shell around from a string containing a list of indices, e.g. "34-46,199-202".

The shell will be built considering all rotamers of the native amino acids of the specified residues. Specify a TaskFactory if you want to account for design.

◆ set_focus() [6/6]

void core::pack::task::residue_selector::ClashBasedShellSelector::set_focus ( utility::vector1< bool >  bool_mask)

Specify the residues to build the shell around from a boolean vector.

The vector should have the same number of indices as the pose ultimately passed to apply(). The shell will be built considering all rotamers of the native amino acids of the specified residues. Specify a TaskFactory if you want to account for design.

◆ set_include_focus()

void core::pack::task::residue_selector::ClashBasedShellSelector::set_include_focus ( bool  include_focus)

If true, include the focus residues in the ultimate selection.

◆ set_num_shells()

void core::pack::task::residue_selector::ClashBasedShellSelector::set_num_shells ( core::Size  num_shells)

Specify the number of shells to calculate.

For example, if you asked for two shells, the first shell would include all the residues that could clash with the focus, and the second shell would contain all the residues that could clash with anything in the first shell. The ultimate selection would be the union of the two shells.

◆ set_scorefxn()

void core::pack::task::residue_selector::ClashBasedShellSelector::set_scorefxn ( core::scoring::ScoreFunctionOP  scorefxn)

Set the score function to use when generating rotamers.

I'm a little skeptical that we couldn't just use a default-constructed score function for this. -KBK

Member Data Documentation

◆ bump_overlap_factor_

core::Real core::pack::task::residue_selector::ClashBasedShellSelector::bump_overlap_factor_ = DEFAULT_BUMP_FACTOR
private

◆ DEFAULT_BUMP_FACTOR

Real const core::pack::task::residue_selector::ClashBasedShellSelector::DEFAULT_BUMP_FACTOR = 0.5
static

◆ DEFAULT_FOCUS_ON_DESIGNABLE

bool const core::pack::task::residue_selector::ClashBasedShellSelector::DEFAULT_FOCUS_ON_DESIGNABLE = true
static

◆ DEFAULT_INCLUDE_FOCUS

bool const core::pack::task::residue_selector::ClashBasedShellSelector::DEFAULT_INCLUDE_FOCUS = true
static

◆ DEFAULT_INVERT

bool const core::pack::task::residue_selector::ClashBasedShellSelector::DEFAULT_INVERT = false
static

◆ DEFAULT_NUM_SHELLS

Size const core::pack::task::residue_selector::ClashBasedShellSelector::DEFAULT_NUM_SHELLS = 1
static

◆ focus_mask_

utility::vector1<bool> core::pack::task::residue_selector::ClashBasedShellSelector::focus_mask_
private

◆ focus_on_designable_

bool core::pack::task::residue_selector::ClashBasedShellSelector::focus_on_designable_ = DEFAULT_FOCUS_ON_DESIGNABLE
private

◆ focus_selector_

core::select::residue_selector::ResidueSelectorCOP core::pack::task::residue_selector::ClashBasedShellSelector::focus_selector_ = nullptr
private

◆ focus_set_

std::set<core::Size> core::pack::task::residue_selector::ClashBasedShellSelector::focus_set_
private

◆ focus_str_

std::string core::pack::task::residue_selector::ClashBasedShellSelector::focus_str_
private

◆ focus_task_

core::pack::task::PackerTaskCOP core::pack::task::residue_selector::ClashBasedShellSelector::focus_task_ = nullptr
private

◆ focus_task_factory_

core::pack::task::TaskFactoryCOP core::pack::task::residue_selector::ClashBasedShellSelector::focus_task_factory_ = nullptr
private

◆ include_focus_

bool core::pack::task::residue_selector::ClashBasedShellSelector::include_focus_ = DEFAULT_INCLUDE_FOCUS
private

◆ is_inverted_

bool core::pack::task::residue_selector::ClashBasedShellSelector::is_inverted_ = DEFAULT_INVERT
private

◆ num_shells_

core::Size core::pack::task::residue_selector::ClashBasedShellSelector::num_shells_ = DEFAULT_NUM_SHELLS
private

◆ scorefxn_

core::scoring::ScoreFunctionOP core::pack::task::residue_selector::ClashBasedShellSelector::scorefxn_ = nullptr
private

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