Rosetta Protocols  2014.35
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
protocols::jd2::JobOutputter Class Referenceabstract

#include <JobOutputter.hh>

Public Member Functions

 JobOutputter ()
 
virtual ~JobOutputter ()
 
virtual void flush ()
 this function is meant to be redefined in child classes to allow for flushing of memory buffers. More...
 
virtual void file (JobCOP job, std::string const &data)=0
 this function takes a string and writes it to disk (separately from Tracer output). use some sort of extention option system - default .dat? .data? More...
 
virtual void final_pose (JobOP job, core::pose::Pose const &pose, std::string const &tag="")=0
 this function outputs the final result of a job. More...
 
virtual void other_pose (JobOP job, core::pose::Pose const &pose, std::string const &tag, int copy_count=-1, bool score_only=false)=0
 this function is intended for saving mid-protocol poses; for example the final centroid structure in a combined centroid/fullatom protocol. More...
 
virtual void starting_pose (core::pose::Pose const &)
 optionally pass a starting (reference) pose to a JobOutputter for later comparison purposes and/or as interface for initializing evaluators More...
 
virtual bool job_has_completed (JobCOP job)=0
 this function is not used for output, but it belongs here since it needs to check the same output locations as the class normally writes to. This class checks wherever output goes to see if the job's expected output already exists (on disk or whatever). This is the most basic form of checkpointing. More...
 
virtual std::string output_name (JobCOP job)=0
 this is the master function for determining the unique output identifier for a job - should this be defined in the base class? More...
 
virtual std::string filename (JobCOP) const
 
void add_evaluation (evaluation::PoseEvaluatorOP)
 
void set_evaluators (evaluation::PoseEvaluators const &)
 
void clear_evaluators ()
 clear the list of evaluators More...
 
evaluation::PoseEvaluatorsCOP evaluators () const
 
void evaluate (core::pose::Pose &pose, std::string tag, core::io::silent::SilentStruct &pss) const
 
void call_output_observers (core::pose::Pose const &pose, JobOP job) const
 call all output_observers More...
 
void add_output_observer (JobOutputterObserverAP an_observer)
 
void remove_output_observer (JobOutputterObserverAP old_observer)
 
void set_defaults ()
 clear the list of evaluators More...
 

Protected Member Functions

std::string affixed_numbered_name (JobCOP job)
 this function provides the extended name, not just the output name. e.g output_name returns 1UBQ_0001, this returns 1UBQ_0001.pdb More...
 

Private Types

typedef std::set
< JobOutputterObserverAP
JobOutputterObservers
 

Private Member Functions

JobOutputteroperator= (JobOutputter const &rhs)
 operator= defined for the sake of the remove-headers-in-headers initiative. As of this writing, there is no reason to actually call this function, so it is declared but UNIMPLEMENTED to force compiler errors if you try to do this (instead of allowing the compiler to autogenerate the code). If you have a valid need for this function, feel free to implement it properly and make it a public function. More...
 
 JobOutputter (JobOutputter const &cpy)
 copy ctor defined for the sake of the remove-headers-in-headers initiative. As of this writing, there is no reason to actually call this function, so it is declared but UNIMPLEMENTED to force compiler errors if you try to do this (instead of allowing the compiler to autogenerate the code). If you have a valid need for this function, feel free to implement it properly and make it a public function. More...
 

Private Attributes

evaluation::PoseEvaluatorsOP evaluators_
 
JobOutputterObservers output_observers_
 
std::string prefix_
 
std::string suffix_
 
bool no_nstruct_label_
 

Detailed Description

the JobOutputter class is responsible for dealing with output, as well as determining what jobs have already been output and what sort of name is associated with a job. Derived classes will be responsible for output such as PDBS, PDBS.tar.gz and silent files.

Member Typedef Documentation

Constructor & Destructor Documentation

