Rosetta
Classes | Typedefs | Functions | Variables
cnl_env_lost_hbs.cc File Reference
#include <basic/Tracer.hh>
#include <basic/options/util.hh>
#include <basic/options/option.hh>
#include <basic/options/option_macros.hh>
#include <core/import_pose/import_pose.hh>
#include <devel/init.hh>
#include <core/scoring/hbonds/HBondDatabase.hh>
#include <core/scoring/hbonds/HBondSet.hh>
#include <core/scoring/hbonds/HBEvalTuple.hh>
#include <core/scoring/hbonds/hbonds_geom.hh>
#include <core/scoring/hbonds/constants.hh>
#include <core/scoring/hbonds/types.hh>
#include <core/scoring/Energies.hh>
#include <core/scoring/EnergyGraph.hh>
#include <utility/graph/Graph.hh>
#include <core/scoring/ScoreFunctionFactory.hh>
#include <core/scoring/ScoreFunction.hh>
#include <core/pose/PDBInfo.hh>
#include <core/pose/Pose.hh>
#include <core/conformation/Residue.hh>
#include <core/id/AtomID.hh>
#include <numeric/xyzVector.hh>
#include <core/chemical/AA.hh>
#include <utility/vector1.hh>
#include <string>
#include <fstream>
#include <map>

Classes

struct  CnlRes
 data structure for a residue contributing to a constellation More...
 

Typedefs

typedef std::map< AtomID, vector1< AtomID > > HB_Partners
 

Functions

Size get_pose_resnum (int const pdbnum, char const pdbchn, Pose &ps)
 Returns the residue number of a residue in a pose. More...
 
Size rep_hb_atom (Size const tgt, Residue const &res)
 returns the index in the residue of the atom designated to represent a target atom for hydrogen bonding. More...
 
bool is_hbond (AtomID const &don, AtomID const &acc, Pose const &ps, HBondDatabase const &database, HBondSet const &hbond_set)
 Tells whether two atoms form a hydrogen bond. More...
 
void print_atom_pdbid (AtomID const &aid, Pose const &ps, std::ostream &os)
 prints an atom's PDB identifier More...
 
void print_hb_partners (HB_Partners const &ptns, Pose const &ps, std::ostream &os)
 prints the contents of an HB_Partners instance More...
 
void don_store_hbs (AtomID const &don, Pose const &ps, HBondDatabase const &database, HBondSet const &hbond_set, HB_Partners &hbptns)
 records a donor atom as an hbond partner for each atom accepting hbonds from it More...
 
void acc_store_hbs (AtomID const &acc, Pose const &ps, HBondDatabase const &database, HBondSet const &hbond_set, HB_Partners &hbptns)
 records an acceptor atom as an hbond partner for each atom donating hbonds to it. More...
 
void cnlres_store_hbs (const Size ridx, const char newaa, Pose const &ps, HBondDatabase const &database, HBondSet const &hbond_set, HB_Partners &hbptns)
 stores a residue's constellation atoms as hbond partners of the atoms, if any, with which they form hydrogen bonds. More...
 
void cnl_store_hbs (vector1< CnlRes > const &cnl, Pose const &ps, HBondDatabase const &database, HBondSet const &hbond_set, HB_Partners &hbptns)
 stores a constellation's atoms as hbond partners of the atoms, if any, with which they form hydrogen bonds. More...
 
void cnl_print (vector1< CnlRes > const &cnl, Pose const &ps, std::ostream &os)
 prints a constellation's description More...
 
bool in_cnl (AtomID const &polat, vector1< CnlRes > const &cnl, Pose const &ps)
 returns true if atom 'polat' belongs to constellation 'cnl'; returns false otherwise. More...
 
void prune_away_cnl (HB_Partners &hbptns, vector1< CnlRes > const &cnl, Pose const &ps)
 
Size hbonds_to_ptnres (AtomID const &rep, Size ptnidx, Pose const &ps, HBondDatabase const &database, HBondSet const &hbond_set, std::ostream &os)
 Detects the hbonds between an hbond-representative atom and a partner residue. More...
 
int main (int argc, char *argv[])
 

Variables

static basic::Tracer TR ("apps.pilot.cnl_env_lost_hbs")
 

Typedef Documentation

◆ HB_Partners

typedef std::map<AtomID, vector1<AtomID> > HB_Partners

Function Documentation

◆ acc_store_hbs()

void acc_store_hbs ( AtomID const &  acc,
Pose const &  ps,
HBondDatabase const &  database,
HBondSet const &  hbond_set,
HB_Partners hbptns 
)

records an acceptor atom as an hbond partner for each atom donating hbonds to it.

Parameters
[in]accthe acceptor atom
[in]pspose to which the atom and its partners belong
[in]databasehbond database
[in]hbond_setdummy hbond set (will not be filled in)
[out]hbptnsstores the acceptor atom as an hbond partner

For each atom x donating an hbond to 'acc', 'acc' is added as a a partner of R(x) in 'hbptns' (i.e., to vector hbptns[R(x)]), where R(x) is the hbond representative atom of x.

References kic_runner::database, test.T200_Scoring::hbond_set, is_hbond(), and rep_hb_atom().

Referenced by cnlres_store_hbs().

◆ cnl_print()

void cnl_print ( vector1< CnlRes > const &  cnl,
Pose const &  ps,
std::ostream &  os 
)

prints a constellation's description

Parameters
[in]cnlresidue-specific contributions to the constellation
[in]pspose to which the constellation belongs
[out]osoutput stream

the ith output line contains the description of the ith residue contribution in cnl (i=1,...,N, where N is the size of cnl).

References create_a3b_hbs::i, and N.

Referenced by main().

◆ cnl_store_hbs()

void cnl_store_hbs ( vector1< CnlRes > const &  cnl,
Pose const &  ps,
HBondDatabase const &  database,
HBondSet const &  hbond_set,
HB_Partners hbptns 
)

stores a constellation's atoms as hbond partners of the atoms, if any, with which they form hydrogen bonds.

Parameters
[in]cnlthe constellation
[in]pspose to which the constellation belongs
[in]databasehbond database
[in]hbond_setdummy hbond set (will not be filled in)
[out]hbptnsrepository of hbond partners

References cnlres_store_hbs(), kic_runner::database, test.T200_Scoring::hbond_set, create_a3b_hbs::i, and N.

Referenced by main().

◆ cnlres_store_hbs()

void cnlres_store_hbs ( const Size  ridx,
const char  newaa,
Pose const &  ps,
HBondDatabase const &  database,
HBondSet const &  hbond_set,
HB_Partners hbptns 
)

stores a residue's constellation atoms as hbond partners of the atoms, if any, with which they form hydrogen bonds.

Parameters
[in]ridxindex of the residue in its pose
[in]newaaamino acid type to which the residue is mutated (to yield the constellation)
[in]psthe pose
[in]databasehbond database
[in]hbond_setdummy hbond set (will not be filled in)
[out]hbptnsrepository of hbond partners

it is assumed that, for all constellations but Thr->Ser, all polar side-chain atoms are part of the constellation (this holds for the present ensemble of donors and acceptors in Rosetta).

References acc_store_hbs(), kic_runner::database, don_store_hbs(), test.T200_Scoring::hbond_set, and res.

Referenced by cnl_store_hbs().

◆ don_store_hbs()

void don_store_hbs ( AtomID const &  don,
Pose const &  ps,
HBondDatabase const &  database,
HBondSet const &  hbond_set,
HB_Partners hbptns 
)

records a donor atom as an hbond partner for each atom accepting hbonds from it

Parameters
[in]donthe donor atom
[in]pspose to which the atom and its partners belong
[in]databasehbond database
[in]hbond_setdummy hbond set (will not be filled in)
[out]hbptnsstores the donor atom as an hbond partner

For each atom x accepting an hbond from 'don', 'don' is added as a a partner of R(x) in 'hbptns' (i.e., to vector hbptns[R(x)]), where R(x) is the hbond representative atom of x.

References kic_runner::database, test.T200_Scoring::hbond_set, is_hbond(), and rep_hb_atom().

Referenced by cnlres_store_hbs().

◆ get_pose_resnum()

Size get_pose_resnum ( int const  pdbnum,
char const  pdbchn,
Pose ps 
)

Returns the residue number of a residue in a pose.

@parm[in] pdbnum residue number of the residue in its PDB file. @parm[in] pdbchn chain identifier of the residue in the PDB file. @parm[in] ps pose that the residue has been loaded into.

References utility::options::OptionKeys::options::exit, create_a3b_hbs::j, and basic::options::TR.

Referenced by main().

◆ hbonds_to_ptnres()

Size hbonds_to_ptnres ( AtomID const &  rep,
Size  ptnidx,
Pose const &  ps,
HBondDatabase const &  database,
HBondSet const &  hbond_set,
std::ostream &  os 
)

Detects the hbonds between an hbond-representative atom and a partner residue.

Parameters
[in]repthe hbond-representative atom
[in]ptnidxindex of the partner residue in its pose
[in]pspose to which both atom 'rep' and residue 'ptnidx' belong
[in]databasehbond database
[in]hbond_setdummy hbond set (will not be filled in)
[out]osoutput stream where hbonds are listed
Returns
number of hydrogen bonds between atom 'rep' (i.e., all atoms it represents) and residue 'ptnidx'.

if 'rep' represents only acceptors or only donors, the output can be seen as a sequence of N blocks, where N is the number of atoms represented by 'rep' that form at least one hydrogen bond with residue 'ptnidx'. The ith block lists the hydrogen bonds made by the ith such represented atom, according to the order specified by Residue::accpt_pos() (acceptors) or Residue::Hpos_polar() (donors) (i=0,...,N-1). Within block i, the jth line denotes the jth polar atom in residue 'ptnidx' to form a hydrogen bond with the represented atom in question for block i (i=0,...,N-1; j=0,...,M(i)-1, where M(i) is the number of such polar atoms, and acceptors and donors in residue 'ptnidx' are also ordered according to Residue::accpt_pos() and Residue::Hpos_polar(), respectively).

if 'rep' represents both donors and acceptors, 2 instances of the above output are produced, the first for the represented acceptors and the second, immediately following, for the represented donors.

References kic_runner::database, test.T200_Scoring::hbond_set, is_hbond(), print_atom_pdbid(), test.T220_AtomAtomPairEnergies::rep, and rep_hb_atom().

Referenced by main().

◆ in_cnl()

bool in_cnl ( AtomID const &  polat,
vector1< CnlRes > const &  cnl,
Pose const &  ps 
)

returns true if atom 'polat' belongs to constellation 'cnl'; returns false otherwise.

Parameters
[in]polatan hbond-representative polar atom
[in]cnlthe constellation
[in]pspose to which the atom and the constellation belong

it is assumed that, for all single-residue constellations but Thr->Ser, all polar side-chain atoms are part of the constellation (this holds for the present ensemble of donors and acceptors in Rosetta).

References create_a3b_hbs::i, N, and res.

Referenced by prune_away_cnl().

◆ is_hbond()

bool is_hbond ( AtomID const &  don,
AtomID const &  acc,
Pose const &  ps,
HBondDatabase const &  database,
HBondSet const &  hbond_set 
)

Tells whether two atoms form a hydrogen bond.

Parameters
[in]doncandidate donor atom.
[in]acccandidate acceptor atom.
[in]pspose containing the atoms.
[in]databasehbond database.
[in]hbond_setdummy hbond set (will not be filled in).
Returns
true if the two atoms form a hydrogen bond; false otherwise.

It is assumed that don is a polar hydrogen atom and acc may accept hydrogen bonds.

References test.T005_Bindings::base, kic_runner::database, numeric::xyzVector< T >::distance_squared(), and test.T200_Scoring::hbond_set.

Referenced by acc_store_hbs(), don_store_hbs(), and hbonds_to_ptnres().

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ print_atom_pdbid()

void print_atom_pdbid ( AtomID const &  aid,
Pose const &  ps,
std::ostream &  os 
)

prints an atom's PDB identifier

param[in] aid atom identifier in the pose param[in] ps the pose param[out] os output stream

References res.

Referenced by hbonds_to_ptnres(), main(), and print_hb_partners().

◆ print_hb_partners()

void print_hb_partners ( HB_Partners const &  ptns,
Pose const &  ps,
std::ostream &  os 
)

prints the contents of an HB_Partners instance

Parameters
[in]ptnsthe HB_Partners instance
[in]psthe relevant pose
[out]osoutput stream

The output can be seen as a sequence of N blocks, where N is the number of keys (atoms whose partners are stored) in ptns. The ith block lists the partners of the ith key in ptns (i=0,...,N-1). Within block i, the jth line contains the identifier of ptns[i]j.

References create_a3b_hbs::j, print_atom_pdbid(), and test.T850_SubClassing::pv.

Referenced by main().

◆ prune_away_cnl()

void prune_away_cnl ( HB_Partners hbptns,
vector1< CnlRes > const &  cnl,
Pose const &  ps 
)

References create_a3b_hbs::i, and in_cnl().

Referenced by main().

◆ rep_hb_atom()

Size rep_hb_atom ( Size const  tgt,
Residue const &  res 
)

returns the index in the residue of the atom designated to represent a target atom for hydrogen bonding.

Parameters
[in]tgtindex in the residue of the target atom
[in]resresidue to which the target atom belongs

: the representative atom is used to make some atoms equivalent with respect to hydrogen bonding. Currently:

  • all hydrogen atoms bound to the same heavy atom are equivalent.
    • Arg's 1HH1, 1HH2, 2HH1, and 2HH2 are all equivalent.
    • Asp's OD1 and OD2 are equivalent.
    • Glu's OE1 and OE2 are equivalent.

References res.

Referenced by acc_store_hbs(), don_store_hbs(), and hbonds_to_ptnres().

Variable Documentation

◆ TR

basic::Tracer TR("apps.pilot.cnl_env_lost_hbs") ( "apps.pilot.cnl_env_lost_hbs"  )
static