Rosetta 3.4
Classes | Public Member Functions
core::io::silent::SilentFileData Class Reference

Abstract base class for classes that read and write different types of silent-files. Silent-files can contain SilentStruct objects which are expected, to be uniquely identified by some sort of string-based tag inside the file. More...

#include <SilentFileData.hh>

Inheritance diagram for core::io::silent::SilentFileData:
Inheritance graph
[legend]
Collaboration diagram for core::io::silent::SilentFileData:
Collaboration graph
[legend]

List of all members.

Classes

class  const_iterator
 const_iterator class for SilentFileData container. More...
class  iterator
 Iterator class for SilentFileData container. More...

Public Member Functions

 SilentFileData ()
 SilentFileData (std::string const &filename)
 SilentFileData (const std::string &filename, bool store_argv_in_file, bool strict_column_mode, const std::string &silent_struct_type)
bool read_file (std::string const &filename)
 Read in the SilentStruct objects contained in the given filename. this version will throw an exception if things go wrong (boolean return value is thus always true)
bool _read_file (std::string const &filename, bool throw_exception_on_bad_structs=false)
 Read in the SilentStruct objects contained in the given filename. this version returns with a boolean to tell you about success.
bool read_file (std::string const &filename, utility::vector1< std::string > const &tags)
 Read in the SilentStruct objects contained in the given filename. Ignore any SilentStruct with a tag not in the tags vector. throw an exception if things go wrong (returned boolean always true)
bool read_stream (std::istream &data, utility::vector1< std::string > const &tags, bool throw_exception_on_bad_structs, std::string filename="read_from_stream")
bool _read_file (std::string const &filename, utility::vector1< std::string > const &tags, bool throw_exception_on_bad_structs=false)
 Read in the SilentStruct objects contained in the given filename. Ignore any SilentStruct with a tag not in the tags vector. returns with a boolean to tell about success.
bool store_argv_in_file () const
 Returns true if this silent-file plans on storing option.get_argv() as a comment in the silent-file, false otherwise.
void store_argv_in_file (bool new_setting)
 Sets a boolean variable governing if this silent-file plans on storing option.get_argv() as a comment in the silent-file.
bool write_silent_struct (SilentStruct &s, std::string const &filename, bool bWriteScoreOnly=false) const
 Write the given silent-struct to the given outfile.
bool _write_silent_struct (SilentStruct &s, std::ostream &out, bool bWriteScoreOnly=false) const
bool write_silent_struct (SilentStruct &s, std::ostream &out, bool bWriteScoreOnly=false) const
 Write the given silent-struct to the given ostream.
void write_comment (std::ostream &out, std::string const &line) const
 Write a comment to the given output stream.
Size size () const
 Returns the number of structures contained in this container.
int nres () const
 Returns the number of residues in the first structure in this object. Not guaranteed to be fixed for all structures in this container.
void set_filename (std::string filename)
 Sets the filename that this SilentFileData object will write to.
SilentStructOP operator[] (std::string tag)
std::string const & filename () const
 Gets the filename that this SilentFileData object will write to.
utility::vector1< std::string > tags () const
 Return all tags in this container.
utility::vector1< std::string > read_tags_fast (std::string const &filename) const
 quickly read a list of tags from a silent-input file. Only checks lines beginning with SCORE: strings.
bool read_tags_fast (std::string const &filename, utility::vector1< std::string > &) const
 quickly read a list of tags from a silent-input file. Only checks lines beginning with SCORE: strings.
bool matched_tags (std::string const &expression, std::string const &mode, utility::vector1< std::string > &tags_in_file) const
 return mode=first,last,all matched tags -- currently matching 'expression*' to tags in file, boost::regexp possible later
bool strict_column_mode () const
 Returns a boolean indicating whether or not the strict_column_mode is turned on when printing scores.
void strict_column_mode (bool new_mode)
 Sets value for strict column mode. See strict_column_mode() for more information.
void set_record_source (bool const &new_mode)
bool has_tag (std::string const &tag) const
 Returns true if we have a SilentStruct matching the given tag, false otherwise.
utility::vector1< std::string > comment_lines ()
 Returns a vector1 of the comment lines read in from a silent-file. Comment lines are any lines in the silent-file beginning with a # character.
void comment_line (std::string const &line)
 Adds a comment-line that will be printed in write_all method. Comment lines are simply lines in the silent-file that begin with the # character, and are printed in the write_all method.
void score_filter (Real const score_fraction)
 Removes the worst ( 1 - score_fraction ) percent of the decoys by score. The value of score_fraction should be between 0 and 1.0.
void reverse_score_filter (Real const score_fraction)
void order_by_energy ()
 Orders silent structs by energy.
void add_structure_replace_tag_if_necessary (SilentStructOP &new_struct)
void add_structure (SilentStructOP const &new_struct)
 Adds a SilentStructOP to the structure_map_. If the SilentStruct's tag already exists in the structure_map_, a new tag is assigned. Careful with this method, as it stores an owning pointer. If you change the SilentStruct later, it will change your already stored structures.
void push_back (SilentStructOP const &new_struct)
 push_back to provide compatibility with other std containers.
void add_structure (SilentStruct const &new_struct)
 Saves a copy of the silent struct. This method is:
SilentStruct const & get_structure (const std::string &tag) const
 Return a SilentStruct referred to by the given tag. Assumes that we have checked the tag!!
void clear_structure_map ()
 Remove all of the SilentStruct objects from this object.
void clear ()
 Clears all of the data associated with this object.
virtual ~SilentFileData ()
 Destructor.
void write_all (std::string const &filename, bool bWriteScoreOnly=false) const
 write all SilentStruct objects in the structure_map_ to the given filename.
void renumber_all_decoys ()
 renumber all of the decoys in this SilentFileData object. This obliterates decoy tag associated with every SilentStruct object, and tries to sensibly number the decoys with similar and increasingly numbered decoy tags.
SilentStructOP create_SilentStructOP ()
 creates a SilentStructOP using command-line options. Just a wrapper around SilentStructFactory::get_instance()->get_silent_struct_in().
SharedSilentDataOP get_shared_silent_data (SharedSilentDataType ssdt) const
 SharedSilentData methods.
void set_shared_silent_data (SharedSilentDataType ssdt, SharedSilentDataOP ssd_op) const
bool has_shared_silent_data (SharedSilentDataType ssdt) const
iterator begin ()
 Returns an iterator to the start of the members of this container.
const_iterator begin () const
 Returns an iterator to the start of the members of this container.
iterator end ()
 Returns an iterator to the end of the members of this container.
const_iterator end () const
 Returns an iterator to the end of the members of this container.

Detailed Description

Abstract base class for classes that read and write different types of silent-files. Silent-files can contain SilentStruct objects which are expected, to be uniquely identified by some sort of string-based tag inside the file.


Constructor & Destructor Documentation

core::io::silent::SilentFileData::SilentFileData ( ) [inline]
core::io::silent::SilentFileData::SilentFileData ( std::string const &  filename) [inline]
core::io::silent::SilentFileData::SilentFileData ( const std::string &  filename,
bool  store_argv_in_file,
bool  strict_column_mode,
const std::string &  silent_struct_type 
) [inline]
virtual core::io::silent::SilentFileData::~SilentFileData ( ) [inline, virtual]

Destructor.

References clear_structure_map().


Member Function Documentation

bool core::io::silent::SilentFileData::_read_file ( std::string const &  filename,
bool  throw_exception_on_bad_structs = false 
)

Read in the SilentStruct objects contained in the given filename. this version returns with a boolean to tell you about success.

References read_tags_fast(), core::io::silent::RG(), and core::io::silent::tr().

Referenced by read_file().

bool core::io::silent::SilentFileData::_read_file ( std::string const &  filename,
utility::vector1< std::string > const &  tags,
bool  throw_exception_on_bad_structs = false 
)

Read in the SilentStruct objects contained in the given filename. Ignore any SilentStruct with a tag not in the tags vector. returns with a boolean to tell about success.

References read_stream().

bool core::io::silent::SilentFileData::_write_silent_struct ( SilentStruct s,
std::ostream &  out,
bool  bWriteScoreOnly = false 
) const
void core::io::silent::SilentFileData::add_structure ( SilentStruct const &  new_struct)

