Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
protocols::jd2::JobOutputter Class Referenceabstract

#include <JobOutputter.hh>

Inheritance diagram for protocols::jd2::JobOutputter:
Inheritance graph
[legend]

Public Member Functions

 JobOutputter ()
 constructor – reads cmd-line to initialize evaluators More...
 
 ~JobOutputter () override
 
virtual void flush ()
 this function is meant to be redefined in child classes to allow for flushing of memory buffers. 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. 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 before the fullatom stage begins 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 set_defaults ()
 clear the list of evaluators More...
 

Protected Member Functions

std::string affixed_numbered_name (JobCOP job)
 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. More...
 

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)
 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...
 

Private Attributes

evaluation::PoseEvaluatorsOP evaluators_
 
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.

Constructor & Destructor Documentation

protocols::jd2::JobOutputter::JobOutputter ( )

constructor – reads cmd-line to initialize evaluators

References evaluators_, protocols::jd2::mem_tr, and set_defaults().

protocols::jd2::JobOutputter::~JobOutputter ( )
overridedefault
protocols::jd2::JobOutputter::JobOutputter ( JobOutputter const &  cpy)
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.

Member Function Documentation

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

add another PoseEvaluator to the list of evaluations

References evaluators_.

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

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 protocols::vip::base_name(), protocols::jd2::JobDistributor::get_instance(), no_nstruct_label_, protocols::jd2::JobInputterInputSource::PDB_FILE, prefix_, protocols::jd2::JobInputterInputSource::SCREENING_FILE, protocols::jd2::JobInputterInputSource::SERIALIZED_POSE_FILE, protocols::sparta::split(), and suffix_.

Referenced by protocols::jd2::NoOutputJobOutputter::output_name(), protocols::jd2::ScoreOnlyJobOutputter::output_name(), protocols::jd2::AtomTreeDiffJobOutputter::output_name(), protocols::jd2::wwPDBJobOutputter::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().

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. 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.

base implementation does nothing

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, protocols::jd2::RNA_DeNovoJobOutputter, 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::RNA_DeNovoJobOutputter, protocols::jd2::SilentFileJobOutputter, protocols::jd2::FileJobOutputter, protocols::jd2::wwPDBJobOutputter, protocols::jd2::AtomTreeDiffJobOutputter, protocols::jd2::ScoreOnlyJobOutputter, protocols::jd2::NoOutputJobOutputter, and protocols::enzdes::EnzdesJobOutputter.

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 before the fullatom stage begins in a combined centroid / fullatom protocol.

Implemented in protocols::features::DatabaseJobOutputter, protocols::jd2::RNA_DeNovoJobOutputter, protocols::jd2::SilentFileJobOutputter, protocols::jd2::FileJobOutputter, protocols::jd2::wwPDBJobOutputter, 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::set_defaults ( )

clear the list of evaluators

References no_nstruct_label_, prefix_, and suffix_.

Referenced by JobOutputter().

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
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: