Rosetta 3.4
Public Types | Public Member Functions
core::scoring::constraints::Constraint Class Reference

Actually a *restraint*, like a virtual rubber band between a pair of atoms. More...

#include <Constraint.hh>

Inheritance diagram for core::scoring::constraints::Constraint:
Inheritance graph
[legend]
Collaboration diagram for core::scoring::constraints::Constraint:
Collaboration graph
[legend]

List of all members.

Public Types

typedef id::AtomID AtomID

Public Member Functions

 Constraint (ScoreType const &t)
 Constructor for Constraint class.
virtual ~Constraint ()
 Virtual destructor.
virtual ConstraintOP clone () const =0
 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.
virtual ConstraintOP clone (FuncOP) const
virtual ConstraintOP remapped_clone (pose::Pose const &, pose::Pose const &, id::SequenceMappingCOP map=NULL) const
 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.
virtual Size natoms () const =0
 Returns the number of atoms involved in defining this constraint. If the constraint doesn't depend on particular atoms (e.g. a residue type constraint) this function can return zero.
virtual AtomID const & atom (Size const index) const =0
 Returns the AtomID referred to by index.
virtual utility::vector1
< core::Size
residues () const
 Returns the pose numbers of the residues involved in this constraint, in no particular order.
virtual void read_constraint (std::istream &, core::pose::Pose const &)
 This method is totally redundant with read_def YAY.
ScoreType const & score_type () const
 Returns the ScoreType that this Constraint object will use.
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,
virtual ConstraintOP remap_resid (core::id::SequenceMapping const &) const
 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.
virtual core::Real dist (core::pose::Pose const &) const
 return the "raw" distance before handed to the FUNC object
virtual core::Real dist (XYZ_Func const &) const
virtual void score (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.
virtual std::string type () const
 Returns a unique string identified for this constraint. Used in several places, including the ConstraintIO class.
virtual void setup_for_scoring (XYZ_Func const &, ScoreFunction const &) const
virtual void setup_for_derivatives (XYZ_Func const &, ScoreFunction const &) const
virtual Real score (conformation::Conformation const &) const
 Returns the score of this constraint computed over the given conformation. Not necessarily implemented in all derived classes, as it's redundant with the score( XYZ_Func, EnergyMap, EnergyMap ) method defined above. Returns 0.0 if not implemented.
virtual void fill_f1_f2 (AtomID const &atom, XYZ_Func const &xyz_func, Vector &F1, Vector &F2, EnergyMap const &weights) const =0
 Fill the f1 and f2 vectors, necessary for considering the derivative this constraint during minimization. (someone please reference Bill Wedermeyer's paper here, as I'm in an airport and can't fill it in myself!)
virtual void show (std::ostream &) const
 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.
virtual void show_def (std::ostream &, pose::Pose const &) const
 Prints the definition of a Constraint to the given std::ostream, using the given Pose, and the given 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.
virtual void read_def (std::istream &, pose::Pose const &, FuncFactory const &)
virtual void steal_def (pose::Pose const &)
std::string to_string () const
 Convenience function, returns the results of show() as a string. Not to be overriden by derived classes.
virtual Size show_violations (std::ostream &out, pose::Pose const &, Size, Real threshold=1) const
 Prints the violations of this constraint to the given std::ostream. What are violations? It's not defined, and it depends on the constraint and the function! also - wtf is threshold? it was defined as a Size in CoordinateConstraint, I don't know which definition is the right one. Documentation would be nice ...
virtual Func const & get_func () const
 Returns the Func object associated with this Constraint object.
virtual bool operator== (Constraint const &) const
 possibility to do object comparison instead of pointer comparison
bool operator!= (Constraint const &other) const
 possibility to do object comparison instead of pointer comparison
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

Detailed Description

Actually a *restraint*, like a virtual rubber band between a pair of atoms.

All Constraints are expected to be immutable once created, meaning their internal data (state) should not change over their lifetime. This allows Constraints to be shared between copies of Poses (e.g. in Monte Carlo), and is important for both speed (with thousands of contraints) and correctness.

To "change" a constraint, remove the old one and add a new and different one. The steal() methods have been removed because it is incompatible with the idea of immutable constraints.


Member Typedef Documentation


Constructor & Destructor Documentation

core::scoring::constraints::Constraint::Constraint ( ScoreType const &  t) [inline]

Constructor for Constraint class.

virtual core::scoring::constraints::Constraint::~Constraint ( ) [inline, virtual]

Virtual destructor.


Member Function Documentation

virtual AtomID const& core::scoring::constraints::Constraint::atom ( Size const  index) const [pure virtual]
virtual core::Size core::scoring::constraints::Constraint::choose_effective_sequence_separation ( core::kinematics::ShortestPathInFoldTree const &  sp,
numeric::random::RandomGenerator &   
) [inline, virtual]
virtual ConstraintOP core::scoring::constraints::Constraint::clone ( ) const [pure virtual]

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.

Implemented in core::pack::dunbrack::DunbrackConstraint, core::pack::dunbrack::RotamerConstraint, core::scoring::constraints::AmbiguousConstraint, core::scoring::constraints::AmbiguousNMRConstraint, core::scoring::constraints::AmbiguousNMRDistanceConstraint, core::scoring::constraints::AngleConstraint, core::scoring::constraints::AtomPairConstraint, core::scoring::constraints::BackboneStubConstraint, core::scoring::constraints::BigBinConstraint, core::scoring::constraints::CoordinateConstraint, core::scoring::constraints::DihedralConstraint, core::scoring::constraints::DihedralPairConstraint, core::scoring::constraints::KofNConstraint, core::scoring::constraints::LocalCoordinateConstraint, core::scoring::constraints::MultiConstraint, core::scoring::constraints::NamedAtomPairConstraint, core::scoring::constraints::NonResidueTypeConstraint, core::scoring::constraints::ResidueTypeConstraint, core::scoring::constraints::ResidueTypeLinkingConstraint, core::scoring::constraints::SequenceProfileConstraint, core::scoring::constraints::SiteConstraint, protocols::constraints_additional::AmbiguousMultiConstraint, protocols::constraints_additional::BindingSiteConstraint, protocols::constraints_additional::SequenceCoupling1BDConstraint, protocols::constraints_additional::SequenceCouplingConstraint, and protocols::pockets::PocketConstraint.

virtual ConstraintOP core::scoring::constraints::Constraint::clone ( FuncOP  ) const [inline, virtual]
virtual core::Real core::scoring::constraints::Constraint::dist ( core::pose::Pose const &  ) const [inline, virtual]
virtual core::Real core::scoring::constraints::Constraint::dist ( XYZ_Func const &  ) const [inline, virtual]
virtual core::Size core::scoring::constraints::Constraint::effective_sequence_separation ( core::kinematics::ShortestPathInFoldTree const &  ) const [inline, virtual]
virtual void core::scoring::constraints::Constraint::fill_f1_f2 ( AtomID const &  atom,
XYZ_Func const &  xyz_func,
Vector F1,
Vector F2,
EnergyMap const &  weights 
) const [pure virtual]
virtual Func const& core::scoring::constraints::Constraint::get_func ( ) const [inline, virtual]
virtual Size core::scoring::constraints::Constraint::natoms ( ) const [pure virtual]
bool core::scoring::constraints::Constraint::operator!= ( Constraint const &  other) const [inline]

possibility to do object comparison instead of pointer comparison

virtual bool core::scoring::constraints::Constraint::operator== ( Constraint const &  ) const [inline, virtual]
virtual void core::scoring::constraints::Constraint::read_constraint ( std::istream &  ,
core::pose::Pose const &   
) [inline, virtual]

This method is totally redundant with read_def YAY.

virtual void core::scoring::constraints::Constraint::read_data ( std::istream &  ) [inline, virtual]

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,

virtual void core::scoring::constraints::Constraint::read_def ( std::istream &  ,
pose::Pose const &  ,
FuncFactory const &   
) [inline, virtual]
virtual ConstraintOP core::scoring::constraints::Constraint::remap_resid ( core::id::SequenceMapping const &  ) const [inline, virtual]
virtual ConstraintOP core::scoring::constraints::Constraint::remapped_clone ( pose::Pose const &  ,
pose::Pose const &  ,
id::SequenceMappingCOP  map = NULL 
) const [inline, virtual]
utility::vector1< core::Size > core::scoring::constraints::Constraint::residues ( ) const [virtual]

Returns the pose numbers of the residues involved in this constraint, in no particular order.

Used in determining one-body/two-body/multi-body status. For historical reasons, the default uses a simple protocol based on natoms()/atom() - feel free to reimplement more efficiently.

Reimplemented in core::scoring::constraints::MultiConstraint, core::scoring::constraints::NonResidueTypeConstraint, core::scoring::constraints::ResidueTypeConstraint, core::scoring::constraints::ResidueTypeLinkingConstraint, core::scoring::constraints::SequenceProfileConstraint, and protocols::constraints_additional::SequenceCouplingConstraint.

References atom(), and natoms().

Referenced by core::scoring::constraints::combinable().

virtual Real core::scoring::constraints::Constraint::score ( conformation::Conformation const &  ) const [inline, virtual]

Returns the score of this constraint computed over the given conformation. Not necessarily implemented in all derived classes, as it's redundant with the score( XYZ_Func, EnergyMap, EnergyMap ) method defined above. Returns 0.0 if not implemented.

Reimplemented in core::scoring::constraints::DihedralConstraint, and core::scoring::constraints::DihedralPairConstraint.

virtual void core::scoring::constraints::Constraint::score ( XYZ_Func const &  xyz_func,
EnergyMap const &  weights,
EnergyMap emap 
) const [pure virtual]

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.

Implemented in core::pack::dunbrack::DunbrackConstraint, core::pack::dunbrack::RotamerConstraint, core::scoring::constraints::AmbiguousConstraint, core::scoring::constraints::AmbiguousNMRConstraint, core::scoring::constraints::AmbiguousNMRDistanceConstraint, core::scoring::constraints::AngleConstraint, core::scoring::constraints::AtomPairConstraint, core::scoring::constraints::BackboneStubConstraint, core::scoring::constraints::BigBinConstraint, core::scoring::constraints::ConstantConstraint, core::scoring::constraints::CoordinateConstraint, core::scoring::constraints::DihedralConstraint, core::scoring::constraints::DihedralPairConstraint, core::scoring::constraints::KofNConstraint, core::scoring::constraints::LocalCoordinateConstraint, core::scoring::constraints::MultiConstraint, core::scoring::constraints::NonResidueTypeConstraint, core::scoring::constraints::ResidueTypeConstraint, core::scoring::constraints::ResidueTypeLinkingConstraint, core::scoring::constraints::SequenceProfileConstraint, protocols::constraints_additional::AmbiguousMultiConstraint, protocols::constraints_additional::BindingSiteConstraint, protocols::constraints_additional::SequenceCoupling1BDConstraint, protocols::constraints_additional::SequenceCouplingConstraint, and protocols::pockets::PocketConstraint.

Referenced by protocols::constraints_additional::MaxSeqSepConstraintSet::eval_non_residue_pair_energy().

ScoreType const& core::scoring::constraints::Constraint::score_type ( ) const [inline]

Returns the ScoreType that this Constraint object will use.

Referenced by core::scoring::constraints::NamedAtomPairConstraint::clone(), core::scoring::constraints::DihedralPairConstraint::clone(), core::scoring::constraints::DihedralConstraint::clone(), core::scoring::constraints::AtomPairConstraint::clone(), core::scoring::constraints::AngleConstraint::clone(), core::scoring::constraints::AmbiguousNMRDistanceConstraint::clone(), protocols::pockets::PocketConstraint::fill_f1_f2(), protocols::constraints_additional::BindingSiteConstraint::fill_f1_f2(), core::scoring::constraints::LocalCoordinateConstraint::fill_f1_f2(), core::scoring::constraints::DihedralPairConstraint::fill_f1_f2(), core::scoring::constraints::DihedralConstraint::fill_f1_f2(), core::scoring::constraints::CoordinateConstraint::fill_f1_f2(), core::scoring::constraints::BackboneStubConstraint::fill_f1_f2(), core::scoring::constraints::AtomPairConstraint::fill_f1_f2(), core::scoring::constraints::AngleConstraint::fill_f1_f2(), core::scoring::constraints::AmbiguousNMRDistanceConstraint::fill_f1_f2(), core::scoring::constraints::AmbiguousNMRConstraint::fill_f1_f2(), core::scoring::constraints::AmbiguousNMRDistanceConstraint::map_to_CB(), core::scoring::constraints::ResidueTypeLinkingConstraint::operator==(), core::scoring::constraints::ResidueTypeConstraint::operator==(), core::scoring::constraints::MultiConstraint::operator==(), core::scoring::constraints::DihedralPairConstraint::operator==(), core::scoring::constraints::DihedralConstraint::operator==(), core::scoring::constraints::CoordinateConstraint::operator==(), core::scoring::constraints::AtomPairConstraint::operator==(), core::scoring::constraints::AngleConstraint::operator==(), core::scoring::constraints::LocalCoordinateConstraint::remap_resid(), core::scoring::constraints::CoordinateConstraint::remap_resid(), core::scoring::constraints::AmbiguousNMRDistanceConstraint::remap_resid(), core::scoring::constraints::NamedAtomPairConstraint::remapped_clone(), core::scoring::constraints::LocalCoordinateConstraint::remapped_clone(), core::scoring::constraints::DihedralPairConstraint::remapped_clone(), core::scoring::constraints::DihedralConstraint::remapped_clone(), core::scoring::constraints::CoordinateConstraint::remapped_clone(), core::scoring::constraints::AtomPairConstraint::remapped_clone(), core::scoring::constraints::AngleConstraint::remapped_clone(), core::scoring::constraints::AmbiguousNMRDistanceConstraint::remapped_clone(), protocols::pockets::PocketConstraint::score(), protocols::constraints_additional::SequenceCouplingConstraint::score(), protocols::constraints_additional::SequenceCoupling1BDConstraint::score(), protocols::constraints_additional::BindingSiteConstraint::score(), core::scoring::constraints::SequenceProfileConstraint::score(), core::scoring::constraints::ResidueTypeLinkingConstraint::score(), core::scoring::constraints::ResidueTypeConstraint::score(), core::scoring::constraints::NonResidueTypeConstraint::score(), core::scoring::constraints::LocalCoordinateConstraint::score(), core::scoring::constraints::DihedralPairConstraint::score(), core::scoring::constraints::DihedralConstraint::score(), core::scoring::constraints::CoordinateConstraint::score(), core::scoring::constraints::ConstantConstraint::score(), core::scoring::constraints::BackboneStubConstraint::score(), core::scoring::constraints::AtomPairConstraint::score(), core::scoring::constraints::AngleConstraint::score(), core::scoring::constraints::AmbiguousNMRDistanceConstraint::score(), core::scoring::constraints::AmbiguousNMRConstraint::score(), core::pack::dunbrack::RotamerConstraint::score(), and core::pack::dunbrack::DunbrackConstraint::score().

virtual void core::scoring::constraints::Constraint::setup_for_derivatives ( XYZ_Func const &  ,
ScoreFunction const &   
) const [inline, virtual]
virtual void core::scoring::constraints::Constraint::setup_for_scoring ( XYZ_Func const &  ,
ScoreFunction const &   
) const [inline, virtual]
virtual void core::scoring::constraints::Constraint::show ( std::ostream &  ) const [inline, virtual]

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 in core::pack::dunbrack::DunbrackConstraint, core::pack::dunbrack::RotamerConstraint, core::scoring::constraints::AmbiguousConstraint, core::scoring::constraints::AmbiguousNMRDistanceConstraint, core::scoring::constraints::AngleConstraint, core::scoring::constraints::AtomPairConstraint, core::scoring::constraints::BackboneStubConstraint, core::scoring::constraints::BigBinConstraint, core::scoring::constraints::ConstantConstraint, core::scoring::constraints::CoordinateConstraint, core::scoring::constraints::DihedralConstraint, core::scoring::constraints::DihedralPairConstraint, core::scoring::constraints::KofNConstraint, core::scoring::constraints::LocalCoordinateConstraint, core::scoring::constraints::MultiConstraint, core::scoring::constraints::NonResidueTypeConstraint, core::scoring::constraints::ResidueTypeConstraint, core::scoring::constraints::ResidueTypeLinkingConstraint, core::scoring::constraints::SequenceProfileConstraint, core::scoring::constraints::SiteConstraint, protocols::constraints_additional::AmbiguousMultiConstraint, protocols::constraints_additional::BindingSiteConstraint, protocols::constraints_additional::SequenceCoupling1BDConstraint, and protocols::constraints_additional::SequenceCouplingConstraint.

Referenced by core::scoring::constraints::operator<<(), core::scoring::constraints::Constraints::show(), and to_string().

virtual void core::scoring::constraints::Constraint::show_def ( std::ostream &  ,
pose::Pose const &   
) const [inline, virtual]
virtual Size core::scoring::constraints::Constraint::show_violations ( std::ostream &  out,
pose::Pose const &  ,
Size  ,
Real  threshold = 1 
) const [inline, virtual]
virtual void core::scoring::constraints::Constraint::steal_def ( pose::Pose const &  ) [inline, virtual]
std::string core::scoring::constraints::Constraint::to_string ( ) const [inline]

Convenience function, returns the results of show() as a string. Not to be overriden by derived classes.

References show().

virtual std::string core::scoring::constraints::Constraint::type ( ) const [inline, virtual]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines