Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
core::fragment::Frame Class Reference

Frame couples a list of FragData-instances to a certain alignment frame, i.e., position in sequence space A frame may be continous, i.e., its fragment data will be applied to all residues between start() and end() or ( in a specialized version inheriting this interface) may contain a loose list of sequence positions. More...

#include <Frame.hh>

Inheritance diagram for core::fragment::Frame:
Inheritance graph
[legend]

Public Member Functions

 ~Frame () override
 Automatically generated virtual destructor for class deriving directly from VirtualBase. More...
 
 Frame ()
 
 Frame (core::Size begin, core::Size end, core::Size nr_res)
 
 Frame (core::Size start, core::Size length)
 
 Frame (core::Size start)
 
 Frame (core::Size start, FragDataCOP const &frag1)
 
 Frame (core::Size start, core::Size length, SingleResidueFragDataOP srfd)
 
virtual FrameOP clone () const
 clone method, new frame with same alignment position, fragments are not copied! More...
 
virtual FrameOP clone_with_frags () const
 clone method, new frame with same alignment position, fragments are not copied! More...
 
virtual FrameOP clone_with_template ()
 clone method, new frame with same alignment position, one fragments is copied as template ( valid() == false ) More...
 
virtual std::string type () const
 type() is specifying the output name of the Frame in FragmentIO ("FRAME", "JUMPFRAME", etc) More...
 
core::Size add_fragment (FragDataCOP new_frag)
 add a fragment .. return new frag_nr More...
 
bool add_fragment (FragDataCOPs new_frags)
 add all fragments in list More...
 
FragData const & fragment (core::Size frag_num) const
 delete a fragment: Attention: all data in the FragCache is invalidated ( and deleted ) it would be complicated to change this behaviour. Thus, it is desirable to avoid using delete_fragment() altogether. Faster: Make a new Frame and add all fragments you are interested in. More...
 
FragDataCOP fragment_ptr (core::Size frag_num) const
 accessor for underlying FragData More...
 
bool is_valid () const
 accessor for underlying FragData as owning ptr More...
 
core::Size apply (kinematics::MoveMap const &, core::Size frag_num, pose::Pose &pose) const
 insert fragment frag_num into pose More...
 
core::Size apply (core::Size frag_num, pose::Pose &pose) const
 insert fragment frag_num into pose — ignore movemap More...
 
core::Size apply_ss (kinematics::MoveMap const &, core::Size frag_num, std::string &ss) const
 change ss-string according to sec-struct info in fragments More...
 
bool steal (pose::Pose const &pose)
 obtain fragment from pose at frame position More...
 
core::Size is_applicable (kinematics::MoveMap const &) const
 is the Frame applicable to the pose with the given movemap? More...
 
virtual core::Size seqpos (core::Size intra_pos) const
 translate intra-frame position into sequence position. (trivial for base-class) More...
 
core::Size frag_id (core::Size frag_num) const
 a unique id for every fragment in the list. his is silly, but would enable later on to avoid cache_clearence on deletion of FragData entries in this case, we would require that the ID of a certain fragment never changes, even if the position in FragList changes More...
 
void fragment_as_pose (core::Size frag_num, pose::Pose &pose, chemical::ResidueTypeSetCAP restype_set) const
 returns a (small) pose with fragment ( continous from seqpos 1 ... nr_res_affected() ) More...
 
virtual bool is_continuous () const
 true if frame is continuous (always true for base class) More...
 
core::Size nr_frags () const
 number of fragments attached to this frame More...
 
void clear ()
 remove all valid fragments, a template fragment will be left over More...
 
bool contains_seqpos (core::Size seqpos) const
 whether this fragment contains a certain position More...
 
core::Size start () const
 first seqpos of this frame More...
 
virtual void shift_to (core::Size setting)
 set start position More...
 
virtual void shift_by (int offset)
 shift frame by offset relative to current start position ( change end accordingly ) More...
 
core::Size end () const
 last sequence position affected by this frame More...
 
core::Size stop () const
 /// More...
 
virtual bool moves_residue (core::Size pos) const
 
core::Size nr_res_affected (kinematics::MoveMap const &mm) const
 number of residues affected by this frame More...
 
core::Size length () const
 number of residues in this frame ( for continuous frames it is the same as end()-start() + 1 ) More...
 
BaseCacheUnitcache (std::string tag, BaseCacheUnitOP const &new_cache) const
 return handle to cached data stored under "tag" shouldn't be called directly More...
 
