Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SecstructSRFD.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file core/fragments/FragData.cc
12 /// @brief a collection classes of the FragData and SingleResidueFragData class hirachy
13 /// @author Oliver Lange (olange@u.washington.edu)
14 /// @date Wed Oct 20 12:08:31 2007
15 ///
16 
17 // Unit Headers
19 
20 // Package Headers
21 // AUTO-REMOVED #include <core/fragment/FragData.hh>
22 // AUTO-REMOVED #include <core/fragment/Frame.hh>
23 
24 // Project Headers
25 // AUTO-REMOVED #include <core/kinematics/MoveMap.hh>
26 #include <core/pose/Pose.hh>
27 // AUTO-REMOVED #include <core/conformation/ResidueFactory.hh>
28 
29 // ObjexxFCL Headers
30 // AUTO-REMOVED #include <ObjexxFCL/format.hh>
31 
32 // Utility headers
33 #include <utility/vector1.fwd.hh>
34 #include <basic/Tracer.hh>
35 
36 #include <utility/vector1.hh>
37 
38 
39 //Auto using namespaces
40 namespace ObjexxFCL { namespace fmt { } } using namespace ObjexxFCL::fmt; // AUTO USING NS
41 //Auto using namespaces end
42 
43 
44 namespace core {
45 namespace fragment {
46 
47 static basic::Tracer tr("core.fragment");
48 
49 
50 bool SecstructSRFD::apply( pose::Pose& pose, Size seqpos ) const {
51  // Parent::apply( pose, seqpos );
52  pose.set_secstruct( seqpos, secstruct() );
53  return true; //can something go wrong ? check has_torsion() ?
54 }
55 
56 
57 /// @brief apply secondary structure fragment data to the pose, movemap has no effect
58 /// @remarks In this version of apply(), by convention MoveMap has no effect
59 /// because a setting for sec.struct currently does not exist within the map.
60 /// @return always true
61 bool SecstructSRFD::apply( kinematics::MoveMap const &, pose::Pose & pose, Size const seqpos ) const {
62  // see is_applicable() for additional comments
63  pose.set_secstruct( seqpos, secstruct() );
64  return true;
65 }
66 
67 
68 bool SecstructSRFD::apply_ss( std::string& ss, Size seqpos ) const {
69  // Parent::apply_ss( ss, seqpos );
70  ss[ seqpos - 1 ] = secstruct();
71  return true; //can something go wrong ? check has_torsion() ?
72 }
73 
74 
75 bool SecstructSRFD::steal( pose::Pose const& pose, Size seqpos ) {
76  Parent::steal( pose, seqpos );
77  secstruct_ = pose.secstruct( seqpos );
78  tr.Trace << "steal secstructur " << secstruct_ << " at position " << seqpos << std::endl;
79  return true;
80 }
81 
82 bool SecstructSRFD::is_compatible( SingleResidueFragData const& aSRFD) const {
83  //SecstructSRFD const* ptr = dynamic_cast< SecstructSRFD const* > ( & aSRFD );
84  return dynamic_cast< SecstructSRFD const* > ( & aSRFD ); //cast succesful same type
85 }
86 
87 bool SecstructSRFD::is_applicable( kinematics::MoveMap const&, Size) const {
88  //movemap always allows changes of the secstruct id ( it doesn't move anything but changes the energy -- strange dof )
89  return true;
90 }
91 
92 void SecstructSRFD::show( std::ostream &out ) const {
93  using namespace ObjexxFCL::fmt;
94  Parent::show( out );
95  out << sequence() << ' ' << secstruct() << ' ';
96 }
97 
98 void SecstructSRFD::read_data( std::istream &in ) {
99  Parent::read_data( in );
100  char c;
101  in >> c >> secstruct_;
102  set_sequence( c );
103 }
104 
105 } //fragment
106 } //core