Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PDBJobInputter.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/PDBJobInputter.cc
11 /// @brief August 2008 job distributor as planned at RosettaCon08 - Base class PDBJobInputter
12 /// @author Steven Lewis smlewi@gmail.com
13 
14 ///Unit headers
17 #include <protocols/jd2/Job.hh>
19 
20 ///Project headers
21 
22 // AUTO-REMOVED #include <core/io/pdb/pose_io.hh>
23 #include <core/pose/Pose.hh>
24 
25 ///Utility headers
26 #include <basic/Tracer.hh>
27 #include <basic/options/option.hh>
28 #include <basic/options/util.hh>
29 #include <utility/vector1.hh>
30 
31 ///C++ headers
32 #include <string>
33 
35 
36 
37 // option key includes
38 
39 static basic::Tracer TR("protocols.jd2.PDBJobInputter");
40 
41 namespace protocols {
42 namespace jd2 {
43 
45  TR << "Instantiate PDBJobInputter" << std::endl;
46 }
47 
49 
50 ///@details This function will first see if the pose already exists in the Job. If not, it will read it into the pose reference, and hand a COP cloned from that pose to the Job. If the pose pre-exists it just copies the COP's pose into it.
52  TR << "PDBJobInputter::pose_from_job" << std::endl;
53 
54  if( !job->inner_job()->get_pose() ){
55  TR << "filling pose from PDB " << job->input_tag() << std::endl;
56  core::import_pose::pose_from_pdb( pose, job->input_tag() );
57  load_pose_into_job(pose, job);
58  } else {
59  TR << "filling pose from saved copy " << job->input_tag() << std::endl;
60  pose = *(job->inner_job()->get_pose());
61  }
62 }
63 
64 ///@details this function determines what jobs exist from -s/-l
66  TR << "PDBJobInputter::fill_jobs" << std::endl;
67 
68  jobs.clear(); //should already be empty anyway
69 
70  utility::vector1< std::string > const inputs( basic::options::start_files() );
71  core::Size const nstruct( get_nstruct() );
72 
73  for( core::Size i(1); i <= inputs.size(); ++i){
74  //protocols::jobdist::BasicJob = protocols::jd2::InnerJob
75  //note that we are not really using the second and third fields in this implementation
76  InnerJobOP ijob( new InnerJob( inputs[i], nstruct ) );
77 
78  for( core::Size index(1); index <= nstruct; ++index){
79  jobs.push_back( JobOP( new Job( ijob, index ) ) );
80  TR << "pushing " << inputs[i] << " nstruct index " << index << std::endl;
81  }//loop over nstruct
82  }//loop over inputs
83 }//fill_jobs
84 
85 /// @brief Return the type of input source that the PDBJobInputter is currently
86 /// using.
87 /// @return Always <em>PDB_FILE</em>.
90 }
91 
92 //CREATOR SECTION
95 {
96  return "PDBJobInputter";
97 }
98 
101  return new PDBJobInputter;
102 }
103 
104 }//jd2
105 }//protocols