Rosetta  2020.46
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
core::fragment::FragmentIO Class Reference

#include <FragmentIO.hh>

Public Member Functions

 FragmentIO ()
 
 FragmentIO (Size top, Size ncopies=1, bool bAnnotate=true)
 
FragSetOP read_data (std::string const &filename)
 read a FragSet... note that this function caches the fragment set. i.e., if you read the same set from multiple positions in the code you get the same set. if you read a new file ... we'll check the cache for stale references and delete them. NOTE that this is using global data and is thread unsafe and is evil. More...
 
FragSetOP read_data_from_stream (std::string const &filename, std::istream &data)
 
void read_frames_from_file (std::string const &filename, FrameList &)
 
void read_frames_from_stream (std::string const &filename, std::string const &firstline, std::istream &data, FrameList &)
 
void write_data (std::string const &file, FragSet const &frags)
 
FragFactoryget_frag_factory ()
 
void set_top_frag_num (Size setting)
 Updates the number of distinct fragments to keep. More...
 
void set_ncopies (Size setting)
 Updates the number of copies of each fragment to keep (default 1) More...
 
void set_read_annotation (bool setting=true)
 Toggles between reading annotated (true) and non-annotated (false) More...
 
void clean_frag_cache ()
 remove all FragSets that are not referenced outside the cache. More...
 

Private Types

typedef std::map< std::string,
FragSetOP
FragFileCache
 

Private Member Functions

void read_next_frames (std::istream &data, std::string &next_line, FrameList &next_frames)
 
void read_frag_data (std::istream &data, std::string &next_line, FrameList &next_frames)
 

Private Attributes

Size top_
 
Size ncopies_
 
bool bAnnotate_
 

Static Private Attributes

static FragFactory frag_factory_
 
static FragFileCache frag_cache_
 

Member Typedef Documentation

typedef std::map< std::string, FragSetOP > core::fragment::FragmentIO::FragFileCache
private

Constructor & Destructor Documentation

core::fragment::FragmentIO::FragmentIO ( )
inline
core::fragment::FragmentIO::FragmentIO ( Size  top,
Size  ncopies = 1,
bool  bAnnotate = true 
)
inline

Member Function Documentation

void core::fragment::FragmentIO::clean_frag_cache ( )

remove all FragSets that are not referenced outside the cache.

Referenced by protocols::abinitio::IterativeBase::increment_stage(), and read_data().

FragFactory & core::fragment::FragmentIO::get_frag_factory ( void  )

References frag_factory_.

FragSetOP core::fragment::FragmentIO::read_data ( std::string const &  filename)

read a FragSet... note that this function caches the fragment set. i.e., if you read the same set from multiple positions in the code you get the same set. if you read a new file ... we'll check the cache for stale references and delete them. NOTE that this is using global data and is thread unsafe and is evil.

Open a file and construct a FragmentSet from its contents. Note that this function stores the constructed FragmentSet in GLOBAL DATA making it ABSOLUTELY TERRIBLE.

References clean_frag_cache(), protocols::abinitio::filename(), frag_cache_, read_data_from_stream(), and core::fragment::tr().

Referenced by protocols::abinitio::abscript::AbscriptMover::add_frags(), protocols::parser::FragmentReader::apply(), protocols::abinitio::decide_on_beta_jumping_from_frags(), protocols::abinitio::abscript::determine_frag_size(), protocols::abinitio::IterativeBase::gen_enumerate_pairings(), protocols::abinitio::IterativeBase::gen_resample_fragments(), protocols::hybridization::HybridizeProtocol::HybridizeProtocol(), protocols::hybridization::HybridizeProtocol::init(), protocols::abinitio::DomainAssembly::parse_my_tag(), protocols::abinitio::abscript::FragmentCM::parse_my_tag(), protocols::abinitio::abscript::AbscriptLoopCloserCM::parse_my_tag(), protocols::hybridization::HybridizeProtocol::parse_my_tag(), protocols::struct_fragment::StructFragmentMover::read_frag_file(), protocols::topology_broker::read_frags(), protocols::loops::read_loop_fragments(), core::fragment::read_std_frags_from_cmd(), and protocols::mpi_refinement::WorkUnit_PartialAbinitio::run().

FragSetOP core::fragment::FragmentIO::read_data_from_stream ( std::string const &  filename,
std::istream &  data 
)

With the opened file, read the first line to determine the format of the fragment file, and then construct the appropriate FragmentSet. Note that this function does not store the fragment set in the abomination that is the frag_cache_

References bAnnotate_, ncopies_, read_frames_from_stream(), protocols::kinmatch::str(), top_, and core::fragment::tr().

Referenced by core::fragment::FragmentSetLoader::create_resource(), and read_data().

void core::fragment::FragmentIO::read_frag_data ( std::istream &  data,
std::string &  next_line,
FrameList next_frames 
)
private
void core::fragment::FragmentIO::read_frames_from_file ( std::string const &  filename,
FrameList frames 
)
void core::fragment::FragmentIO::read_frames_from_stream ( std::string const &  filename,
std::string const &  firstline,
std::istream &  data,
FrameList all_frames 
)
void core::fragment::FragmentIO::read_next_frames ( std::istream &  data,
std::string &  next_line,
FrameList next_frames 
)
private
void core::fragment::FragmentIO::set_ncopies ( Size  setting)
inline

Updates the number of copies of each fragment to keep (default 1)

References ncopies_.

Referenced by protocols::topology_broker::read_frags().

void core::fragment::FragmentIO::set_read_annotation ( bool  setting = true)
inline

Toggles between reading annotated (true) and non-annotated (false)

References bAnnotate_.

Referenced by protocols::topology_broker::read_frags().

void core::fragment::FragmentIO::set_top_frag_num ( Size  setting)
inline

Updates the number of distinct fragments to keep.

References top_.

Referenced by protocols::topology_broker::read_frags().

void core::fragment::FragmentIO::write_data ( std::string const &  file,
FragSet const &  frags 
)

Member Data Documentation

bool core::fragment::FragmentIO::bAnnotate_
private
FragmentIO::FragFileCache core::fragment::FragmentIO::frag_cache_
staticprivate

Referenced by read_data().

FragFactory core::fragment::FragmentIO::frag_factory_
staticprivate
Size core::fragment::FragmentIO::ncopies_
private
Size core::fragment::FragmentIO::top_
private

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