void clone_cache_data (Frame const &source, core::Size sid, core::Size nid)
 copies all entries in the Frame-Cache for fragment "sid" of Frame "source" to fragment "nid" of "this" frame More...
 
virtual void show_classic (std::ostream &out) const
 
virtual void show (std::ostream &out) const
 
virtual void show_header (std::ostream &out) const
 
virtual void read (std::istream &in)
 
bool is_mergeable (Frame const &other) const
 
bool merge (Frame const &other)
 
virtual bool align (core::id::SequenceMapping const &map)
 change frames residue numbers accoriding to map More...
 
FrameOP generate_sub_frame (Size length, Size start=1) const
 generate_sub_frame of length from start ( internal numbers ) More...
 

Static Public Member Functions

static std::string _static_type_name ()
 

Protected Member Functions

virtual void show_fragments (std::ostream &out) const
 NOT IMPLEMENTED YET: generate_sub_frame according to mapping ( residue numbers ) returns NULL if mapping invalid. More...
 
bool is_compatible (FragDataCOP new_frag) const
 is a FragData object compatible with the already stored ones ? you can only add instances of FragData to the same Frame that are compatible, i.e., that contain the same class of FragData, e.g., based on BBTorsionSRFD, if you want to have different fragment for other dof's at the same sequence position create a new Frame. Users of the fragment-core are aware that multiple Frames for the same sequence position may exist. More...
 
void init_length (core::Size start, core::Size end, core::Size length)
 

Private Types

typedef std::map< std::string,
BaseCacheUnitOP
CacheMap
 

Private Attributes

core::Size start_
 
core::Size end_
 
core::Size nr_res_
 
CacheMap cache_
 
FragDataCOPs frag_list_
 

Detailed Description

Frame couples a list of FragData-instances to a certain alignment frame, i.e., position in sequence space A frame may be continous, i.e., its fragment data will be applied to all residues between start() and end() or ( in a specialized version inheriting this interface) may contain a loose list of sequence positions.

Instances of FragData (e.g., the Torsion-Angles of a specific Fragment) can be added and deleted via add_- or delete_fragment() methods.

a fragment is inserted into the structure via the apply() method and the steal() method is its inverse: an instance of FragData is created from the structure of the pose at the dof's specified in the other FragData's of the Frame. The new FragData is added as last fragment to the frame.

accessors to underlying FragData-instances are available as fragment() or fragment_ptr().

Frame supports the FragCache –> see FragCache for documentation.

MoveMaps: It should be possible to specify which dofs can be moved. In this case fragment-insertions should a) only be allowed if all dofs affected are moveable or b) only change those dofs that are moveable. this information could be handled by an extended version of the kinematics::movemap. The movemap would then have to functions: 1) which dofs are changed by a certain FragData/Frame 2) which dofs are moveable comparison of movemaps, i.e., M1 <= M2 could tell us if dofs tagged in M1 are also tagged in M2: i.e., the M_fragdata<= M_pose would tell us that the fragment is applicable to the Pose.

Member Typedef Documentation

typedef std::map<std::string, BaseCacheUnitOP > core::fragment::Frame::CacheMap
private

Constructor & Destructor Documentation

core::fragment::Frame::~Frame ( )
overridedefault

Automatically generated virtual destructor for class deriving directly from VirtualBase.

Auto-generated virtual destructor

core::fragment::Frame::Frame ( )
core::fragment::Frame::Frame ( core::Size  begin,
core::Size  end,
core::Size  nr_res 
)
core::fragment::Frame::Frame ( core::Size  start,
core::Size  length 
)
core::fragment::Frame::Frame ( core::Size  start)
core::fragment::Frame::Frame ( core::Size  start,
FragDataCOP const &  frag1 
)

References add_fragment().

core::fragment::Frame::Frame ( core::Size  start,
core::Size  length,
SingleResidueFragDataOP  srfd 
)

References add_fragment().

Member Function Documentation

std::string core::fragment::Frame::_static_type_name ( )
static
core::Size core::fragment::Frame::add_fragment ( FragDataCOP  new_frag)
bool core::fragment::Frame::add_fragment ( FragDataCOPs  new_frags)

add all fragments in list

References add_fragment().

bool core::fragment::Frame::align ( core::id::SequenceMapping const &  map)
virtual

change frames residue numbers accoriding to map

change frames residue numbers according to map

Reimplemented in core::fragment::NonContinuousFrame.

References end(), end_, is_continuous(), length(), start(), start_, and core::fragment::tr().

Referenced by protocols::enzdes::EnzdesFlexibleRegion::remap_resid().

core::Size core::fragment::Frame::apply ( kinematics::MoveMap const &  mm,
core::Size  frag_num,
pose::Pose pose 
) const
core::Size core::fragment::Frame::apply ( core::Size  frag_num,
pose::Pose pose 
) const

insert fragment frag_num into pose — ignore movemap

References core::fragment::FragData::apply(), end(), fragment(), is_continuous(), and start().

core::Size core::fragment::Frame::apply_ss ( kinematics::MoveMap const &  mm,
core::Size  frag_num,
std::string &  ss 
) const

change ss-string according to sec-struct info in fragments

References core::fragment::FragData::apply_ss(), and fragment().

Referenced by core::fragment::FragID::apply_ss().

BaseCacheUnit & core::fragment::Frame::cache ( std::string  tag,
BaseCacheUnitOP const &  new_cache 
) const

return handle to cached data stored under "tag" shouldn't be called directly

References cache_.

Referenced by core::fragment::CacheWrapper< protocols::simple_moves::GunnTuple, MapCacheUnit< protocols::simple_moves::GunnTuple > >::cache(), and clone_cache_data().

void core::fragment::Frame::clear ( )

remove all valid fragments, a template fragment will be left over

References add_fragment(), cache_, frag_list_, and nr_frags().

Referenced by protocols::enzdes::EnzdesFlexibleRegion::minimize_region(), and protocols::enzdes::EnzdesFlexibleRegion::remap_resid().

FrameOP core::fragment::Frame::clone ( ) const
virtual

clone method, new frame with same alignment position, fragments are not copied!

Reimplemented in core::fragment::JumpingFrame, and core::fragment::NonContinuousFrame.

References end(), length(), and start().

Referenced by clone_with_frags(), clone_with_template(), protocols::loop_grower::FragmentExtension::cluster_fragments(), and generate_sub_frame().

void core::fragment::Frame::clone_cache_data ( Frame const &  source,
core::Size  sid,
core::Size  nid 
)

copies all entries in the Frame-Cache for fragment "sid" of Frame "source" to fragment "nid" of "this" frame

References cache(), cache_, and core::fragment::BaseCacheUnit::remap_value().

Referenced by merge().

FrameOP core::fragment::Frame::clone_with_frags ( ) const
virtual

clone method, new frame with same alignment position, fragments are not copied!

References clone().

FrameOP core::fragment::Frame::clone_with_template ( )
virtual

clone method, new frame with same alignment position, one fragments is copied as template ( valid() == false )

References clone(), frag_list_, and nr_frags().

bool core::fragment::Frame::contains_seqpos ( core::Size  seqpos) const
core::Size core::fragment::Frame::end ( ) const
core::Size core::fragment::Frame::frag_id ( core::Size  frag_num) const

a unique id for every fragment in the list. his is silly, but would enable later on to avoid cache_clearence on deletion of FragData entries in this case, we would require that the ID of a certain fragment never changes, even if the position in FragList changes

Referenced by core::fragment::CacheWrapper< protocols::simple_moves::GunnTuple, MapCacheUnit< protocols::simple_moves::GunnTuple > >::retrieve(), and core::fragment::CacheWrapper< protocols::simple_moves::GunnTuple, MapCacheUnit< protocols::simple_moves::GunnTuple > >::store().

FragData const & core::fragment::Frame::fragment ( core::Size  frag_num) const

delete a fragment: Attention: all data in the FragCache is invalidated ( and deleted ) it would be complicated to change this behaviour. Thus, it is desirable to avoid using delete_fragment() altogether. Faster: Make a new Frame and add all fragments you are interested in.

accesors for underlying FragData

References frag_list_.

Referenced by apply(), protocols::simple_moves::SymmetricFragmentMover::apply_fragment(), apply_ss(), core::fragment::chop_fragments(), protocols::simple_moves::GunnCost::compute_gunn(), core::fragment::FragID::fragment(), fragment_as_pose(), is_applicable(), is_compatible(), is_mergeable(), is_valid(), core::fragment::make_simple_fold_tree_from_jump_frame(), show_classic(), show_fragments(), and protocols::loop_grower::LoopGrower::single_grow().

void core::fragment::Frame::fragment_as_pose ( core::Size  frag_num,
pose::Pose pose,
chemical::ResidueTypeSetCAP  restype_set 
) const
FragDataCOP core::fragment::Frame::fragment_ptr ( core::Size  frag_num) const
FrameOP core::fragment::Frame::generate_sub_frame ( Size  length,
Size  start = 1 
) const

generate_sub_frame of length from start ( internal numbers )

References clone(), frag_list_, is_continuous(), length(), and nr_frags().

void core::fragment::Frame::init_length ( core::Size  start,
core::Size  end,
core::Size  length 
)
protected
core::Size core::fragment::Frame::is_applicable ( kinematics::MoveMap const &  mm) const

is the Frame applicable to the pose with the given movemap?

References end(), fragment(), core::fragment::FragData::is_applicable(), is_continuous(), and start().

Referenced by nr_res_affected().

bool core::fragment::Frame::is_compatible ( FragDataCOP  new_frag) const
protected

is a FragData object compatible with the already stored ones ? you can only add instances of FragData to the same Frame that are compatible, i.e., that contain the same class of FragData, e.g., based on BBTorsionSRFD, if you want to have different fragment for other dof's at the same sequence position create a new Frame. Users of the fragment-core are aware that multiple Frames for the same sequence position may exist.

References end_, fragment(), length(), nr_frags(), nr_res_, and start_.

Referenced by add_fragment().

bool core::fragment::Frame::is_continuous ( ) const
virtual
bool core::fragment::Frame::is_mergeable ( Frame const &  other) const
bool core::fragment::Frame::is_valid ( ) const

accessor for underlying FragData as owning ptr

a frame is considered valid if at least one fragment is contained and this fragment is also valid (not an empty template fragment)

References fragment(), core::fragment::FragData::is_valid(), and nr_frags().

core::Size core::fragment::Frame::length ( ) const
bool core::fragment::Frame::merge ( Frame const &  other)
bool core::fragment::Frame::moves_residue ( core::Size  pos) const
virtual

Reimplemented in core::fragment::NonContinuousFrame.

References start().

core::Size core::fragment::Frame::nr_frags ( ) const
core::Size core::fragment::Frame::nr_res_affected ( kinematics::MoveMap const &  mm) const

number of residues affected by this frame

References is_applicable().

void core::fragment::Frame::read ( std::istream &  in)
virtual

Reimplemented in core::fragment::NonContinuousFrame.

References end_, nr_res_, and start_.

core::Size core::fragment::Frame::seqpos ( core::Size  intra_pos) const
virtual
void core::fragment::Frame::shift_by ( int  offset)
virtual

shift frame by offset relative to current start position ( change end accordingly )

Reimplemented in core::fragment::NonContinuousFrame.

References end_, and start_.

void core::fragment::Frame::shift_to ( core::Size  setting)
virtual

set start position

shift to new start position ( change end accordingly )

Reimplemented in core::fragment::NonContinuousFrame.

References end_, nr_res_, and start_.

Referenced by protocols::hybridization::CartesianSampler::apply_frame(), and protocols::loop_grower::LoopGrower::single_grow().

void core::fragment::Frame::show ( std::ostream &  out) const
virtual
void core::fragment::Frame::show_classic ( std::ostream &  out) const
virtual
void core::fragment::Frame::show_fragments ( std::ostream &  out) const
protectedvirtual

NOT IMPLEMENTED YET: generate_sub_frame according to mapping ( residue numbers ) returns NULL if mapping invalid.

References fragment(), fragment_ptr(), nr_frags(), and core::fragment::FragData::show().

Referenced by show().

void core::fragment::Frame::show_header ( std::ostream &  out) const
virtual

References end(), and start().

Referenced by show().

core::Size core::fragment::Frame::start ( ) const
bool core::fragment::Frame::steal ( pose::Pose const &  pose)

obtain fragment from pose at frame position

References frag_list_, nr_frags(), and core::fragment::tr().

Referenced by protocols::enzdes::EnzdesFlexibleRegion::minimize_region().

core::Size core::fragment::Frame::stop ( ) const

///

set stop position last sequence position affected by this frame

References end_.

Referenced by is_mergeable().

std::string core::fragment::Frame::type ( ) const
virtual

type() is specifying the output name of the Frame in FragmentIO ("FRAME", "JUMPFRAME", etc)

Reimplemented in core::fragment::JumpingFrame.

References _static_type_name().

Member Data Documentation

CacheMap core::fragment::Frame::cache_
mutableprivate

Referenced by cache(), clear(), and clone_cache_data().

core::Size core::fragment::Frame::end_
mutableprivate
FragDataCOPs core::fragment::Frame::frag_list_
private
core::Size core::fragment::Frame::nr_res_
mutableprivate
core::Size core::fragment::Frame::start_
private

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