Rosetta
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
core::select::residue_selector::ResidueIndexSelector Class Reference

The ResidueIndexSelector returns a ResidueSubset, i.e. a utility::vector1< bool > containing 'true' for residue positions which match the given residue index. The index is read as comma-separated list of either Rosetta indices (e.g. 10) or PDB numbers (e.g. 10A, residue 10 of chain A). It can also take range specifications (e.g. 10A-20A). Detection and mapping from PDB to Rosetta residue numbers is done internally. More...

#include <ResidueIndexSelector.hh>

Inheritance diagram for core::select::residue_selector::ResidueIndexSelector:
Inheritance graph
[legend]

Public Member Functions

 ResidueIndexSelector ()
 
 ResidueIndexSelector (std::string const &index_str)
 
 ResidueIndexSelector (core::Size index_in)
 Convenience constructor for a single residue index. More...
 
 ResidueIndexSelector (utility::vector1< core::Size > const &index_in)
 Convenience constructor for a vector of indexes. More...
 
 ResidueIndexSelector (ResidueIndexSelector const &src)
 Copy constructor. More...
 
ResidueSelectorOP clone () const override
 Clone operator. More...
 
 ~ResidueIndexSelector () override
 
ResidueSubset apply (core::pose::Pose const &pose) const override
 Return a ResidueSubset indicating a selection of Residues from the input Pose; the ResidueSubset is an array of booleans where a value of "true" for position i indicates that residue i is a part of the selected subset – and a value of "false" would indicate that it is not. More...
 
void parse_my_tag (utility::tag::TagCOP tag, basic::datacache::DataMap &) override
 Initialize any data members of this instance from an input tag and a DataMap object. More...
 
std::string get_name () const override
 
void set_index (std::string const &index_str)
 sets the string by which residues are selected More...
 
void set_index (core::Size index)
 Set an index using a size. More...
 
void set_index_range (core::Size start, core::Size end)
 Set a range of indexes. Includes start and end. More...
 
void append_index (core::Size index_in)
 Append an additional index (in Rosetta numbering) to the list of indices. More...
 
void append_index (utility::vector1< core::Size > const &index_in)
 Append additional indexes (in Rosetta numbering) to the list of indices. More...
 
bool error_on_out_of_bounds_index () const
 Is this selector set to throw an error if an out-of-range index is selected (e.g. residue 56 of a 55-residue pose)? More...
 
void set_error_on_out_of_bounds_index (bool const setting)
 Set whether this selector set to throws an error if an out-of-range index is selected (e.g. residue 56 of a 55-residue pose). 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 std::string class_name ()
 
static void provide_xml_schema (utility::tag::XMLSchemaDefinition &xsd)
 

Private Attributes

std::string index_str_
 
bool error_on_out_of_bounds_index_
 If false, then there is no error if an index that is not in the pose is selected. True by default, which means that you get an error if you try to select an index that's not in the pose. More...
 
bool reverse_
 If true, will reverse the index selection from the end of the pose. More...
 

Detailed Description

The ResidueIndexSelector returns a ResidueSubset, i.e. a utility::vector1< bool > containing 'true' for residue positions which match the given residue index. The index is read as comma-separated list of either Rosetta indices (e.g. 10) or PDB numbers (e.g. 10A, residue 10 of chain A). It can also take range specifications (e.g. 10A-20A). Detection and mapping from PDB to Rosetta residue numbers is done internally.

Constructor & Destructor Documentation

◆ ResidueIndexSelector() [1/5]

core::select::residue_selector::ResidueIndexSelector::ResidueIndexSelector ( )

◆ ResidueIndexSelector() [2/5]

core::select::residue_selector::ResidueIndexSelector::ResidueIndexSelector ( std::string const &  index_str)

◆ ResidueIndexSelector() [3/5]

core::select::residue_selector::ResidueIndexSelector::ResidueIndexSelector ( core::Size  index_in)

Convenience constructor for a single residue index.

References append_index().

◆ ResidueIndexSelector() [4/5]

core::select::residue_selector::ResidueIndexSelector::ResidueIndexSelector ( utility::vector1< core::Size > const &  index_in)

Convenience constructor for a vector of indexes.

References append_index().

◆ ResidueIndexSelector() [5/5]

core::select::residue_selector::ResidueIndexSelector::ResidueIndexSelector ( ResidueIndexSelector const &  src)
default

Copy constructor.

◆ ~ResidueIndexSelector()

core::select::residue_selector::ResidueIndexSelector::~ResidueIndexSelector ( )
overridedefault

Member Function Documentation

◆ append_index() [1/2]

