![]() |
Rosetta Protocols
2014.16.56682
|
Each Job object describes a particular input to Rosetta. More...
#include <Jobs.hh>
Public Member Functions | |
| BasicJob (std::string input_tag, std::string native_tag, int nstruct=1) | |
| You MUST ensure that input_tag is a UNIQUE identifier for this Job! More... | |
| virtual | ~BasicJob () |
| virtual int | nstruct () const |
| The number of times this job should be repeated. More... | |
| virtual std::string | input_tag () const |
| The tag supplied at create time. More... | |
| virtual std::string | native_tag () const |
| The tag supplied at create time. More... | |
| virtual std::string | output_tag (int struct_n) const |
| The tag supplied at create time plus the nstruct number (from 1 to nstruct inclusive). More... | |
| virtual std::string | output_file_name () const |
| The tag supplied at create time plus the nstruct number (from 1 to nstruct inclusive). More... | |
| void | set_output_file_name (std::string str) |
| The tag supplied at create time plus the nstruct number (from 1 to nstruct inclusive). More... | |
| template<typename T > | |
| bool | get (std::string const &key, T &value) |
| Extracts named value. Works for anything that deserializes from string. Returns false on error. More... | |
| bool | get (std::string const &key, std::string &value) |
| Specialization for strings. More... | |
| template<typename T > | |
| void | set (std::string const &key, T const &value) |
| Set named value. Works for anything that serializes to a string. More... | |
| void | set (std::string const &key, std::string const &value) |
| Specialization for strings. More... | |
| void | set_preserve_whole_input_tag (bool setting) |
Protected Attributes | |
| std::string | input_id_ |
| std::string | native_id_ |
| int | nstruct_ |
| name of the native More... | |
| std::map< std::string, std::string > | extra_data_ |
| std::string | output_file_name_ |
| bool | preserve_whole_input_tag_ |
Each Job object describes a particular input to Rosetta.
Ordinarily, an input is just a single PDB file. In other cases, e.g. docking, input might be a pair of PDB files. In still other cases, input might be a list of tags to extract from a silent file. And so on. One BasicJob class is defined below that should meet most needs, but if you need to carry additional information, you can subclass it.
Contains a map of strings to strings that can be used to store arbitrary extra data if you're too lazy to make a subclass. Templated get/set functions accept anything that can be read from and written to a C++ stream with >> and << operators. All data is stored as strings internally. Some numeric data may experience slight round-off error, though I think we're storing enough digits to avoid that.
Example: BasicJob jobdata("1abc.pdb", 10); jobdata.set("cmp_to", "1xyz.pdb"); jobdata.set("score", 42.42);
std::string cmp_to; core::Real score; if( jobdata.get("cmp_to", cmp_to) ) std::cout << "cmp_to = " << cmp_to << std::endl; else std::cout << "Unable to recover cmp_to!" << std::endl; if( jobdata.get("score", score) ) std::cout << "score = " << score << std::endl; else std::cout << "Unable to recover score!" << std::endl;
Although Jobs are small objects, it is common for Rosetta to loop many times over the same input. In order to avoid creating (size of -s and -l) * (nstruct) JobData objects, each Job also has an nstruct counter.
So, each Job represents a unique input, and each tuple of (Job, struct_n) represents a unique output.
|
inline |
You MUST ensure that input_tag is a UNIQUE identifier for this Job!
|
inlinevirtual |
|
inline |
Extracts named value. Works for anything that deserializes from string. Returns false on error.
References extra_data_, and key.
|
inline |
Specialization for strings.
References extra_data_, and key.
|
inlinevirtual |
The tag supplied at create time.
References input_id_.
|
inlinevirtual |
The tag supplied at create time.
References native_id_.
|
inlinevirtual |
The number of times this job should be repeated.
References nstruct_.
|
inlinevirtual |
The tag supplied at create time plus the nstruct number (from 1 to nstruct inclusive).
References output_file_name_.
|
virtual |
The tag supplied at create time plus the nstruct number (from 1 to nstruct inclusive).
Deliberately discards any path information in the input tag as well as any file name extension (since input tags are usually file names). There is some possibility this could lead to non-unique output tags, which deserves further consideration at some point...
References utility::file::combine_names(), input_id_, nstruct_, basic::options::option, option, out::prefix, preserve_whole_input_tag_, run::shuffle, utility::split(), out::suffix, user, user_tag, and basic::options::OptionKeys::out::user_tag.
|
inline |
Set named value. Works for anything that serializes to a string.
References extra_data_.
|
inline |
Specialization for strings.
References extra_data_.
|
inline |
The tag supplied at create time plus the nstruct number (from 1 to nstruct inclusive).
References output_file_name_, and protocols::kinmatch::str().
|
inline |
References preserve_whole_input_tag_.
|
protected |
|
protected |
Referenced by input_tag(), and output_tag().
|
protected |
Referenced by native_tag().
|
protected |
name of the native
Referenced by nstruct(), and output_tag().
|
protected |
Referenced by output_file_name(), and set_output_file_name().
|
protected |
Referenced by output_tag(), and set_preserve_whole_input_tag().
1.8.7