Saves a copy of the silent struct. This method is:

  • SAFE! in the sense that it actually copies the SilentStruct object, not just the pointer to the object.
  • SLOW! in the sense that copying the object takes a small amount of time.

References add_structure(), and core::io::silent::SilentStruct::clone().

void core::io::silent::SilentFileData::add_structure ( SilentStructOP const &  new_struct)
void core::io::silent::SilentFileData::add_structure_replace_tag_if_necessary ( SilentStructOP new_struct)
iterator core::io::silent::SilentFileData::begin ( ) [inline]
const_iterator core::io::silent::SilentFileData::begin ( ) const [inline]

Returns an iterator to the start of the members of this container.

void core::io::silent::SilentFileData::clear ( ) [inline]

Clears all of the data associated with this object.

References clear_structure_map().

void core::io::silent::SilentFileData::clear_structure_map ( ) [inline]

Remove all of the SilentStruct objects from this object.

Referenced by clear(), renumber_all_decoys(), and ~SilentFileData().

void core::io::silent::SilentFileData::comment_line ( std::string const &  line) [inline]

Adds a comment-line that will be printed in write_all method. Comment lines are simply lines in the silent-file that begin with the # character, and are printed in the write_all method.

utility::vector1< std::string > core::io::silent::SilentFileData::comment_lines ( ) [inline]

Returns a vector1 of the comment lines read in from a silent-file. Comment lines are any lines in the silent-file beginning with a # character.

Referenced by protocols::wum::SilentStructStore::read_from_stream().

SilentStructOP core::io::silent::SilentFileData::create_SilentStructOP ( )
iterator core::io::silent::SilentFileData::end ( ) [inline]
const_iterator core::io::silent::SilentFileData::end ( ) const [inline]

Returns an iterator to the end of the members of this container.

std::string const& core::io::silent::SilentFileData::filename ( ) const [inline]
SharedSilentDataOP core::io::silent::SilentFileData::get_shared_silent_data ( SharedSilentDataType  ssdt) const
SilentStruct const& core::io::silent::SilentFileData::get_structure ( const std::string &  tag) const [inline]

Return a SilentStruct referred to by the given tag. Assumes that we have checked the tag!!

Referenced by protocols::abinitio::KinematicAbinitio::apply().

bool core::io::silent::SilentFileData::has_shared_silent_data ( SharedSilentDataType  ssdt) const

Referenced by write_silent_struct().

bool core::io::silent::SilentFileData::has_tag ( std::string const &  tag) const [inline]

Returns true if we have a SilentStruct matching the given tag, false otherwise.

Referenced by add_structure(), add_structure_replace_tag_if_necessary(), protocols::abinitio::KinematicAbinitio::apply(), and operator[]().

bool core::io::silent::SilentFileData::matched_tags ( std::string const &  expression,
std::string const &  mode,
utility::vector1< std::string > &  tags_in_file 
) const

return mode=first,last,all matched tags -- currently matching 'expression*' to tags in file, boost::regexp possible later

References filename().

Referenced by protocols::canonical_sampling::SilentTrajectoryRecorder::restart_simulation().

int core::io::silent::SilentFileData::nres ( ) const

Returns the number of residues in the first structure in this object. Not guaranteed to be fixed for all structures in this container.

References begin().

SilentStructOP core::io::silent::SilentFileData::operator[] ( std::string  tag)

References has_tag().

void core::io::silent::SilentFileData::order_by_energy ( )

Orders silent structs by energy.

References begin(), and end().

void core::io::silent::SilentFileData::push_back ( SilentStructOP const &  new_struct) [inline]

push_back to provide compatibility with other std containers.

References add_structure().

Referenced by protocols::jd2::archive::ArchiveBase::restore_from_file().

bool core::io::silent::SilentFileData::read_file ( std::string const &  filename)
bool core::io::silent::SilentFileData::read_file ( std::string const &  filename,
utility::vector1< std::string > const &  tags 
)

Read in the SilentStruct objects contained in the given filename. Ignore any SilentStruct with a tag not in the tags vector. throw an exception if things go wrong (returned boolean always true)

References _read_file().

