Rosetta Core  2014.35
Public Member Functions | Private Attributes | List of all members
core::chemical::Patch Class Reference

A class patching basic ResidueType to create variant types, containing multiple PatchCase. More...

#include <Patch.hh>

Public Member Functions

virtual ~Patch ()
 Automatically generated virtual destructor for class deriving directly from ReferenceCount. More...
 
void read_file (std::string const &filename)
 constructor from file More...
 
virtual bool applies_to (ResidueType const &rsd) const
 can I operate on this residue type? More...
 
virtual bool replaces (ResidueType const &rsd) const
 do I replace this residue type? More...
 
virtual ResidueTypeOP apply (ResidueType const &rsd_type) const
 returns patched residue, 0 if patch failed More...
 
virtual std::string const & name () const
 unique name of this patch, eg Nter-simple, Cter-full, Phospho, ... ? More...
 
virtual utility::vector1
< VariantType > const & 
types () const
 the variant types created by applying this patch More...
 

Private Attributes

std::string name_
 private data More...
 
utility::vector1< VariantTypetypes_
 variant types created by the patch More...
 
ResidueSelector selector_
 criteria to select ResidueTypes to which the patch is applied More...
 
utility::vector1< PatchCaseOPcases_
 different cases to which the patch is applied slightly differently, e.g., N-terminus patch to PRO and GLY More...
 
bool replaces_residue_type_
 if set this patch will not change the name of the ResidueType and returns true for replaces() More...
 

Detailed Description

A class patching basic ResidueType to create variant types, containing multiple PatchCase.

Constructor & Destructor Documentation

core::chemical::Patch::~Patch ( )
virtual

Automatically generated virtual destructor for class deriving directly from ReferenceCount.

Auto-generated virtual destructor

Member Function Documentation

virtual bool core::chemical::Patch::applies_to ( ResidueType const &  rsd) const
inlinevirtual

can I operate on this residue type?

References selector_.

Referenced by apply(), core::chemical::ResidueTypeSet::apply_patches(), and replaces().

ResidueTypeOP core::chemical::Patch::apply ( ResidueType const &  rsd_type) const
virtual

returns patched residue, 0 if patch failed

loop through the cases in this patch and if it is applicable to this ResidueType, the corresponding patch operations are applied to create a new variant type of the basic ResidueType. The new types's name and its variant type info are updated together with all other primary and derived ResidueType data.

References applies_to(), cases_, core::chemical::ResidueType::name(), name_, core::chemical::patch_linker, replaces_residue_type_, core::chemical::tr, and types_.

Referenced by core::chemical::ResidueTypeSet::apply_patches().

virtual std::string const& core::chemical::Patch::name ( ) const
inlinevirtual

unique name of this patch, eg Nter-simple, Cter-full, Phospho, ... ?

References name_.

void core::chemical::Patch::read_file ( std::string const &  filename)

constructor from file

  • first read in all lines from the file, discarding # comment lines
  • parse input lines for Patch name and variant types (NAME, TYPES)
  • parse input lines for general ResidueSelector defined for this Patch (BEGIN_SELECTOR, END_SELECTOR)
  • parse input lines to create each case accordingly (BEGIN_CASE, END_CASE)
    Note
    keep the order to avoid triggering parsing errors

References core::chemical::ResidueSelector::add_line(), core::chemical::case_from_lines(), cases_, core::chemical::ResidueSelector::clear(), getline(), l, name_, replaces_residue_type_, selector_, core::scoring::hbonds::t, tag, core::chemical::tag_from_line(), core::chemical::tr, types_, and utility_exit_with_message.

Referenced by core::chemical::ResidueTypeSet::apply_patches().

virtual bool core::chemical::Patch::replaces ( ResidueType const &  rsd) const
inlinevirtual

do I replace this residue type?

References applies_to(), and replaces_residue_type_.

Referenced by core::chemical::ResidueTypeSet::apply_patches().

virtual utility::vector1< VariantType > const& core::chemical::Patch::types ( ) const
inlinevirtual

the variant types created by applying this patch

References types_.

Member Data Documentation

utility::vector1< PatchCaseOP > core::chemical::Patch::cases_
private

different cases to which the patch is applied slightly differently, e.g., N-terminus patch to PRO and GLY

Referenced by apply(), and read_file().

std::string core::chemical::Patch::name_
private

private data

name of the patch

Referenced by apply(), name(), and read_file().

bool core::chemical::Patch::replaces_residue_type_
private

if set this patch will not change the name of the ResidueType and returns true for replaces()

Referenced by apply(), read_file(), and replaces().

ResidueSelector core::chemical::Patch::selector_
private

criteria to select ResidueTypes to which the patch is applied

Referenced by applies_to(), and read_file().

utility::vector1< VariantType > core::chemical::Patch::types_
private

variant types created by the patch

Referenced by apply(), read_file(), and types().


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