Rosetta
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
core::scoring::constraints::AngleConstraint Class Reference

An Angular Constraint. More...

#include <AngleConstraint.hh>

Inheritance diagram for core::scoring::constraints::AngleConstraint:
Inheritance graph
[legend]

Public Member Functions

 AngleConstraint (AtomID const &a1, AtomID const &a2, AtomID const &a3, core::scoring::func::FuncOP func_in, ScoreType scotype=angle_constraint)
 Constructor. More...
 
 AngleConstraint (core::scoring::func::FuncOP func_in, ScoreType scoretype=angle_constraint)
 Constructor without atom IDs – if you create an AngleConstraint with this constructor, you must never call its score( XYZFunc ) method! Dangerous and stupid! More...
 
std::string type () const override
 Returns a unique string identified for this constraint. Used in several places, including the ConstraintIO class. More...
 
ConstraintOP clone () const override
 Copies the data from this Constraint into a new object and returns an OP to the new object. Intended to be implemented by derived classes and used by pose.add_constraint. This function must return a deep copy of itself – meaning that if this Constraint holds pointers to other Constraints that it must invoke clone on those Constraints as well. If the Constraint holds a FuncOP, then the Func should also be cloned. More...
 
bool operator== (Constraint const &other) const override
 possibility to compare constraint according to data and not just pointers More...
 
bool same_type_as_me (Constraint const &other) const override
 Determine if the calling class has the same type as the input class, using dynamic casts. This is important in ensuring that two constraints are equal: both this and other must check that the other is the same as it. This is not an optional method and every class should implement it, regaurdless of whether a parent class implements it. More...
 
void read_def (std::istream &data, pose::Pose const &pose, core::scoring::func::FuncFactory const &func_factory) override
 read in constraint defiinition More...
 
ConstraintOP remapped_clone (pose::Pose const &src, pose::Pose const &dest, id::SequenceMappingCOP map=nullptr) const override
 Copies the data from this Constraint into a new object and returns an OP atoms are mapped to atoms with the same name in dest pose ( e.g. for switch from centroid to fullatom ) if a sequence_mapping is present it is used to map residue numbers .. nullptr = identity mapping to the new object. Intended to be implemented by derived classes. More...
 
Real score (Vector const &xyz1, Vector const &xyz2, Vector const &xyz3) const
 compute score More...
 
void score (core::scoring::func::XYZ_Func const &xyz, EnergyMap const &, EnergyMap &emap) const override
 compute score More...
 
virtual core::Real score (conformation::Conformation const &) const
 
Real angle (Vector const &xyz1, Vector const &xyz2, Vector const &xyz3) const
 compute More...
 
core::Real dist (core::scoring::func::XYZ_Func const &xyz) const override
 return the raw "distance" before that distance is handed to the FUNC object More...
 
void setup_for_scoring (func::XYZ_Func const &, ScoreFunction const &) const override
 
void fill_f1_f2 (AtomID const &atom, core::scoring::func::XYZ_Func const &xyz, Vector &F1, Vector &F2, EnergyMap const &weights) const override
 compute atom deriv More...
 
Size natoms () const override
 number of atoms — always 3 for angles More...
 
ConstraintOP remap_resid (core::id::SequenceMapping const &seqmap) const override
 apply a resid remapping to this constraint, returns the remapped constraint Does this return an owning pointer to this constraint or a copy? Documentation would be nice. More...
 
AtomID const & atom (Size const n) const override
 return AtomID for atom 1,2,3 More...
 
Size show_violations (std::ostream &out, pose::Pose const &pose, Size verbose_level, core::Real threshold=1) const override
 output violation of constraint to out - returns 1 if violated ( i.e., func.show_violations() > 0 ) More...
 
void show (std::ostream &out) const override
 This method is intended to show the value of the Constraint function evaluated over some reasonable range of values. For example, a constraint between pairs of atoms might show the values of the Constraint function between 4 and 12 angstroms. More...
 
void show_def (std::ostream &out, pose::Pose const &pose) const override
 Prints the definition of a Constraint to the given std::ostream, using the given Pose, and the given func::FuncFactory. This method is intended to be overridden by derived classes if they'd like to use the ConstraintIO machinery. It's also not clear why this method takes a Pose, other than to be symmetric with read_def. More...
 
core::scoring::func::Func const & get_func () const override
 Returns the func::Func object associated with this Constraint object. More...
 
Real func (Real const theta) const
 evaluate func at theta More...
 
Real dfunc (Real const theta) const
 evaluate dfunc at theta More...
 
void p1_deriv (Vector const &p1, Vector const &p2, Vector const &p3, Vector &F1, Vector &F2) const
 
void p2_deriv (Vector const &p1, Vector const &p2, Vector const &p3, Vector &F1, Vector &F2) const
 
AtomID const & atom1 () const
 
AtomID const & atom2 () const
 
AtomID const & atom3 () const
 
virtual void score (core::scoring::func::XYZ_Func const &xyz_func, EnergyMap const &weights, EnergyMap &emap) const=0
 Calculates a score for this constraint using XYZ_Func, and puts the UNWEIGHTED score into emap. Although the current set of weights currently is provided, Constraint objects should put unweighted scores into emap because the ScoreFunction will do the weighting itself. More...
 
virtual Real score (pose::Pose const &pose) const
 Returns the unweighted score of this constraint computed over the given pose. More...
 
virtual Real score (pose::Pose const &pose, EnergyMap const &weights) const
 Returns the weighted score of this constraint computed over the given pose. More...
 
virtual core::Real dist (core::scoring::func::XYZ_Func const &) const=0
 return the raw "distance" before that distance is handed to the FUNC object More...
 
virtual Real dist (core::pose::Pose const &) const
 return the raw "distance" before that distance is handed to the FUNC object More...
 
- Public Member Functions inherited from core::scoring::constraints::Constraint
 Constraint (ScoreType const &t)
 Constructor for Constraint class. More...
 
 ~Constraint () override
 Virtual destructor. More...
 
virtual ConstraintOP clone (func::FuncOP) const
 Clone the constraint, but where a new Func object is to be used instead. More...
 
virtual utility::vector1< core::Sizeresidues () const
 Returns the pose numbers of the residues involved in this constraint, in no particular order. More...
 
virtual void read_constraint (std::istream &, core::pose::Pose const &)
 This method is totally redundant with read_def YAY DON'T USE THIS ONE.. Most Constraint classes have not overloaded this one, but read_def ! OL. More...
 
ScoreType const & score_type () const
 Returns the ScoreType that this Constraint object will use. More...
 
virtual void read_data (std::istream &)
 initialize this Constraint from the given std::istream. It's amazing that there are three functions for doing this inside of Constraint.hh. SO WHAT IS THIS SUPPOSED TO DO ? not overloaded by e.g., AtomPairConstraint or CoordinateConstraint, More...
 
virtual Real score (pose::Pose const &pose) const
 Returns the unweighted score of this constraint computed over the given pose. More...
 
virtual Real score (pose::Pose const &pose, EnergyMap const &weights) const
 Returns the weighted score of this constraint computed over the given pose. More...
 
virtual Real dist (core::pose::Pose const &) const
 return the raw "distance" before that distance is handed to the FUNC object More...
 
virtual void setup_for_derivatives (core::scoring::func::XYZ_Func const &, ScoreFunction const &) const
 
virtual void steal_def (pose::Pose const &)
 take coordinates, distances, angles, etc from given pose More...
 
std::string to_string () const
 Convenience function, returns the results of show() as a string. Not to be overriden by derived classes. More...
 
bool operator!= (Constraint const &other) const
 Inequality operator to test whether two constraints are not functionally identical. More...
 
virtual core::Size choose_effective_sequence_separation (core::kinematics::ShortestPathInFoldTree const &sp, numeric::random::RandomGenerator &)
 
virtual core::Size effective_sequence_separation (core::kinematics::ShortestPathInFoldTree const &) const
 

Static Public Member Functions

static void p1_theta_deriv (Vector const &p1, Vector const &p2, Vector const &p3, Vector &f1, Vector &f2)
 
static void helper (Vector const &M, Vector const &w, Vector &F1, Vector &F2)
 

Protected Member Functions

 AngleConstraint (AngleConstraint const &src)
 Explicit copy constructor so that derived classes will recieve a deep copy of the Func this class contains. More...
 
func::FuncCOP func () const
 const access to func More...
 
void set_func (func::FuncOP f)
 set func More...
 
void atom1 (AtomID newid) const
 
void atom2 (AtomID newid) const
 
void atom3 (AtomID newid) const
 

Private Attributes

AtomID atom1_
 
AtomID atom2_
 
AtomID atom3_
 
core::scoring::func::FuncOP func_
 

Additional Inherited Members

- Public Types inherited from core::scoring::constraints::Constraint
typedef id::AtomID AtomID
 

Detailed Description

An Angular Constraint.

Constructor & Destructor Documentation

◆ AngleConstraint() [1/3]

core::scoring::constraints::AngleConstraint::AngleConstraint ( AtomID const &  a1,
AtomID const &  a2,
AtomID const &  a3,
core::scoring::func::FuncOP  func_in,
ScoreType  scotype = angle_constraint 
)

Constructor.

Referenced by clone().

◆ AngleConstraint() [2/3]

core::scoring::constraints::AngleConstraint::AngleConstraint ( core::scoring::func::FuncOP  func_in,
ScoreType  scoretype = angle_constraint 
)

Constructor without atom IDs – if you create an AngleConstraint with this constructor, you must never call its score( XYZFunc ) method! Dangerous and stupid!

◆ AngleConstraint() [3/3]

core::scoring::constraints::AngleConstraint::AngleConstraint ( AngleConstraint const &  src)
protected

Explicit copy constructor so that derived classes will recieve a deep copy of the Func this class contains.

Member Function Documentation

◆ angle()

Real core::scoring::constraints::AngleConstraint::angle ( Vector const &  xyz1,
Vector const &  xyz2,
Vector const &  xyz3 
) const

◆ atom()

id::AtomID const & core::scoring::constraints::AngleConstraint::atom ( Size const  n) const
overridevirtual

return AtomID for atom 1,2,3

Implements core::scoring::constraints::Constraint.

References atom1_, atom2_, and atom3_.

Referenced by fill_f1_f2(), remapped_clone(), show(), and show_def().

◆ atom1() [1/2]

AtomID const& core::scoring::constraints::AngleConstraint::atom1 ( ) const
inline

◆ atom1() [2/2]

void core::scoring::constraints::AngleConstraint::atom1 ( AtomID  newid) const
protected

References atom1_.

◆ atom2() [1/2]

AtomID const& core::scoring::constraints::AngleConstraint::atom2 ( ) const
inline

◆ atom2() [2/2]

void core::scoring::constraints::AngleConstraint::atom2 ( AtomID  newid) const
protected

References atom2_.

◆ atom3() [1/2]

AtomID const& core::scoring::constraints::AngleConstraint::atom3 ( ) const
inline

◆ atom3() [2/2]

void core::scoring::constraints::AngleConstraint::atom3 ( AtomID  newid) const
protected

References atom3_.

◆ clone()

ConstraintOP core::scoring::constraints::AngleConstraint::clone ( ) const
overridevirtual

Copies the data from this Constraint into a new object and returns an OP to the new object. Intended to be implemented by derived classes and used by pose.add_constraint. This function must return a deep copy of itself – meaning that if this Constraint holds pointers to other Constraints that it must invoke clone on those Constraints as well. If the Constraint holds a FuncOP, then the Func should also be cloned.

Implements core::scoring::constraints::Constraint.

Reimplemented in core::scoring::constraints::NamedAngleConstraint.

References AngleConstraint().

◆ dfunc()

Real core::scoring::constraints::AngleConstraint::dfunc ( Real const  theta) const

evaluate dfunc at theta

References func_.

Referenced by fill_f1_f2(), p1_deriv(), and p2_deriv().

◆ dist() [1/3]

Real core::scoring::constraints::Constraint::dist

return the raw "distance" before that distance is handed to the FUNC object

  • If such a distance doesn't make sense for this constraint, just return 0

◆ dist() [2/3]

virtual core::Real core::scoring::constraints::Constraint::dist

return the raw "distance" before that distance is handed to the FUNC object

  • If such a distance doesn't make sense for this constraint, just return 0

◆ dist() [3/3]

core::Real core::scoring::constraints::AngleConstraint::dist ( core::scoring::func::XYZ_Func const &  ) const
overridevirtual

return the raw "distance" before that distance is handed to the FUNC object

  • If such a distance doesn't make sense for this constraint, just return 0

Implements core::scoring::constraints::Constraint.

Reimplemented in core::scoring::constraints::NamedAngleConstraint.

References angle(), atom1_, atom2_, atom3_, and protocols::kinmatch::xyz().

◆ fill_f1_f2()

void core::scoring::constraints::AngleConstraint::fill_f1_f2 ( AtomID const &  atom,
core::scoring::func::XYZ_Func const &  xyz,
Vector F1,
Vector F2,
EnergyMap const &  weights 
) const
overridevirtual

◆ func() [1/2]

func::FuncCOP core::scoring::constraints::AngleConstraint::func ( ) const
protected

◆ func() [2/2]

Real core::scoring::constraints::AngleConstraint::func ( Real const  theta) const

evaluate func at theta

