Rosetta 3.5
 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]
Collaboration diagram for core::fragment::Frame:
Collaboration graph
[legend]

Public Member Functions

virtual ~Frame ()
 Automatically generated virtual destructor for class deriving directly from ReferenceCount. 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, FragDataOP 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 ()
 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 (FragDataOP new_frag)
 add a fragment .. return new frag_nr More...
 
bool add_fragment (FragDataList 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...
 
FragDatafragment (core::Size frag_num)
 accessor for underlying FragData More...
 
FragDataCOP fragment_ptr (core::Size frag_num) const
 accessor for underlying FragData as owning ptr More...
 
FragDataOP fragment_ptr (core::Size frag_num)
 accessor for underlying FragData as owning ptr More...
 
bool is_valid () const
 a frame is considered valid if at least one fragment is contained and this fragment is also valid (not an empty template fragment) 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...
 
void shift_to (core::Size setting)
 set start position 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)
 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...
 
virtual 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_
 
FragDataList 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.

Definition at line 109 of file Frame.hh.

Member Typedef Documentation

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

Definition at line 110 of file Frame.hh.

Constructor & Destructor Documentation

core::fragment::Frame::~Frame ( )
virtual

Automatically generated virtual destructor for class deriving directly from ReferenceCount.

Auto-generated virtual destructor

Definition at line 47 of file Frame.cc.

core::fragment::Frame::Frame ( )

Definition at line 89 of file Frame.cc.

Referenced by clone().

core::fragment::Frame::Frame ( core::Size  begin,
core::Size  end,
core::Size  nr_res 
)

Definition at line 95 of file Frame.cc.

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

Definition at line 101 of file Frame.cc.

core::fragment::Frame::Frame ( core::Size  start)

Definition at line 107 of file Frame.cc.

core::fragment::Frame::Frame ( core::Size  start,
FragDataOP  frag1 
)

Definition at line 113 of file Frame.cc.

References add_fragment().

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

Definition at line 121 of file Frame.cc.

References add_fragment().

Member Function Documentation

std::string core::fragment::Frame::_static_type_name ( )
static

Definition at line 156 of file Frame.cc.

Referenced by core::fragment::FragFactory::FragFactory(), and type().

core::Size core::fragment::Frame::add_fragment ( FragDataOP  new_frag)
bool core::fragment::Frame::add_fragment ( FragDataList  new_frags)

add all fragments in list

Definition at line 408 of file Frame.cc.

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.

Definition at line 471 of file Frame.cc.

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

Definition at line 357 of file Frame.cc.

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

Definition at line 367 of file Frame.cc.

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

Definition at line 253 of file Frame.cc.

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

Definition at line 523 of file Frame.cc.

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.

Definition at line 130 of file Frame.cc.

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

Referenced by clone_with_frags(), clone_with_template(), 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

Definition at line 262 of file Frame.cc.

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

Referenced by merge().

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

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

Definition at line 135 of file Frame.cc.

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 )

Definition at line 142 of file Frame.cc.

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

Definition at line 197 of file Frame.cc.

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

Definition at line 162 of file Frame.cc.

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(), and show_fragments().

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

accessor for underlying FragData

Definition at line 167 of file Frame.cc.

References frag_list_.

void core::fragment::Frame::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() )

Definition at line 392 of file Frame.cc.

References core::fragment::FragData::apply(), core::pose::Pose::clear(), frag_list_, fragment(), length(), and core::fragment::make_pose_from_sequence_().

Referenced by protocols::simple_moves::GunnCost::compute_gunn().

FragDataCOP core::fragment::Frame::fragment_ptr ( core::Size  frag_num) const

accessor for underlying FragData as owning ptr

Definition at line 172 of file Frame.cc.

References frag_list_.

Referenced by protocols::enzdes::EnzdesFlexibleRegion::examine_new_loopconf(), core::fragment::FragID::fragment_ptr(), and show_fragments().

FragDataOP core::fragment::Frame::fragment_ptr ( core::Size  frag_num)

accessor for underlying FragData as owning ptr

Definition at line 177 of file Frame.cc.

References frag_list_.

FrameOP core::fragment::Frame::generate_sub_frame ( Size  length,
Size  start = 1 
)

generate_sub_frame of length from start ( internal numbers )

Definition at line 491 of file Frame.cc.

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

Definition at line 307 of file Frame.cc.

References end(), end_, length(), nr_res_, start(), and start_.

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

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

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

Definition at line 340 of file Frame.cc.

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
protectedvirtual

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.

Definition at line 285 of file Frame.cc.

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

Definition at line 272 of file Frame.cc.

References fragment(), core::fragment::FragData::is_compatible(), length(), nr_frags(), start(), and stop().

Referenced by merge().

bool core::fragment::Frame::is_valid ( ) const

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

Definition at line 183 of file Frame.cc.

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

Referenced by protocols::loops::loop_closure::ccd::FASelectSlidingWindowLoopClosure::select_final_loop().

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

Definition at line 456 of file Frame.cc.

References clone_cache_data(), frag_list_, and is_mergeable().

bool core::fragment::Frame::moves_residue ( core::Size  pos) const
virtual

Reimplemented in core::fragment::NonContinuousFrame.

Definition at line 235 of file Frame.cc.

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

Definition at line 239 of file Frame.cc.

References is_applicable().

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

Reimplemented in core::fragment::NonContinuousFrame.

Definition at line 439 of file Frame.cc.

References end_, nr_res_, and start_.

core::Size core::fragment::Frame::seqpos ( core::Size  intra_pos) const
virtual
void core::fragment::Frame::shift_to ( core::Size  setting)

set start position

shift to new start position ( change end accordingly )

Definition at line 372 of file Frame.cc.

References end_, nr_res_, and start_.

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

Reimplemented in core::fragment::NonContinuousFrame.

Definition at line 427 of file Frame.cc.

References show_fragments(), and show_header().

Referenced by core::fragment::operator<<().

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

Definition at line 417 of file Frame.cc.

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

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.

Definition at line 446 of file Frame.cc.

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

Definition at line 434 of file Frame.cc.

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

Definition at line 505 of file Frame.cc.

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

Definition at line 230 of file Frame.cc.

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.

Definition at line 152 of file Frame.cc.

References _static_type_name().

Member Data Documentation

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

Definition at line 315 of file Frame.hh.

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

core::Size core::fragment::Frame::end_
mutableprivate

Definition at line 306 of file Frame.hh.

Referenced by align(), contains_seqpos(), end(), init_length(), is_compatible(), read(), shift_to(), and stop().

FragDataList core::fragment::Frame::frag_list_
private
core::Size core::fragment::Frame::nr_res_
mutableprivate

Definition at line 309 of file Frame.hh.

Referenced by init_length(), is_compatible(), length(), read(), and shift_to().

core::Size core::fragment::Frame::start_
private

Definition at line 303 of file Frame.hh.

Referenced by align(), contains_seqpos(), init_length(), is_compatible(), read(), shift_to(), and start().


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