Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StepWiseProteinFragmentSampleGenerator.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 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file StepWiseProteinFragmentSampleGenerator
11 /// @brief Subclass of StepWisePoseSampleGenerator
12 /// @detailed
13 /// @author Rhiju Das
14 
15 
16 //////////////////////////////////
20 #include <core/fragment/Frame.hh>
22 #include <core/fragment/FragSet.hh>
24 // AUTO-REMOVED #include <core/fragment/FragmentIO.hh>
25 #include <core/types.hh>
26 // AUTO-REMOVED #include <core/pose/Pose.hh>
27 
28 #include <utility/exit.hh>
29 
30 //Auto Headers
31 #include <utility/vector1.hh>
32 
33 using namespace core;
34 
35 namespace protocols {
36 namespace swa {
37 namespace protein {
38 
39  //////////////////////////////////////////////////////////////////////////
40  //constructor!
41  StepWiseProteinFragmentSampleGenerator::StepWiseProteinFragmentSampleGenerator(
42  std::string const frag_file,
43  utility::vector1< core::Size > const & slice_res,
44  utility::vector1< core::Size > const & moving_residues ):
45  count_( 0 )
46  {
47 
48  core::fragment::ConstantLengthFragSetOP fragset = new core::fragment::ConstantLengthFragSet( 0 /*frag_length ... is reset by reader*/, frag_file );
49 
50  if( fragset->max_frag_length() != moving_residues.size() ) {
51  utility_exit_with_message( "Number of -moving_res must match frag size!" );
52  }
53  fragment_set_slice( fragset, slice_res );
54 
55 
57  insert_pos_ = moving_residues[ 1 ];
58  fragset->frames( insert_pos_, frames );
59 
60  frame = frames[1];
61  num_samples_ = frame->nr_frags();
62 
63  }
64 
65  //////////////////////////////////////////////////////////////////////////
66  void
68  count_ = 0;
69  }
70 
71  //////////////////////////////////////////////////////////////////////////
72  bool
74  return (count_ < num_samples_);
75  }
76 
77  //////////////////////////////////////////////////////////////////////////
78  void
80  {
81  count_++;
82  frame->apply( count_, pose );
83  }
84 
85  ///////////////////////////////////////////////////////
86  Size
88  return num_samples_;
89  }
90 
91 
92 }
93 }
94 }