Previously private member functions made public so that in the absence of atom_ids, these functions could still be called externally.

References func_.

◆ get_func()

core::scoring::func::Func const& core::scoring::constraints::AngleConstraint::get_func ( ) const
inlineoverridevirtual

Returns the func::Func object associated with this Constraint object.

Reimplemented from core::scoring::constraints::Constraint.

References func_.

◆ helper()

void core::scoring::constraints::AngleConstraint::helper ( Vector const &  M,
Vector const &  w,
Vector F1,
Vector F2 
)
static

Referenced by p1_theta_deriv().

◆ natoms()

Size core::scoring::constraints::AngleConstraint::natoms ( ) const
inlineoverridevirtual

number of atoms — always 3 for angles

Implements core::scoring::constraints::Constraint.

Referenced by show(), and show_def().

◆ operator==()

bool core::scoring::constraints::AngleConstraint::operator== ( Constraint const &  other) const
overridevirtual

◆ p1_deriv()

void core::scoring::constraints::AngleConstraint::p1_deriv ( Vector const &  p1,
Vector const &  p2,
Vector const &  p3,
Vector F1,
Vector F2 
) const

◆ p1_theta_deriv()

void core::scoring::constraints::AngleConstraint::p1_theta_deriv ( Vector const &  p1,
Vector const &  p2,
Vector const &  p3,
Vector f1,
Vector f2 
)
static

◆ p2_deriv()

void core::scoring::constraints::AngleConstraint::p2_deriv ( Vector const &  p1,
Vector const &  p2,
Vector const &  p3,
Vector F1,
Vector F2 
) const

◆ read_def()

void core::scoring::constraints::AngleConstraint::read_def ( std::istream &  data,
pose::Pose const &  pose,
core::scoring::func::FuncFactory const &  func_factory 
)
overridevirtual

read in constraint defiinition

one line definition "Angle atom1 res1 atom2 res2 atom3 res3 function_type function_definition" SML: It appears to be reading the angle in radians, because score ultimately uses std:acos, which returns radians.

Reimplemented from core::scoring::constraints::Constraint.

Reimplemented in core::scoring::constraints::NamedAngleConstraint.

References atom1_, atom2_, atom3_, core::conformation::Residue::atom_index(), core::id::AtomID::atomno(), func_, core::scoring::func::FuncFactory::new_func(), core::scoring::constraints::ConstraintIO::parse_residue(), core::pose::Pose::residue(), core::pose::Pose::size(), and core::scoring::constraints::TR().

◆ remap_resid()

ConstraintOP core::scoring::constraints::AngleConstraint::remap_resid ( core::id::SequenceMapping const &  ) const
overridevirtual

apply a resid remapping to this constraint, returns the remapped constraint Does this return an owning pointer to this constraint or a copy? Documentation would be nice.

Reimplemented from core::scoring::constraints::Constraint.

Reimplemented in core::scoring::constraints::NamedAngleConstraint.

References atom1_, atom2_, atom3_, core::id::AtomID::atomno(), func_, and core::id::AtomID::rsd().

◆ remapped_clone()

ConstraintOP core::scoring::constraints::AngleConstraint::remapped_clone ( pose::Pose const &  src,
pose::Pose const &  dest,
id::SequenceMappingCOP  map = nullptr 
) const
overridevirtual

Copies the data from this Constraint into a new object and returns an OP atoms are mapped to atoms with the same name in dest pose ( e.g. for switch from centroid to fullatom ) if a sequence_mapping is present it is used to map residue numbers .. nullptr = identity mapping to the new object. Intended to be implemented by derived classes.

Copies the data from this Constraint into a new object and returns an OP atoms are mapped to atoms with the same name in dest pose ( e.g. for switch from centroid to fullatom ) if a sequence_mapping is present it is used to map residue numbers .. NULL = identity mapping to the new object. Intended to be implemented by derived classes.

Reimplemented from core::scoring::constraints::Constraint.

Reimplemented in core::scoring::constraints::NamedAngleConstraint.

References atom(), atom1(), atom1_, atom2(), atom2_, atom3(), atom3_, core::conformation::atom_id_to_named_atom_id(), func_, core::conformation::named_atom_id_to_atom_id(), core::id::AtomID::rsd(), core::scoring::constraints::Constraint::score_type(), and core::id::AtomID::valid().

◆ same_type_as_me()

bool core::scoring::constraints::AngleConstraint::same_type_as_me ( Constraint const &  other) const
overridevirtual

Determine if the calling class has the same type as the input class, using dynamic casts. This is important in ensuring that two constraints are equal: both this and other must check that the other is the same as it. This is not an optional method and every class should implement it, regaurdless of whether a parent class implements it.

Implements core::scoring::constraints::Constraint.

Reimplemented in core::scoring::constraints::NamedAngleConstraint.

Referenced by operator==().

◆ score() [1/6]

core::Real core::scoring::constraints::AngleConstraint::score ( conformation::Conformation const &  conf) const
virtual

◆ score() [2/6]

void core::scoring::constraints::AngleConstraint::score ( core::scoring::func::XYZ_Func const &  xyz,
EnergyMap const &  ,
EnergyMap emap 
) const
overridevirtual

◆ score() [3/6]

virtual void core::scoring::constraints::Constraint::score

Calculates a score for this constraint using XYZ_Func, and puts the UNWEIGHTED score into emap. Although the current set of weights currently is provided, Constraint objects should put unweighted scores into emap because the ScoreFunction will do the weighting itself.

Referenced by score(), and core::scoring::constraints::NamedAngleConstraint::score().

◆ score() [4/6]

Real core::scoring::constraints::Constraint::score

Returns the unweighted score of this constraint computed over the given pose.

◆ score() [5/6]

Real core::scoring::constraints::Constraint::score

Returns the weighted score of this constraint computed over the given pose.

◆ score() [6/6]

Real core::scoring::constraints::AngleConstraint::score ( Vector const &  xyz1,
Vector const &  xyz2,
Vector const &  xyz3 
) const

compute score

References angle(), and func().

◆ set_func()

void core::scoring::constraints::AngleConstraint::set_func ( func::FuncOP  f)
protected

◆ setup_for_scoring()

void core::scoring::constraints::AngleConstraint::setup_for_scoring ( func::XYZ_Func const &  ,
ScoreFunction const &   
) const
overridevirtual

◆ show()

void core::scoring::constraints::AngleConstraint::show ( std::ostream &  ) const
overridevirtual

This method is intended to show the value of the Constraint function evaluated over some reasonable range of values. For example, a constraint between pairs of atoms might show the values of the Constraint function between 4 and 12 angstroms.

Reimplemented from core::scoring::constraints::Constraint.

References atom(), func_, natoms(), core::conformation::membrane::out, and type().

◆ show_def()

void core::scoring::constraints::AngleConstraint::show_def ( std::ostream &  ,
pose::Pose const &   
) const
overridevirtual

Prints the definition of a Constraint to the given std::ostream, using the given Pose, and the given func::FuncFactory. This method is intended to be overridden by derived classes if they'd like to use the ConstraintIO machinery. It's also not clear why this method takes a Pose, other than to be symmetric with read_def.

Reimplemented from core::scoring::constraints::Constraint.

Reimplemented in core::scoring::constraints::NamedAngleConstraint.

References atom(), core::conformation::atom_id_to_named_atom_id(), func_, natoms(), core::conformation::membrane::out, and type().

◆ show_violations()

Size core::scoring::constraints::AngleConstraint::show_violations ( std::ostream &  out,
pose::Pose const &  pose,
Size  verbose_level,
core::Real  threshold = 1 
) const
overridevirtual

output violation of constraint to out - returns 1 if violated ( i.e., func.show_violations() > 0 )

show violations of angular constraint. Control verbosity level between 1 .. 100 >80 : write MET 4 CA otherwise: compute angle and call func_->show_violations

Reimplemented from core::scoring::constraints::Constraint.

References atom1_, atom2_, atom3_, core::chemical::ResidueType::atom_name(), core::id::AtomID::atomno(), core::pose::Pose::conformation(), func_, core::conformation::membrane::out, core::pose::Pose::residue_type(), core::id::AtomID::rsd(), and core::conformation::Conformation::xyz().

◆ type()

std::string core::scoring::constraints::AngleConstraint::type ( ) const
overridevirtual

Returns a unique string identified for this constraint. Used in several places, including the ConstraintIO class.

Reimplemented from core::scoring::constraints::Constraint.

Reimplemented in core::scoring::constraints::NamedAngleConstraint.

Referenced by show(), and show_def().

Member Data Documentation

◆ atom1_

AtomID core::scoring::constraints::AngleConstraint::atom1_
mutableprivate

◆ atom2_

AtomID core::scoring::constraints::AngleConstraint::atom2_
private

◆ atom3_

AtomID core::scoring::constraints::AngleConstraint::atom3_
private

◆ func_

core::scoring::func::FuncOP core::scoring::constraints::AngleConstraint::func_
private

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