protocols::jd2::JobOutputter::JobOutputter ( )
protocols::jd2::JobOutputter::~JobOutputter ( )
virtual
protocols::jd2::JobOutputter::JobOutputter ( JobOutputter const &  cpy)
private

copy ctor defined for the sake of the remove-headers-in-headers initiative. As of this writing, there is no reason to actually call this function, so it is declared but UNIMPLEMENTED to force compiler errors if you try to do this (instead of allowing the compiler to autogenerate the code). If you have a valid need for this function, feel free to implement it properly and make it a public function.

Member Function Documentation

void protocols::jd2::JobOutputter::add_evaluation ( evaluation::PoseEvaluatorOP  ev_in)

add another PoseEvaluator to the list of evaluations

References evaluators_.

void protocols::jd2::JobOutputter::add_output_observer ( JobOutputterObserverAP  an_observer)

References output_observers_.

std::string protocols::jd2::JobOutputter::affixed_numbered_name ( JobCOP  job)
protected

this function provides the extended name, not just the output name. e.g output_name returns 1UBQ_0001, this returns 1UBQ_0001.pdb

this function generates the affixed, numbered name for the job as prefix + input + suffix + number (affixes from options system). This function is deliberately not virtual, this should be a common mechanism; your JobOutputter can not call it if it would like.

this is copied from protocols/jobdist/Jobs.cc, r24761 Checks the current JobInputter input source from the singleton instance of JobDistributor. If a PDB_FILE, it will deliberately discard any path information in the input tag as well as any file name extension (since input tags are usually file names). Otherwise, it will keep the entire input tag as-is.

References utility::file::FileName::base(), protocols::vip::base_name(), utility::file::combine_names(), protocols::jd2::JobDistributor::get_instance(), no_nstruct_label_, nstruct, protocols::jd2::JobInputterInputSource::PDB_FILE, prefix, prefix_, protocols::jd2::JobInputterInputSource::SCREENING_FILE, utility::split(), and suffix_.

Referenced by protocols::jd2::NoOutputJobOutputter::output_name(), protocols::jd2::ScoreOnlyJobOutputter::output_name(), protocols::jd2::AtomTreeDiffJobOutputter::output_name(), protocols::jd2::PDBJobOutputter::output_name(), protocols::jd2::SilentFileJobOutputter::output_name(), and protocols::features::DatabaseJobOutputter::output_name().

void protocols::jd2::JobOutputter::call_output_observers ( core::pose::Pose const &  pose,
JobOP  job 
) const
void protocols::jd2::JobOutputter::clear_evaluators ( )

clear the list of evaluators

References evaluators_.

void protocols::jd2::JobOutputter::evaluate ( core::pose::Pose pose,
std::string  tag,
core::io::silent::SilentStruct pss 
) const

run the PoseEvaluators on the pose evaluation creates string value pairs which end up in the SilentStruct energy object instead of filling things into a SilentStruct we could provide a different interface... wait until Steven has finished his string/value pair output

References evaluators(), and size().

Referenced by protocols::jd2::SilentFileJobOutputter::dump_pose().

evaluation::PoseEvaluatorsCOP protocols::jd2::JobOutputter::evaluators ( ) const

return the list of PoseEvaluators

References evaluators_.

Referenced by evaluate().

virtual void protocols::jd2::JobOutputter::file ( JobCOP  job,
std::string const &  data 
)
pure virtual

this function takes a string and writes it to disk (separately from Tracer output). use some sort of extention option system - default .dat? .data?

Implemented in protocols::jd2::FileJobOutputter, and protocols::jd2::NoOutputJobOutputter.

virtual std::string protocols::jd2::JobOutputter::filename ( JobCOP  ) const
inlinevirtual
virtual void protocols::jd2::JobOutputter::final_pose ( JobOP  job,
core::pose::Pose const &  pose,
std::string const &  tag = "" 
)
pure virtual
void protocols::jd2::JobOutputter::flush ( )
virtual

