Rosetta 3.5
 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]
Collaboration diagram for core::import_pose::atom_tree_diffs::AtomTreeDiff:
Collaboration graph
[legend]

Public Member Functions

 AtomTreeDiff ()
 
 AtomTreeDiff (std::string filename)
 
virtual ~AtomTreeDiff ()
 
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.

Definition at line 67 of file atom_tree_diff.hh.

Constructor & Destructor Documentation

core::import_pose::atom_tree_diffs::AtomTreeDiff::AtomTreeDiff ( )

Definition at line 69 of file atom_tree_diff.cc.

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

Definition at line 79 of file atom_tree_diff.cc.

References read_file().

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

Definition at line 146 of file atom_tree_diff.cc.

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.

Definition at line 103 of file atom_tree_diff.hh.

References unique_ref_poses_.

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

Definition at line 110 of file atom_tree_diff.hh.

References ref_tags_.

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

Definition at line 106 of file atom_tree_diff.hh.

References ref_tags_.

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

Definition at line 108 of file atom_tree_diff.hh.

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

Definition at line 151 of file atom_tree_diff.cc.

References ref_poses_.

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

Definition at line 159 of file atom_tree_diff.cc.

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.

Definition at line 155 of file atom_tree_diff.cc.

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.

Definition at line 174 of file atom_tree_diff.cc.

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.

Definition at line 182 of file atom_tree_diff.cc.

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.

Definition at line 201 of file atom_tree_diff.cc.

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.

Definition at line 84 of file atom_tree_diff.hh.

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.

Definition at line 164 of file atom_tree_diff.cc.

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

Member Data Documentation

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

Definition at line 141 of file atom_tree_diff.hh.

Referenced by read_file().

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

Definition at line 139 of file atom_tree_diff.hh.

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.

Definition at line 130 of file atom_tree_diff.hh.

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.

Definition at line 133 of file atom_tree_diff.hh.

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

Definition at line 124 of file atom_tree_diff.hh.

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.

Definition at line 120 of file atom_tree_diff.hh.

Referenced by read_file(), and scores().

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

Maps tags to indices in scores_.

Definition at line 127 of file atom_tree_diff.hh.

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.

Definition at line 136 of file atom_tree_diff.hh.

Referenced by all_ref_poses(), and read_file().


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