Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GenericJobInputter.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 protocols/jd2/GenericJobInputter.cc
11 /// @brief August 2008 job distributor as planned at RosettaCon08 - Base class GenericJobInputter
12 /// @author Oliver Lange
13 
14 // Unit headers
17 #include <protocols/jd2/Job.hh>
20 
21 // Project headers
22 // AUTO-REMOVED #include <core/pose/annotated_sequence.hh>
23 #include <core/pose/Pose.hh>
24 #include <core/sequence/util.hh>
26 
27 // Utility headers
28 #include <basic/Tracer.hh>
29 #include <basic/options/option.hh>
30 #include <utility/vector1.hh>
31 
32 // C/C++ headers
33 #include <string>
34 
35 // Utility headers
36 #include <basic/options/keys/OptionKeys.hh>
37 #include <basic/options/keys/in.OptionKeys.gen.hh>
38 #include <basic/options/keys/jd2.OptionKeys.gen.hh>
39 #include <basic/options/keys/run.OptionKeys.gen.hh>
40 
41 
42 static basic::Tracer tr("protocols.comparative_modeling.GenericJobInputter");
43 
44 namespace protocols {
45 namespace comparative_modeling {
46 
48  tr.Debug << "Instantiate GenericJobInputter" << std::endl;
49 }
50 
51 /// @details This function will first see if the pose already exists in the Job.
52 /// If not, it will read it into the pose reference, and hand a COP cloned from
53 /// that pose to the Job. If the pose pre-exists it just copies the COP's pose
54 /// into it.
55 /// why does this code live in comparative_modeling?
58  using std::string;
59  using namespace basic::options;
60  using namespace basic::options::OptionKeys;
61 
62  tr.Debug << "GenericJobInputter::pose_from_job" << std::endl;
63  if( !job->inner_job()->get_pose() ){
64  //fpd if pose is symmetric we need to change SymmetricConformation to Conformation
65  if ( core::pose::symmetry::is_symmetric( pose ) ) {
67  }
68 
69  // Creates an extended, idealized pose from the first sequence in the first
70  // file in -in:file:fasta. Preserves current behavior for the TopologyBroker
71  if (option[OptionKeys::in::file::fasta].user() && option[OptionKeys::run::protocol]() != "broker") {
72  string fasta = option[in::file::fasta]()[1];
73  string sequence = core::sequence::read_fasta_file_str(fasta)[1];
74  ExtendedPoseMover m(sequence);
75  m.apply(pose);
76  }
77  } else {
78  pose = *(job->inner_job()->get_pose());
79  tr.Debug << "filling pose from saved copy " << job->inner_job()->input_tag() << std::endl;
80  }
81 }
82 
83 /// @details this function determines what jobs exist from -s/-l
85  tr.Debug << "GenericJobInputter::fill_jobs" << std::endl;
86 
87  jobs.clear(); //should already be empty anyway
88 
89  core::Size const nstruct( get_nstruct () );
90 
91  //note that we are not really using the second and third fields in this implementation
92  using basic::options::OptionKeys::jd2::generic_job_name; //This option defaults to 'S' for original behavior
93  protocols::jd2::InnerJobOP ijob( new protocols::jd2::InnerJob( basic::options::option[ generic_job_name ].value() , nstruct ) );
94 
95  for( core::Size index = 1; index <= nstruct; ++index) {
96  jobs.push_back( protocols::jd2::JobOP( new protocols::jd2::Job( ijob, index ) ) );
97  tr.Trace << "create job index " << index << std::endl;
98  }
99 }
100 
101 /// @brief Return the type of input source that the GenericJobInputter is currently using
102 /// @return Always <em>POSE</em>.
105 }
106 
107 //CREATOR SECTION
110 {
111  return "GenericJobInputter";
112 }
113 
116  return new GenericJobInputter;
117 }
118 
119 }// comparative_modeling
120 }// protocols