Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JumpingFrame.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/Frame.cc
12 /// @brief set of fragments for a certain alignment frame
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 
22 // Project Headers
23 // AUTO-REMOVED #include <core/pose/Pose.hh>
25 //#include <core/chemical/ChemicalManager.hh>
26 //#include <core/chemical/ResidueTypeSet.hh>
27 //#include <core/conformation/ResidueFactory.hh>
28 
29 // ObjexxFCL Headers
30 #include <ObjexxFCL/format.hh>
31 
32 #include <utility/vector1.hh>
33 
34 
35 // Utility headers
36 //#include <utility/vector1.fwd.hh>
37 
38 namespace core {
39 namespace fragment {
40 
41 using namespace ObjexxFCL::fmt;
42 
43 // FragDataOP generate_fragdata( SingleResidueFragDataOP frag_res_type, SingleResidueFragDataOP jump_frag_type ) {
44 // if ( nr_frags() ) return frag_data_.front()->clone();
45 // Size const length( bWithTorsion ? 3 : 1 );
46 // if ( bWithTorsion ) {
47 // BBTorsionSRFDOP start = new BBTorsionSRFD( 3, 'E', 'X' );
48 // start->set_torsion( 1, it->phi( iStart ) );
49 // start->set_torsion( 2, it->psi( iStart ) );
50 // start->set_torsion( 3, it->omega( iStart ) );
51 
52 // frags.back()->add_residue( start );
53 // }
54 // frags.back()->add_residue( new JumpSRFD( it->rt_, it->atoms_downstream_, it->atoms_upstream_, 'X' ) );
55 // if ( bWithTorsion ) {
56 // BBTorsionSRFDOP stop = new BBTorsionSRFD( 3, 'E', 'X' );
57 // stop->set_torsion( 1, it->phi( iStop ) );
58 // stop->set_torsion( 2, it->psi( iStop ) );
59 // stop->set_torsion( 3, it->omega( iStop ) );
60 
61 // frags.back()->add_residue( stop );
62 // }
63 
64 // }
65 bool
67  bool success = Parent::align( map );
68  for ( PosList::iterator it = pos_.begin(),
69  eit = pos_.end(); it!=eit && success; ++it ) {
70  Size newpos( map[ *it ] );
71  if ( newpos > 0 ) {
72  *it = newpos;
73  } else return false;
74  }
75  return success;
76 }
77 
78 void NonContinuousFrame::show( std::ostream &out ) const {
79  using namespace ObjexxFCL::fmt;
80  out << type() << " ";
81  show_pos( out );
82  out << std::endl;
83  show_fragments( out );
84 }
85 
86 void NonContinuousFrame::read( std::istream &in ) {
87  using namespace ObjexxFCL::fmt;
88  Size pos;
89  pos_.clear();
90  std::string line;
91  getline( in, line );
92  std::istringstream line_stream( line );
93  while ( line_stream >> pos ) {
94  pos_.push_back( pos );
95  }
96  init_length( pos_.front(), pos_.back(), pos_.size() );
97 }
98 
99 void NonContinuousFrame::show_pos( std::ostream &out ) const {
100  for ( PosList::const_iterator it = pos_.begin(),
101  eit = pos_.end(); it!=eit; ++it ) {
102  out << RJ( 3, *it ) << " ";
103  }
104 }
105 
106 }
107 }