this function is meant to be redefined in child classes to allow for flushing of memory buffers.

base implementation does nothing

Here's the long version: The SilentFileJobOutputter wanted to buffer output, but needed to guaruntee that the output would be flushed at end of runtime. The original implementation was to A) bend over backward to ensure that the destructor was run (JobOutputter lives inside static JobDistributor, which was previously not destructed because it's static) and B) flush the buffers in the destructor. This caused a problem because the buffer-flushing tried to use the Tracers, which had already been destructed...boom crash.

New solution: re-forbid use of destructors within the static JobDistributor system, and create a flush function to force this stuff out. So here it is:

Reimplemented in protocols::features::DatabaseJobOutputter, and protocols::jd2::SilentFileJobOutputter.

virtual bool protocols::jd2::JobOutputter::job_has_completed ( JobCOP  job)
pure virtual

this function is not used for output, but it belongs here since it needs to check the same output locations as the class normally writes to. This class checks wherever output goes to see if the job's expected output already exists (on disk or whatever). This is the most basic form of checkpointing.

Implemented in protocols::features::DatabaseJobOutputter, protocols::jd2::SilentFileJobOutputter, protocols::jd2::PDBJobOutputter, protocols::jd2::FileJobOutputter, protocols::jd2::ScoreOnlyJobOutputter, protocols::jd2::AtomTreeDiffJobOutputter, and protocols::jd2::NoOutputJobOutputter.

JobOutputter& protocols::jd2::JobOutputter::operator= ( JobOutputter const &  rhs)
private

operator= defined for the sake of the remove-headers-in-headers initiative. As of this writing, there is no reason to actually call this function, so it is declared but UNIMPLEMENTED to force compiler errors if you try to do this (instead of allowing the compiler to autogenerate the code). If you have a valid need for this function, feel free to implement it properly and make it a public function.

virtual void protocols::jd2::JobOutputter::other_pose ( JobOP  job,
core::pose::Pose const &  pose,
std::string const &  tag,
int  copy_count = -1,
bool  score_only = false 
)
pure virtual

this function is intended for saving mid-protocol poses; for example the final centroid structure in a combined centroid/fullatom protocol.

Implemented in protocols::features::DatabaseJobOutputter, protocols::jd2::SilentFileJobOutputter, protocols::jd2::PDBJobOutputter, protocols::jd2::FileJobOutputter, protocols::jd2::AtomTreeDiffJobOutputter, protocols::jd2::ScoreOnlyJobOutputter, and protocols::jd2::NoOutputJobOutputter.

virtual std::string protocols::jd2::JobOutputter::output_name ( JobCOP  job)
pure virtual
void protocols::jd2::JobOutputter::remove_output_observer ( JobOutputterObserverAP  old_observer)

References output_observers_.

void protocols::jd2::JobOutputter::set_defaults ( )
void protocols::jd2::JobOutputter::set_evaluators ( evaluation::PoseEvaluators const &  ev_in)

set a list of Evaluations ( the list will be copied, the evaluations are OPs )

References evaluators_.

void protocols::jd2::JobOutputter::starting_pose ( core::pose::Pose const &  )
virtual

optionally pass a starting (reference) pose to a JobOutputter for later comparison purposes and/or as interface for initializing evaluators

optionally pass a starting (reference) pose to a JobOutputter for comparison purposes and/or as interface for initializing evaluators. (Currently does nothing in this base class.)

Reimplemented in protocols::dna::PDBOutput.

Member Data Documentation

evaluation::PoseEvaluatorsOP protocols::jd2::JobOutputter::evaluators_
private
bool protocols::jd2::JobOutputter::no_nstruct_label_
private
JobOutputterObservers protocols::jd2::JobOutputter::output_observers_
private
std::string protocols::jd2::JobOutputter::prefix_
private
std::string protocols::jd2::JobOutputter::suffix_
private

The documentation for this class was generated from the following files: