Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
core::import_pose::atom_tree_diffs::AtomTreeDiff Class Reference

An object wrapper for reading atom_tree_diff files, complete with embedded reference structures. More...

#include <atom_tree_diff.hh>

Inheritance diagram for core::import_pose::atom_tree_diffs::AtomTreeDiff:
Inheritance graph
[legend]

Public Member Functions

 AtomTreeDiff ()
 
 AtomTreeDiff (std::string filename)
 
 ~AtomTreeDiff () override
 
bool has_ref_pose (std::string const &tag) const
 returns true if a reference struct with the given tag is present More...
 
bool has_tag (std::string const &tag) const
 True if a (non-reference) structure with the given tag is present in the file. More...
 
bool has_ref_tag (std::string const &tag) const
 
ScoresPairList const & scores () const
 Return list of (pose tag, score sets) pairs for all poses, in file order. More...
 
void read_pose (std::string const &tag, core::pose::Pose &pose_out)
 Reads the pose data from file and reconstructs the complete pose. More...
 
void read_pose (std::string const &tag, core::pose::Pose &pose_out, core::pose::Pose const &ref_pose)
 Reads the pose data from file and reconstructs the complete pose, using the supplied reference pose. More...
 
void read_file (std::string filename)
 
core::pose::PoseCOP ref_pose_for (std::string const &tag)
 Returns the default reference pose for the given tag. Fails if none is available. More...
 
core::pose::PoseOPs const & all_ref_poses () const
 Allows access to and mutation of (!) the references poses stored in this file. Use with caution. More...
 
RefTags const & get_ref_tags () const
 
TagScoreMap const & get_tag_score_map () const
 
int count (std::string const &tag) const
 

Static Public Member Functions

static void sort_by (std::string const &score_name, ScoresPairList &scores, bool descending=false)
 Utility function for selecting subsets of structures by score. More...
 

Private Member Functions

 AtomTreeDiff (AtomTreeDiff const &)
 

Private Attributes

ScoresPairList scores_
 
RefTags ref_tags_
 
TagScoreMap tag_idx_
 Maps tags to indices in scores_. More...
 
std::map< std::string, long > offsets_
 The map of (tag, file position) for getting random access to the structural data. More...
 
std::map< std::string,
core::pose::PoseOP
ref_poses_
 The map of (tag, reference pose) for decoding the diffs. Some could be null. More...
 
core::pose::PoseOPs unique_ref_poses_
 All references poses from the file, one copy each for convenience. More...
 
std::ifstream in_
 
bool file_read_
 

Detailed Description

An object wrapper for reading atom_tree_diff files, complete with embedded reference structures.

Only works with uncompressed files, because we have to be able to to random access (seekg) to pull out single structures in random order.

Constructor & Destructor Documentation

core::import_pose::atom_tree_diffs::AtomTreeDiff::AtomTreeDiff ( )
core::import_pose::atom_tree_diffs::AtomTreeDiff::AtomTreeDiff ( std::string  filename)

References read_file().

core::import_pose::atom_tree_diffs::AtomTreeDiff::~AtomTreeDiff ( )
override

References in_.

core::import_pose::atom_tree_diffs::AtomTreeDiff::AtomTreeDiff ( AtomTreeDiff const &  )
private

Member Function Documentation

core::pose::PoseOPs const& core::import_pose::atom_tree_diffs::AtomTreeDiff::all_ref_poses ( ) const
inline

Allows access to and mutation of (!) the references poses stored in this file. Use with caution.

This exists to allow setup on stored reference poses for properties that don't get saved/restored in PDB format, like covalent constraints for enzyme design.

References unique_ref_poses_.

int core::import_pose::atom_tree_diffs::AtomTreeDiff::count ( std::string const &  tag) const
inline

References ref_tags_.

RefTags const& core::import_pose::atom_tree_diffs::AtomTreeDiff::get_ref_tags ( ) const
inline

References ref_tags_.

TagScoreMap const& core::import_pose::atom_tree_diffs::AtomTreeDiff::get_tag_score_map ( ) const
inline

References tag_idx_.

bool core::import_pose::atom_tree_diffs::AtomTreeDiff::has_ref_pose ( std::string const &  tag) const

returns true if a reference struct with the given tag is present

References ref_poses_.

bool core::import_pose::atom_tree_diffs::AtomTreeDiff::has_ref_tag ( std::string const &  tag) const

References ref_poses_.

bool core::import_pose::atom_tree_diffs::AtomTreeDiff::has_tag ( std::string const &  tag) const

True if a (non-reference) structure with the given tag is present in the file.

References tag_idx_.

void core::import_pose::atom_tree_diffs::AtomTreeDiff::read_file ( std::string  filename)
void core::import_pose::atom_tree_diffs::AtomTreeDiff::read_pose ( std::string const &  tag,
core::pose::Pose pose_out 
)

Reads the pose data from file and reconstructs the complete pose.

References ref_poses_.

void core::import_pose::atom_tree_diffs::AtomTreeDiff::read_pose ( std::string const &  tag,
core::pose::Pose pose_out,
core::pose::Pose const &  ref_pose 
)

Reads the pose data from file and reconstructs the complete pose, using the supplied reference pose.

References core::import_pose::atom_tree_diffs::header_from_atom_tree_diff(), in_, offsets_, and core::import_pose::atom_tree_diffs::pose_from_atom_tree_diff().

core::pose::PoseCOP core::import_pose::atom_tree_diffs::AtomTreeDiff::ref_pose_for ( std::string const &  tag)

Returns the default reference pose for the given tag. Fails if none is available.

References ref_poses_.

ScoresPairList const& core::import_pose::atom_tree_diffs::AtomTreeDiff::scores ( ) const
inline

Return list of (pose tag, score sets) pairs for all poses, in file order.

References scores_.

Referenced by read_file(), and protocols::ligand_docking::select_best_poses().

void core::import_pose::atom_tree_diffs::AtomTreeDiff::sort_by ( std::string const &  score_name,
ScoresPairList scores,
bool  descending = false 
)
static

Utility function for selecting subsets of structures by score.

Referenced by protocols::ligand_docking::select_best_poses().

Member Data Documentation

bool core::import_pose::atom_tree_diffs::AtomTreeDiff::file_read_
mutableprivate

Referenced by read_file().

std::ifstream core::import_pose::atom_tree_diffs::AtomTreeDiff::in_
private

Referenced by read_file(), read_pose(), and ~AtomTreeDiff().

std::map< std::string, long > core::import_pose::atom_tree_diffs::AtomTreeDiff::offsets_
private

The map of (tag, file position) for getting random access to the structural data.

Referenced by read_file(), and read_pose().

std::map< std::string, core::pose::PoseOP > core::import_pose::atom_tree_diffs::AtomTreeDiff::ref_poses_
private

The map of (tag, reference pose) for decoding the diffs. Some could be null.

Referenced by has_ref_pose(), has_ref_tag(), read_file(), read_pose(), and ref_pose_for().

RefTags core::import_pose::atom_tree_diffs::AtomTreeDiff::ref_tags_
private

Maps reference tags to how many associated atom_tree_diff structs exist... int is needed here because there are 0 atom tree diffs to start with

Referenced by count(), get_ref_tags(), and read_file().

ScoresPairList core::import_pose::atom_tree_diffs::AtomTreeDiff::scores_
private

The list of (tag,scores) pairs for the diffed structures, for efficient selection of subsets. (E.g. the top 5% by total score.) Memory cost is probably ~1 kb / structure.

Referenced by read_file(), and scores().

TagScoreMap core::import_pose::atom_tree_diffs::AtomTreeDiff::tag_idx_
private

Maps tags to indices in scores_.

Referenced by get_tag_score_map(), has_tag(), and read_file().

core::pose::PoseOPs core::import_pose::atom_tree_diffs::AtomTreeDiff::unique_ref_poses_
private

All references poses from the file, one copy each for convenience.

Referenced by all_ref_poses(), and read_file().


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