Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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>

Inheritance diagram for core::chemical::Patch:
Inheritance graph
[legend]

Public Member Functions

 Patch ()
 Constructor. More...
 
 Patch (TypeSetMode res_type_set_mode)
 Constructor with ResidueTypeSet mode. More...
 
 ~Patch () override
 Automatically generated virtual destructor for class deriving directly from VirtualBase. More...
 
void read_file (std::string const &filename)
 constructor from file More...
 
virtual bool applies_to (ResidueTypeBase const &rsd) const
 can I operate on this residue type? More...
 
virtual bool replaces (ResidueTypeBase const &rsd) const
 do I replace this residue type? More...
 
virtual MutableResidueTypeOP apply (ResidueType const &rsd_type, bool const instantiate=true) const
 returns patched residue, 0 if patch failed More...
 
virtual MutableResidueTypeOP apply (MutableResidueType const &rsd_type, bool const instantiate=true) 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...
 
std::string patched_name (ResidueTypeBase const &rsd) const
 Returns the name of the residueType after applying the patch (Theoretical - doesn't actually check if the patch would be applied.) More...
 
void set_selector (ResidueTypeSelector const &selector)
 
void set_name (std::string const &name)
 
virtual utility::vector1
< core::chemical::VariantType >
const & 
types () const
 The variant types created by applying this patch. More...
 
virtual utility::vector1
< std::string > const & 
custom_types () const
 The custom variant types added by this patch. More...
 
void types (utility::vector1< core::chemical::VariantType > const &types)
 Set the variant types created by applying this patch. More...
 
virtual void add_type (core::chemical::VariantType const type)
 Add a VariantType to the list that this patch applies. More...
 
virtual void add_custom_type (std::string const &custom_type)
 Add a custom VariantType to the list that this patch applies. More...
 
void replaces_residue_type (bool replaces)
 
utility::vector1< std::string > adds_atoms (ResidueType const &rsd_in) const
 returns list of added atom names, useful for identifying patches that go with PDB residues More...
 
utility::vector1< std::string > deletes_atoms (ResidueType const &rsd_in) const
 returns list of deleted atom names, useful for identifying patches that go with PDB residues More...
 
utility::vector1< std::string > adds_properties (ResidueType const &rsd_in) const
 returns list of added property names, useful for identifying patches that go with PDB residues More...
 
utility::vector1< ResiduePropertyadds_properties_enums (ResidueType const &rsd_in) const
 Returns list of added properties, by enum. Useful for identifying patches that go with PDB residues. More...
 
utility::vector1< std::string > deletes_properties (ResidueType const &rsd_in) const
 returns list of deleted property names, useful for identifying patches that go with PDB residues More...
 
utility::vector1< ResiduePropertydeletes_properties_enums (ResidueType const &rsd_in) const
 returns list of deleted property enums, useful for identifying patches that go with PDB residues. More...
 
utility::vector1< std::string > deletes_variants (ResidueType const &rsd_in) const
 returns list of deleted variant names, useful for identifying patches that go with PDB residues More...
 
utility::vector1
< core::chemical::VariantType
deletes_variants_by_enum (ResidueType const &rsd_type) const
 Returns list of deleted VariantTypes. Doesn't support on-the-fly VariantTypes. More...
 
bool changes_connections_on (ResidueType const &rsd_in, std::string const &atom) const
 Does the patch potentially change the connections for the given atom on the ResidueType. More...
 
void add_case (PatchCaseOP pcase)
 
std::string generates_new_name3 (ResidueType const &rsd_in) const
 returns new name3, if changed. Only one new name3 allowed. More...
 
std::string generates_interchangeability_group (ResidueType const &rsd_in) const
 returns new interchangeability_group, if changed. Only one new interchangeability_group allowed. More...
 
chemical::AA generates_aa (ResidueType const &rsd_in) const
 returns new AA, if changed. More...
 
bool is_metapatch () const
 Is this a metapatch? More...
 

Private Attributes

TypeSetMode res_type_set_mode_ = core::chemical::FULL_ATOM_t
 private data More...
 
std::string name_ = ""
 name of the patch More...
 
bool is_metapatch_ = false
 Is this a metapatch? More...
 
utility::vector1
< core::chemical::VariantType
types_
 Variant types created by the patch. More...
 
utility::vector1< std::string > custom_types_
 Custom variant types created by this patch. More...
 
ResidueTypeSelector 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_ = false
 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 ( )
default

Constructor.

core::chemical::Patch::Patch ( TypeSetMode  res_type_set_mode)

Constructor with ResidueTypeSet mode.

Constructor with ResidueTypeSet name.

core::chemical::Patch::~Patch ( )
overridedefault

Automatically generated virtual destructor for class deriving directly from VirtualBase.

Auto-generated virtual destructor

Member Function Documentation

void core::chemical::Patch::add_case ( PatchCaseOP  pcase)
inline

References cases_.

void core::chemical::Patch::add_custom_type ( std::string const &  custom_type)
virtual

Add a custom VariantType to the list that this patch applies.

Author
Vikram K. Mulligan (vmull.nosp@m.ig@u.nosp@m.w.edu).
Vikram K. Mulligan (vmull.nosp@m.ig@u.nosp@m.w.edu).
Andy Watkins (amw57.nosp@m.9@st.nosp@m.anfor.nosp@m.d.ed.nosp@m.u)

References custom_types_.

void core::chemical::Patch::add_type ( core::chemical::VariantType const  type)
virtual

Add a VariantType to the list that this patch applies.

Author
Vikram K. Mulligan (vmull.nosp@m.ig@u.nosp@m.w.edu).
Vikram K. Mulligan (vmull.nosp@m.ig@u.nosp@m.w.edu).
Andy Watkins (amw57.nosp@m.9@st.nosp@m.anfor.nosp@m.d.ed.nosp@m.u)

References types_.

utility::vector1< std::string > core::chemical::Patch::adds_atoms ( ResidueType const &  rsd_type) const

returns list of added atom names, useful for identifying patches that go with PDB residues

loop through the cases in this patch and if it is applicable to this ResidueType, compile a list of any atom_names that are added.

References applies_to(), and cases_.

utility::vector1< std::string > core::chemical::Patch::adds_properties ( ResidueType const &  rsd_type) const

returns list of added property names, useful for identifying patches that go with PDB residues

loop through the cases in this patch and if it is applicable to this ResidueType, compile a list of any properties that are added.

References applies_to(), cases_, and update_ResidueType_enum_files::properties.

utility::vector1< ResidueProperty > core::chemical::Patch::adds_properties_enums ( ResidueType const &  rsd_type) const

Returns list of added properties, by enum. Useful for identifying patches that go with PDB residues.

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

loop through the cases in this patch and if it is applicable to this ResidueType, compile a list of any properties that are added, by enum. Faster than string version.

References applies_to(), cases_, and update_ResidueType_enum_files::properties.

virtual bool core::chemical::Patch::applies_to ( ResidueTypeBase const &  rsd) const
inlinevirtual
MutableResidueTypeOP core::chemical::Patch::apply ( ResidueType const &  rsd_type,
bool const  instantiate = true 
) const
virtual

returns patched residue, 0 if patch failed

Referenced by generates_aa().

MutableResidueTypeOP core::chemical::Patch::apply ( MutableResidueType const &  rsd_type,
bool const  instantiate = true 
) 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. Finally, call finalize() to update all primary and derived data for the new ResidueType.

References applies_to(), cases_, custom_types_, name(), core::chemical::ResidueTypeBase::name(), name_, patched_name(), replaces_residue_type_, core::chemical::tr(), and types_.

bool core::chemical::Patch::changes_connections_on ( ResidueType const &  rsd_in,
std::string const &  atom 
) const

Does the patch potentially change the connections for the given atom on the ResidueType.

References applies_to(), and cases_.

virtual utility::vector1< std::string > const& core::chemical::Patch::custom_types ( ) const
inlinevirtual

The custom variant types added by this patch.

This must be a vector of strings, since the custom types are generated at runtime and can't be enumerated at compile time.

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

References custom_types_.

utility::vector1< std::string > core::chemical::Patch::deletes_atoms ( ResidueType const &  rsd_type) const

returns list of deleted atom names, useful for identifying patches that go with PDB residues

loop through the cases in this patch and if it is applicable to this ResidueType, compile a list of any atom_names that are deleted.

References applies_to(), and cases_.

utility::vector1< std::string > core::chemical::Patch::deletes_properties ( ResidueType const &  rsd_type) const

returns list of deleted property names, useful for identifying patches that go with PDB residues

loop through the cases in this patch and if it is applicable to this ResidueType, compile a list of any properties that are deleted.

References applies_to(), cases_, and update_ResidueType_enum_files::properties.

utility::vector1< ResidueProperty > core::chemical::Patch::deletes_properties_enums ( ResidueType const &  rsd_type) const

returns list of deleted property enums, useful for identifying patches that go with PDB residues.

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

loop through the cases in this patch and if it is applicable to this ResidueType, compile a list of any properties that are deleted, by enum. Faster than string version.

References applies_to(), cases_, and update_ResidueType_enum_files::properties.

utility::vector1< std::string > core::chemical::Patch::deletes_variants ( ResidueType const &  rsd_type) const

returns list of deleted variant names, useful for identifying patches that go with PDB residues

loop through the cases in this patch and if it is applicable to this ResidueType, compile a list of any variants that are deleted.

References applies_to(), cases_, and update_ResidueType_enum_files::variants.

utility::vector1< core::chemical::VariantType > core::chemical::Patch::deletes_variants_by_enum ( ResidueType const &  rsd_type) const

Returns list of deleted VariantTypes. Doesn't support on-the-fly VariantTypes.

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

loop through the cases in this patch and if it is applicable to this ResidueType, compile a list of any variants that are deleted. This version returns a list of VariantType enums (and does not support on-the-fly types).

References applies_to(), cases_, and update_ResidueType_enum_files::variants.

chemical::AA core::chemical::Patch::generates_aa ( ResidueType const &  rsd_type) const

returns new AA, if changed.

loop through the cases in this patch and if it is applicable to this ResidueType, discover if there is a new name3 generated by the patch.

References protocols::cluster::calibur::aa, core::chemical::ResidueTypeBase::aa(), core::chemical::aa_none, applies_to(), apply(), and cases_.

std::string core::chemical::Patch::generates_interchangeability_group ( ResidueType const &  rsd_type) const

returns new interchangeability_group, if changed. Only one new interchangeability_group allowed.

loop through the cases in this patch and if it is applicable to this ResidueType, discover if there is a new interchangeability_group generated by the patch.

References applies_to(), and cases_.

std::string core::chemical::Patch::generates_new_name3 ( ResidueType const &  rsd_type) const

returns new name3, if changed. Only one new name3 allowed.

loop through the cases in this patch and if it is applicable to this ResidueType, discover if there is a new name3 generated by the patch.

References applies_to(), and cases_.

bool core::chemical::Patch::is_metapatch ( ) const
inline

Is this a metapatch?

References is_metapatch_.

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

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

References name_.

Referenced by apply(), and set_name().

std::string core::chemical::Patch::patched_name ( ResidueTypeBase const &  rsd) const

Returns the name of the residueType after applying the patch (Theoretical - doesn't actually check if the patch would be applied.)

References core::chemical::ResidueTypeBase::base_name(), core::chemical::ResidueTypeBase::name(), name_, and core::chemical::PATCH_LINKER.

Referenced by apply().

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 to create each case accordingly (BEGIN_CASE, END_CASE)
    Note
    keep the order to avoid triggering parsing errors

References core::chemical::ResidueTypeSelector::add_line(), core::chemical::case_from_lines(), cases_, core::chemical::ResidueTypeSelector::clear(), custom_types_, core::chemical::ResidueProperties::get_variant_from_string(), is_metapatch_, name_, replaces_residue_type_, res_type_set_mode_, selector_, protocols::hybridization::t, core::chemical::tag_from_line(), core::chemical::tr(), and types_.

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

do I replace this residue type?

References applies_to(), and replaces_residue_type_.

Referenced by replaces_residue_type().

void core::chemical::Patch::replaces_residue_type ( bool  replaces)
inline
void core::chemical::Patch::set_name ( std::string const &  name)
inline

References is_metapatch_, name(), and name_.

void core::chemical::Patch::set_selector ( ResidueTypeSelector const &  selector)
inline

References selector_.

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

The variant types created by applying this patch.

Use custom_types() for a vector of strings of custom types.

References types_.

Referenced by types().

void core::chemical::Patch::types ( utility::vector1< core::chemical::VariantType > const &  types)
inline

Set the variant types created by applying this patch.

For custom variant types, use the add_custom_type() function, which takes a string.

References types(), and types_.

Member Data Documentation

utility::vector1< PatchCaseOP > core::chemical::Patch::cases_
private
utility::vector1< std::string > core::chemical::Patch::custom_types_
private

Custom variant types created by this patch.

Referenced by add_custom_type(), apply(), custom_types(), and read_file().

bool core::chemical::Patch::is_metapatch_ = false
private

Is this a metapatch?

Referenced by is_metapatch(), read_file(), and set_name().

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

name of the patch

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

bool core::chemical::Patch::replaces_residue_type_ = false
private

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

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

TypeSetMode core::chemical::Patch::res_type_set_mode_ = core::chemical::FULL_ATOM_t
private

private data

mode of the residuetypeset to which this patch belongs

Referenced by read_file().

ResidueTypeSelector core::chemical::Patch::selector_
private

criteria to select ResidueTypes to which the patch is applied

Referenced by applies_to(), read_file(), and set_selector().

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

Variant types created by the patch.

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


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