Rosetta
Classes | Typedefs | Functions
core::import_pose::atom_tree_diffs Namespace Reference

Classes

class  ScoreLessThanComparator
 Provides a StrictWeakOrdering comparator for sorting elements of a ScoresMap by one particular score type. More...
 
class  AtomTreeDiff
 An object wrapper for reading atom_tree_diff files, complete with embedded reference structures. More...
 

Typedefs

typedef utility::pointer::shared_ptr< AtomTreeDiffAtomTreeDiffOP
 
typedef utility::pointer::shared_ptr< AtomTreeDiff const > AtomTreeDiffCOP
 
typedef std::pair< std::string, core::RealScorePair
 
typedef std::map< std::string, core::RealScores
 
typedef std::pair< std::string, ScoresScoresPair
 
typedef utility::vector1< ScoresPairScoresPairList
 
typedef std::pair< std::string, int > RefTag
 
typedef std::map< std::string, int > RefTags
 
typedef std::pair< std::string, SizeTagScorePair
 
typedef std::map< std::string, SizeTagScoreMap
 

Functions

void dump_score_line (std::ostream &out, std::string const &pose_tag, std::map< std::string, core::Real > const &scores)
 Helper function for writing entries – not usually called by clients. More...
 
void dump_reference_pose (std::ostream &out, std::string const &pose_tag, Scores const &scores, core::pose::Pose const &pose)
 
void dump_atom_tree_diff (std::ostream &out, std::string const &pose_tag, std::map< std::string, core::Real > const &scores, core::pose::Pose const &ref_pose_in, core::pose::Pose const &pose, int bb_precision=6, int sc_precision=4, int bondlen_precision=2)
 Encodes pose relative to ref_pose by noting which atom_tree DOFs are different. More...
 
bool header_from_atom_tree_diff (std::istream &in, std::string &pose_tag_out, Scores &scores_out)
 
bool pose_from_atom_tree_diff (std::istream &in, core::pose::Pose const &ref_pose, core::pose::Pose &pose)
 Sets pose = ref_pose and then starts modifying DOFs in pose to recreate a saved structure. Call after header_from_atom_tree_diff(). Returns false on error. More...
 
void map_of_weighted_scores (core::pose::Pose &pose, core::scoring::ScoreFunction const &sfxn, Scores &scores_out)
 Helper for dump_atom_tree_diff(), fills map with weighted score terms. More...
 
static basic::Tracer TR_rms_error_with_noise ("rms_error_with_noise")
 
void rms_error_with_noise (core::pose::Pose const &ref_pose, int bb_precision=6, int sc_precision=4)
 For use in deciding how many digits of precision you need when diffing an atom tree. More...
 
bool file_is_atom_tree_diff (std::string const &filename)
 Test if given file is an atom_tree_diff. More...
 
bool file_is_atom_tree_diff (std::istream &in)
 Test if given stream is an atom_tree_diff. More...
 
void dump_reference_pose (std::ostream &out, std::string const &pose_tag, std::map< std::string, core::Real > const &scores, core::pose::Pose const &pose)
 Helper function for writing entries – not usually called by clients. More...
 
bool header_from_atom_tree_diff (std::istream &in, std::string &pose_tag_out, std::map< std::string, core::Real > &scores_out)
 Gets next tag and scores from the stream, or returns false if none. Call this to find desired structure, then call pose_from_atom_tree_diff(). More...
 
void map_of_weighted_scores (core::pose::Pose &pose, core::scoring::ScoreFunction const &sfxn, std::map< std::string, core::Real > &scores_out)
 Helper for dump_atom_tree_diff(), fills map with weighted score terms. More...
 

Typedef Documentation

◆ AtomTreeDiffCOP

typedef utility::pointer::shared_ptr< AtomTreeDiff const > core::import_pose::atom_tree_diffs::AtomTreeDiffCOP

◆ AtomTreeDiffOP

typedef utility::pointer::shared_ptr< AtomTreeDiff > core::import_pose::atom_tree_diffs::AtomTreeDiffOP

◆ RefTag

typedef std::pair<std::string, int> core::import_pose::atom_tree_diffs::RefTag

◆ RefTags

typedef std::map<std::string, int> core::import_pose::atom_tree_diffs::RefTags

◆ ScorePair

◆ Scores

typedef std::map< std::string, core::Real > core::import_pose::atom_tree_diffs::Scores

◆ ScoresPair

typedef std::pair< std::string, Scores > core::import_pose::atom_tree_diffs::ScoresPair

◆ ScoresPairList

Just like ScoresMap, but can be sorted into some particular order by scores. Maps can only be sorted by key, which here is just a pose tag.

◆ TagScoreMap

typedef std::map<std::string, Size> core::import_pose::atom_tree_diffs::TagScoreMap

◆ TagScorePair

typedef std::pair<std::string, Size> core::import_pose::atom_tree_diffs::TagScorePair

Function Documentation

◆ dump_atom_tree_diff()

void core::import_pose::atom_tree_diffs::dump_atom_tree_diff ( std::ostream &  out,
std::string const &  pose_tag,
std::map< std::string, core::Real > const &  scores,
core::pose::Pose const &  ref_pose_in,
core::pose::Pose const &  pose,
int  bb_precision,
int  sc_precision,
int  bondlen_precision 
)

Encodes pose relative to ref_pose by noting which atom_tree DOFs are different.

Writes out the given pose in a atom_tree_diff-type format by only recording AtomTree DOFs that differ from ref_pose. Thus pose and ref_pose should have the same sequence and AtomTree topology. The entry is labeled with the given textual tag and 0+ named numeric scores. The number of digits of precision after the decimal point can be specified independently for backbone and sidechain. More precision reduces propagated coordinate error but increases both the number of characters used per value and the total number of values written. The default values should be very good for most applications.

References core::kinematics::AtomTree::atom(), core::pose::Pose::atom_tree(), core::conformation::Residue::atom_type(), core::pose::Pose::conformation(), core::conformation::ResidueFactory::create_residue(), core::id::D, core::pose::Pose::dof(), dump_score_line(), core::pose::Pose::fold_tree(), core::kinematics::Jump::get_rotation(), core::kinematics::Jump::get_translation(), core::chemical::AtomType::is_heavyatom(), core::kinematics::tree::Atom::is_jump(), core::kinematics::FoldTree::is_jump_point(), core::pose::Pose::jump(), core::conformation::Residue::last_backbone_atom(), core::chemical::ResidueTypeBase::name(), core::conformation::Residue::natoms(), core::pose::Pose::num_jump(), core::conformation::membrane::out, core::chemical::rings::PHI, core::io::raw_data::precision(), core::pose::Pose::replace_residue(), core::pose::Pose::residue(), core::pose::Pose::residue_type(), core::pose::Pose::size(), and core::chemical::rings::THETA.

Referenced by protocols::jd2::AtomTreeDiffJobOutputter::dump_pose(), and protocols::jobdist::AtomTreeDiffJobDistributor::dump_pose().

◆ dump_reference_pose() [1/2]

void core::import_pose::atom_tree_diffs::dump_reference_pose ( std::ostream &  out,
std::string const &  pose_tag,
Scores const &  scores,
core::pose::Pose const &  pose 
)

Writes out the given pose in PDB format (plus fold tree). When reading back in, this pose will be used as the reference point for all subsequent poses, until another reference pose is reached.

References core::io::pdb::dump_pdb(), dump_score_line(), core::pose::Pose::fold_tree(), core::chemical::ResidueTypeBase::name(), core::conformation::membrane::out, core::pose::Pose::residue_type(), and core::pose::Pose::size().

Referenced by protocols::jd2::AtomTreeDiffJobOutputter::dump_pose(), and protocols::jobdist::AtomTreeDiffJobDistributor::dump_pose().

◆ dump_reference_pose() [2/2]

void core::import_pose::atom_tree_diffs::dump_reference_pose ( std::ostream &  out,
std::string const &  pose_tag,
std::map< std::string, core::Real > const &  scores,
core::pose::Pose const &  pose 
)

Helper function for writing entries – not usually called by clients.

Embeds a reference pose as PDB coords + foldtree; will be used for reconstructing subsequent diffs.

◆ dump_score_line()

void core::import_pose::atom_tree_diffs::dump_score_line ( std::ostream &  out,
std::string const &  pose_tag,
std::map< std::string, core::Real > const &  scores 
)

Helper function for writing entries – not usually called by clients.

References core::conformation::membrane::out, core::scoring::pair, and protocols::hybridization::val.

Referenced by dump_atom_tree_diff(), and dump_reference_pose().

◆ file_is_atom_tree_diff() [1/2]

bool core::import_pose::atom_tree_diffs::file_is_atom_tree_diff ( std::istream &  in)

Test if given stream is an atom_tree_diff.

If everything goes right, after the call, the read position should be at the same place it was to start with

References header_from_atom_tree_diff(), and core::conformation::membrane::in.

◆ file_is_atom_tree_diff() [2/2]

bool core::import_pose::atom_tree_diffs::file_is_atom_tree_diff ( std::string const &  filename)

Test if given file is an atom_tree_diff.

References protocols::abinitio::filename().

◆ header_from_atom_tree_diff() [1/2]

bool core::import_pose::atom_tree_diffs::header_from_atom_tree_diff ( std::istream &  in,
std::string &  pose_tag_out,
Scores scores_out 
)

Reads from the current stream position until it finds both a pose_tag line and a scores line, then extracts the data and returns it. Returns true on success and false on failure.

References core::conformation::membrane::in.

Referenced by protocols::jobdist::AtomTreeDiffJobDistributor::AtomTreeDiffJobDistributor(), file_is_atom_tree_diff(), core::import_pose::atom_tree_diffs::AtomTreeDiff::read_file(), and core::import_pose::atom_tree_diffs::AtomTreeDiff::read_pose().

◆ header_from_atom_tree_diff() [2/2]

bool core::import_pose::atom_tree_diffs::header_from_atom_tree_diff ( std::istream &  in,
std::string &  pose_tag_out,
std::map< std::string, core::Real > &  scores_out 
)

Gets next tag and scores from the stream, or returns false if none. Call this to find desired structure, then call pose_from_atom_tree_diff().

◆ map_of_weighted_scores() [1/2]

void core::import_pose::atom_tree_diffs::map_of_weighted_scores ( core::pose::Pose pose,
core::scoring::ScoreFunction const &  sfxn,
Scores scores_out 
)

◆ map_of_weighted_scores() [2/2]

void core::import_pose::atom_tree_diffs::map_of_weighted_scores ( core::pose::Pose pose,
core::scoring::ScoreFunction const &  sfxn,
std::map< std::string, core::Real > &  scores_out 
)

Helper for dump_atom_tree_diff(), fills map with weighted score terms.

◆ pose_from_atom_tree_diff()

bool core::import_pose::atom_tree_diffs::pose_from_atom_tree_diff ( std::istream &  in,
core::pose::Pose const &  ref_pose,
core::pose::Pose pose 
)

Sets pose = ref_pose and then starts modifying DOFs in pose to recreate a saved structure. Call after header_from_atom_tree_diff(). Returns false on error.

Extracts a pose-diff and sets the DOFs of "pose" accordingly, working from the current stream position. Use header_from_atom_tree_diff() to locate the pose you wish to extract prior to calling this function. Returns false if there is some sort of IO or format error.

References core::import_pose::build_pose(), core::kinematics::FoldTree::clear(), core::pose::Pose::clear(), core::io::StructFileRep::clone(), core::pose::Pose::conformation(), core::io::pdb::create_record_from_pdb_line(), core::conformation::ResidueFactory::create_residue(), core::io::pdb::create_sfr_from_pdb_records(), core::id::D, core::io::StructFileRep::filename(), core::chemical::fixup_patches(), core::pose::Pose::fold_tree(), core::chemical::FULL_ATOM_t, core::pose::get_restype_for_pose(), core::conformation::membrane::in, core::chemical::ResidueTypeBase::mode(), core::chemical::ResidueTypeBase::name(), core::chemical::ResidueType::natoms(), core::kinematics::FoldTree::nres(), core::pose::Pose::num_jump(), core::chemical::rings::PHI, core::pose::Pose::replace_residue(), core::pose::Pose::residue(), core::pose::Pose::residue_type(), core::pose::Pose::residue_type_set_for_pose(), core::pose::Pose::set_dof(), core::pose::Pose::set_jump(), core::kinematics::Jump::set_rotation(), core::kinematics::Jump::set_translation(), core::pose::Pose::size(), core::chemical::rings::THETA, and core::import_pose::TR().

Referenced by core::import_pose::atom_tree_diffs::AtomTreeDiff::read_file(), and core::import_pose::atom_tree_diffs::AtomTreeDiff::read_pose().

◆ rms_error_with_noise()

void core::import_pose::atom_tree_diffs::rms_error_with_noise ( core::pose::Pose const &  ref_pose,
int  bb_precision,
int  sc_precision 
)

For use in deciding how many digits of precision you need when diffing an atom tree.

Copies the pose and adds random noise to the AtomTree DOFs in the Nth digit (specified by bb_precision and sc_precision). This simulates the roundoff error introduced by writing an atom_tree diff to file and then reconstructing a pose from it. Backbone needs to be more precise than sidechains because in typical foldtrees it propagates errors over a much longer distance (i.e. the whole protein chain rather than just to the end of the sidechain). Using 200-500 residue single-chain globular proteins with one ligand each, 6 digits of backbone precision and 4 digits of sidechain precision give RMS coordinate errors of 0.0001 to 0.0003. Since this is smaller than the least significant digit in a PDB file, it should have an imperceptible effect on the final structure. Even in release mode, this function takes a long time: 30 sec to 1 minute.

References core::kinematics::AtomTree::atom(), core::pose::Pose::atom_tree(), core::conformation::Residue::atom_type(), core::id::D, core::pose::Pose::dof(), core::pose::Pose::fold_tree(), core::chemical::AtomType::is_heavyatom(), core::scoring::is_heavyatom(), core::kinematics::tree::Atom::is_jump(), core::kinematics::FoldTree::is_jump_point(), core::scoring::is_polymer_heavyatom(), core::conformation::Residue::last_backbone_atom(), core::conformation::Residue::natoms(), core::chemical::rings::PHI, core::pose::Pose::residue(), core::scoring::rg, core::scoring::rmsd_no_super(), core::scoring::rmsd_with_super(), core::pose::Pose::set_dof(), core::pose::Pose::size(), core::chemical::rings::THETA, and TR_rms_error_with_noise().

◆ TR_rms_error_with_noise()

static basic::Tracer core::import_pose::atom_tree_diffs::TR_rms_error_with_noise ( "rms_error_with_noise"  )
static

Referenced by rms_error_with_noise().