residue_selector¶
Bindings for core::pack::task::residue_selector namespace
- class pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector¶
Bases:
ResidueSelector
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.
- apply(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, pose: pyrosetta.rosetta.core.pose.Pose) pyrosetta.rosetta.utility.vector1_bool ¶
- 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.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::apply(const class core::pose::Pose &) const –> class utility::vector1<bool, class std::allocator<bool> >
- assign(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, : pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector) pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector ¶
C++: core::pack::task::residue_selector::ClashBasedShellSelector::operator=(const class core::pack::task::residue_selector::ClashBasedShellSelector &) –> class core::pack::task::residue_selector::ClashBasedShellSelector &
- static class_name() str ¶
Return “ClashBasedShell”.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::class_name() –> std::string
- clear_focus(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector) None ¶
Reset the focus residues.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::clear_focus() –> void
- clone(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector) pyrosetta.rosetta.core.select.residue_selector.ResidueSelector ¶
Copy this object and return an owning pointer to the result.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::clone() const –> class std::shared_ptr<class core::select::residue_selector::ResidueSelector>
- get_bump_overlap_factor(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector) float ¶
- Get how close two atoms can be before they are considered to be
clashing.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::get_bump_overlap_factor() const –> double
- get_include_focus(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector) bool ¶
- Return whether the focus residues will be included in the ultimate
selection.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::get_include_focus() const –> bool
- get_name(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector) str ¶
Return “ClashBasedShell”.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::get_name() const –> std::string
- get_num_shells(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector) int ¶
Get the number of shells to calculate.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::get_num_shells() const –> unsigned long
- get_scorefxn(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector) pyrosetta.rosetta.core.scoring.ScoreFunction ¶
Get the score function to use when generating rotamers.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::get_scorefxn() const –> class std::shared_ptr<class core::scoring::ScoreFunction>
- invert(*args, **kwargs)¶
Overloaded function.
invert(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector) -> None
invert(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, inverted: bool) -> None
Select the residues that 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.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::invert(bool) –> void
- is_inverted(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector) bool ¶
Return whether to selection will be inverted.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::is_inverted() const –> bool
- parse_my_tag(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, tag: pyrosetta.rosetta.utility.tag.Tag, datamap: pyrosetta.rosetta.basic.datacache.DataMap) None ¶
Initialize from a RosettaScripts tag.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::parse_my_tag(class std::shared_ptr<const class utility::tag::Tag>, class basic::datacache::DataMap &) –> void
- provide_citation_info(self: pyrosetta.rosetta.core.select.residue_selector.ResidueSelector, : pyrosetta.rosetta.basic.citation_manager.CitationCollectionList) None ¶
- Provide citations to the passed CitationCollectionList
Subclasses should add the info for themselves and any other classes they use.
The default implementation of this function does nothing. It may be overriden by residue selectors wishing to provide citation information.
C++: core::select::residue_selector::ResidueSelector::provide_citation_info(class basic::citation_manager::CitationCollectionList &) const –> void
- static provide_xml_schema(xsd: utility::tag::XMLSchemaDefinition) None ¶
Define the expected RosettaScripts options.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::provide_xml_schema(class utility::tag::XMLSchemaDefinition &) –> void
- static provide_xml_schema_attributes(attributes: pyrosetta.rosetta.std.list_utility_tag_XMLSchemaAttribute_t) None ¶
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.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::provide_xml_schema_attributes(class std::list<class utility::tag::XMLSchemaAttribute, class std::allocator<class utility::tag::XMLSchemaAttribute> > &) –> void
- selection_positions(self: pyrosetta.rosetta.core.select.residue_selector.ResidueSelector, pose: pyrosetta.rosetta.core.pose.Pose) pyrosetta.rosetta.utility.vector1_unsigned_long ¶
Calls apply and returns the Rosetta numbering corresponding to the selected residues
C++: core::select::residue_selector::ResidueSelector::selection_positions(const class core::pose::Pose &) const –> class utility::vector1<unsigned long, class std::allocator<unsigned long> >
- set_bump_overlap_factor(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, set_bump_overlap_factor: float) None ¶
- 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.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::set_bump_overlap_factor(double) –> void
- set_focus(*args, **kwargs)¶
Overloaded function.
set_focus(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, resnums: str) -> None
- 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.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::set_focus(std::string) –> void
set_focus(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, selector: pyrosetta.rosetta.core.select.residue_selector.ResidueSelector) -> None
- 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.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::set_focus(class std::shared_ptr<const class core::select::residue_selector::ResidueSelector>) –> void
set_focus(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, task_factory: pyrosetta.rosetta.core.pack.task.TaskFactory) -> None
set_focus(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, task_factory: pyrosetta.rosetta.core.pack.task.TaskFactory, focus_on_designable: bool) -> None
- 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 to false.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::set_focus(class std::shared_ptr<const class core::pack::task::TaskFactory>, bool) –> void
set_focus(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, task: pyrosetta.rosetta.core.pack.task.PackerTask) -> None
set_focus(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, task: pyrosetta.rosetta.core.pack.task.PackerTask, focus_on_designable: bool) -> None
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 to false.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::set_focus(class std::shared_ptr<const class core::pack::task::PackerTask>, bool) –> void
set_focus(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, resnums: pyrosetta.rosetta.std.set_unsigned_long_t) -> None
- 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.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::set_focus(class std::set<unsigned long, struct std::less<unsigned long>, class std::allocator<unsigned long> >) –> void
set_focus(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, bool_mask: pyrosetta.rosetta.utility.vector1_bool) -> None
- 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.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::set_focus(class utility::vector1<bool, class std::allocator<bool> >) –> void
- set_include_focus(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, include_focus: bool) None ¶
If true, include the focus residues in the ultimate selection.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::set_include_focus(bool) –> void
- set_num_shells(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, num_shells: int) None ¶
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.
C++: core::pack::task::residue_selector::ClashBasedShellSelector::set_num_shells(unsigned long) –> void
- set_scorefxn(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelector, scorefxn: pyrosetta.rosetta.core.scoring.ScoreFunction) None ¶
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
C++: core::pack::task::residue_selector::ClashBasedShellSelector::set_scorefxn(class std::shared_ptr<class core::scoring::ScoreFunction>) –> void
- class pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelectorCreator¶
Bases:
ResidueSelectorCreator
- assign(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelectorCreator, : pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelectorCreator) pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelectorCreator ¶
C++: core::pack::task::residue_selector::ClashBasedShellSelectorCreator::operator=(const class core::pack::task::residue_selector::ClashBasedShellSelectorCreator &) –> class core::pack::task::residue_selector::ClashBasedShellSelectorCreator &
- create_residue_selector(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelectorCreator) pyrosetta.rosetta.core.select.residue_selector.ResidueSelector ¶
C++: core::pack::task::residue_selector::ClashBasedShellSelectorCreator::create_residue_selector() const –> class std::shared_ptr<class core::select::residue_selector::ResidueSelector>
- keyname(self: pyrosetta.rosetta.core.pack.task.residue_selector.ClashBasedShellSelectorCreator) str ¶
C++: core::pack::task::residue_selector::ClashBasedShellSelectorCreator::keyname() const –> std::string
- pyrosetta.rosetta.core.pack.task.residue_selector.add_clashes_to_shell(*args, **kwargs)¶
Overloaded function.
add_clashes_to_shell(pose: pyrosetta.rosetta.core.pose.Pose, rot1: pyrosetta.rosetta.core.conformation.Residue, focus: pyrosetta.rosetta.std.set_unsigned_long_t, shell: pyrosetta.rosetta.std.set_unsigned_long_t) -> None
- Add any residue that clashes with the given rotamer to the given
shell, unless the given rotamer also clashes with the backbone somewhere.
C++: core::pack::task::residue_selector::add_clashes_to_shell(const class core::pose::Pose &, const class core::conformation::Residue &, const class std::set<unsigned long, struct std::less<unsigned long>, class std::allocator<unsigned long> > &, class std::set<unsigned long, struct std::less<unsigned long>, class std::allocator<unsigned long> > &) –> void
add_clashes_to_shell(pose: pyrosetta.rosetta.core.pose.Pose, rot1: pyrosetta.rosetta.core.conformation.Residue, bump_factor: float, focus: pyrosetta.rosetta.std.set_unsigned_long_t, shell: pyrosetta.rosetta.std.set_unsigned_long_t) -> None
C++: core::pack::task::residue_selector::add_clashes_to_shell(const class core::pose::Pose &, const class core::conformation::Residue &, const double, const class std::set<unsigned long, struct std::less<unsigned long>, class std::allocator<unsigned long> > &, class std::set<unsigned long, struct std::less<unsigned long>, class std::allocator<unsigned long> > &) –> void
- pyrosetta.rosetta.core.pack.task.residue_selector.bool_mask_from_resnums(pose: pyrosetta.rosetta.core.pose.Pose, resis: pyrosetta.rosetta.std.set_unsigned_long_t) pyrosetta.rosetta.utility.vector1_bool ¶
- Return a boolean mask where the indices in the given set are true
and all others are false.
C++: core::pack::task::residue_selector::bool_mask_from_resnums(const class core::pose::Pose &, const class std::set<unsigned long, struct std::less<unsigned long>, class std::allocator<unsigned long> > &) –> class utility::vector1<bool, class std::allocator<bool> >
- pyrosetta.rosetta.core.pack.task.residue_selector.bool_mask_from_task(task: pyrosetta.rosetta.core.pack.task.PackerTask) pyrosetta.rosetta.utility.vector1_bool ¶
- Return a boolean mask where the indices that are not fixed (i.e.
that are packable or designable) in the given PackerTask are true and all others are false.
C++: core::pack::task::residue_selector::bool_mask_from_task(class std::shared_ptr<const class core::pack::task::PackerTask>) –> class utility::vector1<bool, class std::allocator<bool> >
- pyrosetta.rosetta.core.pack.task.residue_selector.find_clashing_shell(*args, **kwargs)¶
Overloaded function.
find_clashing_shell(focus: pyrosetta.rosetta.core.pack.task.PackerTask, pose: pyrosetta.rosetta.core.pose.Pose, scorefxn: pyrosetta.rosetta.core.scoring.ScoreFunction) -> pyrosetta.rosetta.std.set_unsigned_long_t
find_clashing_shell(focus: pyrosetta.rosetta.core.pack.task.PackerTask, pose: pyrosetta.rosetta.core.pose.Pose, scorefxn: pyrosetta.rosetta.core.scoring.ScoreFunction, bump_factor: float) -> pyrosetta.rosetta.std.set_unsigned_long_t
Find a single shell of clashing residues.
C++: core::pack::task::residue_selector::find_clashing_shell(const class std::shared_ptr<const class core::pack::task::PackerTask>, const class core::pose::Pose &, const class core::scoring::ScoreFunction &, const double) –> class std::set<unsigned long, struct std::less<unsigned long>, class std::allocator<unsigned long> >
- pyrosetta.rosetta.core.pack.task.residue_selector.find_clashing_shells(*args, **kwargs)¶
Overloaded function.
find_clashing_shells(focus: pyrosetta.rosetta.core.pack.task.PackerTask, pose: pyrosetta.rosetta.core.pose.Pose, scorefxn: pyrosetta.rosetta.core.scoring.ScoreFunction) -> pyrosetta.rosetta.std.set_unsigned_long_t
find_clashing_shells(focus: pyrosetta.rosetta.core.pack.task.PackerTask, pose: pyrosetta.rosetta.core.pose.Pose, scorefxn: pyrosetta.rosetta.core.scoring.ScoreFunction, num_shells: int) -> pyrosetta.rosetta.std.set_unsigned_long_t
find_clashing_shells(focus: pyrosetta.rosetta.core.pack.task.PackerTask, pose: pyrosetta.rosetta.core.pose.Pose, scorefxn: pyrosetta.rosetta.core.scoring.ScoreFunction, num_shells: int, include_focus: bool) -> pyrosetta.rosetta.std.set_unsigned_long_t
find_clashing_shells(focus: pyrosetta.rosetta.core.pack.task.PackerTask, pose: pyrosetta.rosetta.core.pose.Pose, scorefxn: pyrosetta.rosetta.core.scoring.ScoreFunction, num_shells: int, include_focus: bool, bump_factor: float) -> pyrosetta.rosetta.std.set_unsigned_long_t
- Return the indices of any residues that clash with any of the
rotamers allowed by the given PackerTask.
See ClashBasedShellSelector for more details about how clash-based shell selection works, although most of the logic is implemented in this function.
C++: core::pack::task::residue_selector::find_clashing_shells(const class std::shared_ptr<const class core::pack::task::PackerTask>, const class core::pose::Pose &, const class core::scoring::ScoreFunction &, const unsigned long, const bool, const double) –> class std::set<unsigned long, struct std::less<unsigned long>, class std::allocator<unsigned long> >
- pyrosetta.rosetta.core.pack.task.residue_selector.is_sc_bb_clash(*args, **kwargs)¶
Overloaded function.
is_sc_bb_clash(sc_rsd: pyrosetta.rosetta.core.conformation.Residue, bb_rsd: pyrosetta.rosetta.core.conformation.Residue) -> bool
is_sc_bb_clash(sc_rsd: pyrosetta.rosetta.core.conformation.Residue, bb_rsd: pyrosetta.rosetta.core.conformation.Residue, bump_factor: float) -> bool
- Return true if a sidechain atom in the first residue clashes with a
backbone atom in the second residue.
C++: core::pack::task::residue_selector::is_sc_bb_clash(const class core::conformation::Residue &, const class core::conformation::Residue &, double) –> bool
- pyrosetta.rosetta.core.pack.task.residue_selector.is_sc_sc_clash(*args, **kwargs)¶
Overloaded function.
is_sc_sc_clash(rsd1: pyrosetta.rosetta.core.conformation.Residue, rsd2: pyrosetta.rosetta.core.conformation.Residue) -> bool
is_sc_sc_clash(rsd1: pyrosetta.rosetta.core.conformation.Residue, rsd2: pyrosetta.rosetta.core.conformation.Residue, bump_factor: float) -> bool
- Return true if there is a sidechain clash between the two given
residues.
C++: core::pack::task::residue_selector::is_sc_sc_clash(const class core::conformation::Residue &, const class core::conformation::Residue &, double) –> bool
- pyrosetta.rosetta.core.pack.task.residue_selector.resnums_from_bool_mask(mask: pyrosetta.rosetta.utility.vector1_bool) pyrosetta.rosetta.std.set_unsigned_long_t ¶
- Return a set containing the indices with true values in the given
boolean mask.
C++: core::pack::task::residue_selector::resnums_from_bool_mask(class utility::vector1<bool, class std::allocator<bool> >) –> class std::set<unsigned long, struct std::less<unsigned long>, class std::allocator<unsigned long> >
- pyrosetta.rosetta.core.pack.task.residue_selector.resnums_from_task(task: pyrosetta.rosetta.core.pack.task.PackerTask) pyrosetta.rosetta.std.set_unsigned_long_t ¶
- Return a set containing the positions that are not fixed (i.e. that
are packable or designable) in the given PackerTask.
C++: core::pack::task::residue_selector::resnums_from_task(class std::shared_ptr<const class core::pack::task::PackerTask>) –> class std::set<unsigned long, struct std::less<unsigned long>, class std::allocator<unsigned long> >
- pyrosetta.rosetta.core.pack.task.residue_selector.task_from_bool_mask(pose: pyrosetta.rosetta.core.pose.Pose, mask: pyrosetta.rosetta.utility.vector1_bool) pyrosetta.rosetta.core.pack.task.PackerTask ¶
- Return a PackerTask where the indices that are true in the given
boolean mask are repackable and all others are frozen.
C++: core::pack::task::residue_selector::task_from_bool_mask(const class core::pose::Pose &, class utility::vector1<bool, class std::allocator<bool> >) –> class std::shared_ptr<class core::pack::task::PackerTask>
- pyrosetta.rosetta.core.pack.task.residue_selector.task_from_resnums(pose: pyrosetta.rosetta.core.pose.Pose, resnums: pyrosetta.rosetta.std.set_unsigned_long_t) pyrosetta.rosetta.core.pack.task.PackerTask ¶
- Return a PackerTask where the indices that in the given set are
repackable and all others are frozen.
C++: core::pack::task::residue_selector::task_from_resnums(const class core::pose::Pose &, class std::set<unsigned long, struct std::less<unsigned long>, class std::allocator<unsigned long> >) –> class std::shared_ptr<class core::pack::task::PackerTask>