void core::select::residue_selector::ResidueIndexSelector::append_index ( core::Size  index_in)

Append an additional index (in Rosetta numbering) to the list of indices.

Author
Vikram K. Mulligan (vmull.nosp@m.ig@u.nosp@m.w.edu)

References index_str_.

Referenced by protocols::fold_from_loops::utils::Nub::get_nub_pieces(), and ResidueIndexSelector().

◆ append_index() [2/2]

void core::select::residue_selector::ResidueIndexSelector::append_index ( utility::vector1< core::Size > const &  index_in)

Append additional indexes (in Rosetta numbering) to the list of indices.

References index_str_.

◆ apply()

ResidueSubset core::select::residue_selector::ResidueIndexSelector::apply ( core::pose::Pose const &  pose) const
overridevirtual

Return a ResidueSubset indicating a selection of Residues from the input Pose; the ResidueSubset is an array of booleans where a value of "true" for position i indicates that residue i is a part of the selected subset – and a value of "false" would indicate that it is not.

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

References error_on_out_of_bounds_index(), core::pose::get_resnum_list(), index_str_, core::pose::symmetry::is_symmetric(), reverse_, core::pose::Pose::size(), core::pose::symmetry::symmetry_info(), and core::select::residue_selector::TR().

◆ class_name()

std::string core::select::residue_selector::ResidueIndexSelector::class_name ( )
static

◆ clone()

ResidueSelectorOP core::select::residue_selector::ResidueIndexSelector::clone ( ) const
overridevirtual

Clone operator.

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

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

◆ error_on_out_of_bounds_index()

bool core::select::residue_selector::ResidueIndexSelector::error_on_out_of_bounds_index ( ) const
inline

Is this selector set to throw an error if an out-of-range index is selected (e.g. residue 56 of a 55-residue pose)?

References error_on_out_of_bounds_index_.

Referenced by apply(), and parse_my_tag().

◆ get_name()

std::string core::select::residue_selector::ResidueIndexSelector::get_name ( ) const
overridevirtual

◆ parse_my_tag()

void core::select::residue_selector::ResidueIndexSelector::parse_my_tag ( utility::tag::TagCOP  tag,
basic::datacache::DataMap datacache 
)
overridevirtual

Initialize any data members of this instance from an input tag and a DataMap object.

Noop implementation in the base class in the case that a derived class has no need to read data from an input tag

Reimplemented from core::select::residue_selector::ResidueSelector.

References error_on_out_of_bounds_index(), reverse_, set_error_on_out_of_bounds_index(), set_index(), and core::select::residue_selector::TR().

◆ provide_xml_schema()

void core::select::residue_selector::ResidueIndexSelector::provide_xml_schema ( utility::tag::XMLSchemaDefinition &  xsd)
static

◆ set_error_on_out_of_bounds_index()

void core::select::residue_selector::ResidueIndexSelector::set_error_on_out_of_bounds_index ( bool const  setting)
inline

Set whether this selector set to throws an error if an out-of-range index is selected (e.g. residue 56 of a 55-residue pose).

References error_on_out_of_bounds_index_.

Referenced by parse_my_tag().

◆ set_index() [1/2]

void core::select::residue_selector::ResidueIndexSelector::set_index ( core::Size  index)

Set an index using a size.

References set_index(), and core::id::to_string().

◆ set_index() [2/2]

void core::select::residue_selector::ResidueIndexSelector::set_index ( std::string const &  index_str)

sets the string by which residues are selected

References index_str_.

Referenced by parse_my_tag(), set_index(), and set_index_range().

◆ set_index_range()

void core::select::residue_selector::ResidueIndexSelector::set_index_range ( core::Size  start,
core::Size  end 
)

Set a range of indexes. Includes start and end.

References core::sequence::end, protocols::sic_dock::range(), set_index(), protocols::loops::start, and core::id::to_string().

Member Data Documentation

◆ error_on_out_of_bounds_index_

bool core::select::residue_selector::ResidueIndexSelector::error_on_out_of_bounds_index_
private

If false, then there is no error if an index that is not in the pose is selected. True by default, which means that you get an error if you try to select an index that's not in the pose.

Referenced by error_on_out_of_bounds_index(), and set_error_on_out_of_bounds_index().

◆ index_str_

std::string core::select::residue_selector::ResidueIndexSelector::index_str_
private

Referenced by append_index(), apply(), and set_index().

◆ reverse_

bool core::select::residue_selector::ResidueIndexSelector::reverse_
private

If true, will reverse the index selection from the end of the pose.

Referenced by apply(), and parse_my_tag().


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