bool core::io::silent::SilentFileData::read_stream ( std::istream &  data,
utility::vector1< std::string > const &  tags,
bool  throw_exception_on_bad_structs,
std::string  filename = "read_from_stream" 
)
utility::vector1< std::string > core::io::silent::SilentFileData::read_tags_fast ( std::string const &  filename) const

quickly read a list of tags from a silent-input file. Only checks lines beginning with SCORE: strings.

Referenced by _read_file(), protocols::canonical_sampling::CanonicalSamplingMover::apply(), protocols::jd2::archive::ArchiveManager::jobs_completed(), and protocols::jobdist::PlainSilentFileJobDistributor::startup().

bool core::io::silent::SilentFileData::read_tags_fast ( std::string const &  filename,
utility::vector1< std::string > &  tags_in_file 
) const

quickly read a list of tags from a silent-input file. Only checks lines beginning with SCORE: strings.

void core::io::silent::SilentFileData::renumber_all_decoys ( )

renumber all of the decoys in this SilentFileData object. This obliterates decoy tag associated with every SilentStruct object, and tries to sensibly number the decoys with similar and increasingly numbered decoy tags.

References clear_structure_map().

void core::io::silent::SilentFileData::reverse_score_filter ( Real const  score_fraction)

References begin(), end(), and core::io::silent::tr().

Referenced by score_filter().

void core::io::silent::SilentFileData::score_filter ( Real const  score_fraction)

Removes the worst ( 1 - score_fraction ) percent of the decoys by score. The value of score_fraction should be between 0 and 1.0.

References begin(), end(), reverse_score_filter(), and core::io::silent::tr().

void core::io::silent::SilentFileData::set_filename ( std::string  filename) [inline]
void core::io::silent::SilentFileData::set_record_source ( bool const &  new_mode) [inline]
void core::io::silent::SilentFileData::set_shared_silent_data ( SharedSilentDataType  ssdt,
SharedSilentDataOP  ssd_op 
) const
Size core::io::silent::SilentFileData::size ( ) const [inline]
void core::io::silent::SilentFileData::store_argv_in_file ( bool  new_setting) [inline]

Sets a boolean variable governing if this silent-file plans on storing option.get_argv() as a comment in the silent-file.

bool core::io::silent::SilentFileData::store_argv_in_file ( ) const [inline]

Returns true if this silent-file plans on storing option.get_argv() as a comment in the silent-file, false otherwise.

Referenced by write_silent_struct().

bool core::io::silent::SilentFileData::strict_column_mode ( ) const [inline]

Returns a boolean indicating whether or not the strict_column_mode is turned on when printing scores.

Detailed: If strict_column_mode() is true, then the first SilentStruct
printed to this SilentFileData object sets the EnergyNames that will be printed for all other SilentStruct objects. Extra EnergyNames in subsequent SilentStruct objects are ignored. If new objects are missing energies that should be printed in strict_column_mode, missing energy values are set to zero. In !strict_column_mode(), when each SilentStruct is printed, a new SCORE: header is printed if energies differ from last printed SilentStruct.

Referenced by protocols::abinitio::AbrelaxApplication::fold(), and write_silent_struct().

void core::io::silent::SilentFileData::strict_column_mode ( bool  new_mode) [inline]

Sets value for strict column mode. See strict_column_mode() for more information.

utility::vector1< std::string > core::io::silent::SilentFileData::tags ( ) const

Return all tags in this container.

Referenced by protocols::ddG::ddGData::read_mut_data(), and protocols::ddG::ddGData::read_wt_data().

void core::io::silent::SilentFileData::write_all ( std::string const &  filename,
bool  bWriteScoreOnly = false 
) const
void core::io::silent::SilentFileData::write_comment ( std::ostream &  out,
std::string const &  line 
) const

Write a comment to the given output stream.

Referenced by write_silent_struct().

bool core::io::silent::SilentFileData::write_silent_struct ( SilentStruct s,
std::ostream &  out,
bool  bWriteScoreOnly = false 
) const
bool core::io::silent::SilentFileData::write_silent_struct ( SilentStruct s,
std::string const &  filename,
bool  bWriteScoreOnly = false 
) const

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines