Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ResidueType.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 //////////////////////////////////////////////////////////////////////
10 /// @begin ResidueType
11 ///
12 /// @brief
13 /// A class for defining a type of residue
14 ///
15 /// @details
16 /// This class contains the "chemical" information for residues. This does not contain the actual xyz coordinates of a
17 /// particular residue in a specific peptide. (xyz coordinates are found in core/conformation/Residue.hh). A residue
18 /// in Rosetta can be a ligand, DNA, amino acid, or basically anything. A residue is read in through residue_io.cc and
19 /// read from parameter files, generally located in the database chemical/residue_types. For ligands, or anything that
20 /// is not one of the natural 20 AAs, a parameter has to be provided to rosetta through the -extra_res_fa flag.
21 /// residue_io.cc sets private member data in ResidueType. The primary data that are set are: atoms, mmatoms,
22 /// orbitals, and properties of the particular residue type. These properties can be modified through patches, which
23 /// is controlled through PatchOperations.cc. If the residue_type of a residue is modified, the indices of atoms and
24 /// mmatoms and everything associated with those indices must be redefined. This reordering of indices is taken care
25 /// of with the function reorder_primary_data().
26 ///
27 /// Setting of primary data and then reordering is important. Primary data for the following are described:
28 ///
29 /// Atoms: Setting of atoms includes indexing the atoms into vectors, saving their names into vectors/maps, saving the
30 /// associated mm_atom_type into a vector, saving bond connections into vectors, etc, etc. Since everything is
31 /// allocated into vectors, it is easy to reorder those vectors. On any given residue, the heavy atoms are put into
32 /// the vector first, (their indices are first,) and hydrogens are put in last.
33 ///
34 /// Properties: Properties of a residue include things like DNA, PROTEIN, SC_ORBITALS, CHARGED, etc. These properties
35 /// indicate the type of residue it is and what properties are associated with the residue. They are set when read in.
36 /// Several lines of code must be modified to get them to work, all found here in ResidueType.cc.
37 ///
38 /// Orbitals: Orbitals are indexed separately from atoms. They function much the same way as atoms, except for some
39 /// key differences. To find atoms bonded to orbitals, you must provide the atom index, not the orbital index. (I
40 /// haven't figured out how to get the reverse to work because of the separate indices.) Orbital xyz coordinates are
41 /// not updated when atom coordinates are. This is to keep speed consistent with just having atoms. To output the
42 /// orbitals, use the flag -output_orbitals.
43 ///
44 /// @author
45 /// Phil Bradley
46 /// Steven Combs - these comments
47 ////////////////////////////////////////////////////////////////////////
48 
49 
50 
51 #ifndef INCLUDED_core_chemical_ResidueType_hh
52 #define INCLUDED_core_chemical_ResidueType_hh
53 
54 
55 // Unit headers
57 // Package headers
61 #include <core/chemical/AA.hh>
62 #include <core/chemical/Adduct.hh>
72 // only compiles with the .hh below; anyone know why I can't use the .fwd.hh here? ~Labonte
74 // AUTO-REMOVED #include <core/chemical/VariantType.hh>
75 
76 // Project headers
77 //#include <core/chemical/CSDAtomTypeSet.hh>
78 // Commented by inclean daemon #include <core/types.hh>
79 ///#include <core/pack/dunbrack/RotamerLibrary.fwd.hh>
80 //XRW_B_T1
81 //#include <core/coarse/Translator.fwd.hh>
82 //XRW_E_T1
83 
84 
88 
89 #include <core/types.hh>
90 
91 // Numeric headers
92 #include <numeric/xyzVector.hh>
93 
94 // Utility headers
95 // AUTO-REMOVED #include <utility/vector1.hh>
96 #include <utility/pointer/ReferenceCount.hh>
97 #include <utility/keys/Key2Tuple.hh>
98 #include <utility/keys/Key4Tuple.hh>
99 #include <utility/keys/Key3Tuple.hh>
100 
101 // C++ headers
102 #include <map>
103 
105 #include <utility/vector1.hh>
106 
107 namespace core {
108 namespace chemical {
109 
110 typedef utility::keys::Key2Tuple< Size, Size > two_atom_set;
111 typedef utility::keys::Key3Tuple< Size, Size, Size > three_atom_set;
112 typedef utility::keys::Key3Tuple< Size, Size, Size > bondangle_atom_set;
113 typedef utility::keys::Key4Tuple< Size, Size, Size, Size > dihedral_atom_set;
114 
115 /// silly demo class -- what would the most familiar residue look like?
116 
117 /**
118 
119 Basically a slice of aaproperties pack!
120 
121 This is an exercise to define the properties of an alternative Residue
122 object, arising from frustration with the conformation::Residue hierarchy.
123 
124 Properties:
125 
126 - file-based
127 
128 - Residue includes sidechain and backbone
129 
130 - flat or simple object hierarchy
131 
132 - no Atom or Rsd keys, maybe chemical atom keys but of course need
133  to support the addition of new atom types
134 
135 - file-based atom properties
136  at the beginning of a run, you read in the residue topology/info files
137  as well as the atom-properties file (basically forcefield parameters,
138  ala etable.h). This defines for the course of the run the number of
139  residues
140 
141 - variants, at least some of them, handled through a "patching" system
142  analagous to that in CHARMM. IE you would define patches, eg Nterm,
143  Cterm, alternate protonation states, in files, which would define a
144  sequence of operations that one would apply to a target residue to
145  get the patched or variant form.
146 
147 - for variants, a notion of which properties of the base residue carry over
148  eg, dunbrack rotamer info, pair term interactions, plane interactions,
149  Paa...
150 
151 
152 Questions:
153 
154 - how do we handle rotamers? vector of atoms plus pointer to "full-fledged"
155  residue that knows bonded geometry...
156 
157 **/
158 
159 
161 
162 public:
163 
164  /// @brief destructor
165  virtual
166  ~ResidueType();
167 
168  /// @brief constructor
169  /**
170  We use the AtomTypeSet object to assign atom_types to atoms inside
171  add_atom, and to identify (polar) hydrogens, acceptors, etc.
172  **/
173 
174  ResidueType(
175  AtomTypeSetCAP atom_types,
176  ElementSetCAP element_types,
177  MMAtomTypeSetCAP mm_atom_types,
178  orbitals::OrbitalTypeSetCAP orbital_types//,
179 // CSDAtomTypeSetCAP csd_atom_types kwk commenting out csd atom types until they have been fully implemented
180  );
181 
182 
183  /// @brief make a copy
185  clone() const;
186 
187  //////////////////////////////////////////////////////////////////////
188  //////////////////////////////////////////////////////////////////////
189  //////////////////////////////////////////////////////////////////////
190  ///////////////// Atom Functions ////////////////////////
191  //////////////////Atom Functions /////////////////////////
192  //////////////////////////////////////////////////////////////////////
193  //////////////////////////////////////////////////////////////////////
194 
195  /// @brief access by reference the atomset for which this residue is constructed
196  AtomTypeSet const &
198  {
199  return *atom_types_;
200  }
201 
202  /// @brief access by reference the atomset for which this residue is constructed
203  ElementSet const &
204  element_set() const
205  {
206  return *elements_;
207  }
208 
209  /// @brief access by const pointer the atomset for which this residue is constructed
212  {
213  return atom_types_;
214  }
215 
216  Atom & atom(Size const atom_index);
217  Atom const & atom(Size const atom_index) const;
218  Atom & atom(std::string const & atom_name);
219  Atom const & atom(std::string const & atom_name) const;
220 
221  Orbital const & orbital(Size const orbital_index) const;
222  Orbital const & orbital(std::string const & orbital_name) const;
223 
224 
225  /// @brief Get the chemical atom_type for this atom by it index number in this residue
226  AtomType const &
227  atom_type( Size const atomno ) const;
228 
229  /// @brief Get the chemical atom_type index number for this atom by its index number in this residue
230 // int
231 // atom_type_index( Size const atomno ) const;
232 
233  /// @brief number of atoms
234  Size
235  natoms() const
236  {
237  return natoms_;
238  }
239 
240  /// @brief number of heavy atoms
241  Size
242  nheavyatoms() const
243  {
244  return nheavyatoms_;
245  }
246 
247  /// @brief number of hbond_acceptors
248  Size
250  {
251  return n_hbond_acceptors_;
252  }
253 
254  /// @brief number of hbond_donors
255  Size
257  {
258  return n_hbond_donors_;
259  }
260 
261  /// @brief index number of the atom which connects to the lower connection
262  Size
263  lower_connect_atom() const;
264 
265  /// @brief path distance (number of bonds separated) between a pair of atoms
266  int
267  path_distance( Size at1, Size at2 ) const { return path_distance_[ at1][at2]; }
268 
269  /// @brief shortest path distance for an atom to all other residue atoms
272  {
273  return path_distance_[ atom ];
274  }
275 
276  /// @brief accessor of path_distance_ data for this residue, which is a 2D array
279  {
280  return path_distance_;
281  }
282 
283  /// @brief index number of the first attached Hydrogen on an atom
284  Size
285  attached_H_begin( Size const atom ) const
286  {
287  return attached_H_begin_[ atom ];
288  }
289 
290  /// @brief index number of the last attached Hydrogen on an atom
291  Size
292  attached_H_end( Size const atom ) const
293  {
294  return attached_H_end_[ atom ];
295  }
296 
297  /// @brief for all heavy atoms, index numbers of their first attached Hydrogen
298  AtomIndices const &
300  {
301  return attached_H_begin_;
302  }
303 
304  /// @brief for all heavy atoms, index numbers of their last attached Hydrogen
305  AtomIndices const &
307  {
308  return attached_H_end_;
309  }
310 
311  ///@brief indicates how many proton bonded neighbors an atom has
312  Size
313  number_bonded_hydrogens( Size const atomno ) const
314  {
315  if( attached_H_end_[ atomno ] == 0 ) return 0;
316  else return attached_H_end_[ atomno ] - attached_H_begin_[ atomno ] + 1;
317  }
318 
319  ///@brief indicates how many heavyatom bonded neighbors an atom has
320  Size
321  number_bonded_heavyatoms( Size const atomno ) const
322  {
323  return bonded_neighbor_[ atomno ].size () - number_bonded_hydrogens( atomno );
324  }
325 
326  /// @brief indices of the bonded neighbors for an atom
327  AtomIndices const &
328  bonded_neighbor( Size const atomno ) const
329  {
330  return bonded_neighbor_[ atomno ];
331  }
332 
334  {
335  return bonded_neighbor_type_[atomno];
336  }
337 
338  /// @brief indices of the bonded neighbors for an atom
339  AtomIndices const &
340  cut_bond_neighbor( Size const atomno ) const
341  {
342  return cut_bond_neighbor_[ atomno ];
343  }
344 
345  /// @brief indices of the bonded neighbors for an atom, shortcut for bonded_neighbor(atomno)
346  AtomIndices const &
347  nbrs( Size const atomno ) const
348  {
349  return bonded_neighbor_[ atomno ];
350  }
351 
352  /// @brief indices of the atoms which are used to define a given chi angle (chino)
353  AtomIndices const &
354  chi_atoms( Size const chino ) const
355  {
356  return chi_atoms_[ chino ];
357  }
358 
359  /// @brief indices of the atoms which are used to define all the chi angles
361  chi_atoms() const
362  {
363  return chi_atoms_;
364  }
365 
366 
367  ///@brief Indices of all backbone atoms, hydrogens and heavyatoms
368  AtomIndices const &
369  all_bb_atoms() const {
370  return all_bb_atoms_;
371  }
372 
373  ///@brief Indices of all sidechain atoms, hydrogens and heavyatoms
374  AtomIndices const &
375  all_sc_atoms() const {
376  return all_sc_atoms_;
377  }
378 
379 
380  /// @brief return indices of aromatic Hydrogens
381  AtomIndices const &
382  Haro_index() const
383  {
384  return Haro_index_;
385  }
386 
387  /// @brief return indices of polar Hydrogens
388  AtomIndices const &
389  Hpol_index() const
390  {
391  return Hpol_index_;
392  }
393 
394 
395  /// @brief indices of polar hydrogens as Hbond donors
396  AtomIndices const &
397  Hpos_polar() const
398  {
399  return Hpos_polar_;
400  }
401 
402  /// @brief indices of non-polar hydrogens as potential carbon Hbond donors
403  AtomIndices const &
404  Hpos_apolar() const
405  {
406  return Hpos_apolar_;
407  }
408 
409  AtomIndices const &
411  {
412  return Hpos_polar_sc_;
413  }
414 
415  /// @brief indices of atoms as Hbond acceptors
416  AtomIndices const &
417  accpt_pos() const
418  {
419  return accpt_pos_;
420  }
421 
422  /// @brief indices of atoms as Hbond acceptors
423  AtomIndices const &
424  accpt_pos_sc() const
425  {
426  return accpt_pos_sc_;
427  }
428 
429  bool
431  assert( finalized_ );
432  return heavyatom_has_polar_hydrogens_[ ind ];
433  }
434 
435  bool
437  assert( finalized_ );
438  return heavyatom_is_an_acceptor_[ ind ];
439  }
440 
441  bool
443  assert( finalized_ );
444  return atom_is_polar_hydrogen_[ ind ];
445  }
446 
447  /// @brief indices of all mainchain atoms
448  AtomIndices const &
450  {
451  return mainchain_atoms_;
452  }
453 
454 
455  /// @brief index of mainchain atom
456  Size
457  mainchain_atom( Size const atm) const
458  {
459  return mainchain_atoms_[atm];
460  }
461 
462 
463  /// @brief set indices of all mainchain atoms
464  void
465  set_mainchain_atoms( AtomIndices const & mainchain )
466  {
467  mainchain_atoms_ = mainchain;
468  }
469 
470  /// @brief is this atom present in this residue?
471  bool
472  has( std::string const & atom_name ) const
473  {
474  return ( atom_index_.find( atom_name ) != atom_index_.end() );
475  }
476 
477  /// @brief get index of an atom's base atom
478  Size
479  atom_base( Size const atomno ) const;
480 
481  /// @brief get index of an atom's second base atom
482  Size
483  abase2( Size const atomno ) const;
484 
485  /// @brief get atom name by index
486  std::string const &
487  atom_name( Size const index ) const;
488 
489 
490  /// @brief Check if residue type has an atom by a given atomname
491  bool
492  has_atom_name( std::string const & name ) const;
493 
494 
495  /// @brief get atom index by name
496  Size
497  atom_index( std::string const & name ) const;
498 
499 
500  void
501  show_all_atom_names( std::ostream & out ) const;
502 
503 
504  /// @brief index of the last backbone heavy atom
505  Size
507  {
508  return n_backbone_heavyatoms_;
509  }
510 
511  /// @brief index of the first sidechain atom (heavy or hydrogen)
512  Size
514  {
516  }
517 
518 
519  /// @brief index of the first sidehchain hydrogen
520  Size
522  {
523  assert( finalized_ );
525  }
526 
527 
528  /// @brief is a backbone atom (heavy or hydorgen)?
529  bool
530  atom_is_backbone( Size const atomno ) const
531  {
532  assert( finalized_ );
533  assert( atomno <= natoms_ );
534  return ( ( atomno <= n_backbone_heavyatoms_ ) ||
535  ( atomno > nheavyatoms_ && atomno < first_sidechain_hydrogen_ ) );
536  }
537 
538  /// @brief quick lookup: is the atom with the given index a hydrogen or not?
539  /// Atoms are sorted so that heavy atoms come first and hydrogen atoms come last.
540  bool
541  atom_is_hydrogen( Size const atomno ) const
542  {
543  assert( finalized_ );
544  assert( atomno <= natoms_ );
545  return atomno > nheavyatoms_;
546  }
547 
548  /// @brief Read access to the last_controlling_chi_ array
551  return last_controlling_chi_;
552  }
553 
554  /// @brief The last_controlling_chi for an atom. 0 if an atom is controlled by no chi.
555  Size
556  last_controlling_chi( Size atomno ) const {
557  return last_controlling_chi_[ atomno ];
558  }
559 
560  /// @brief Read access to the atoms_last_controlled_by_chi_ array
564  }
565 
566  /// @brief Read access to the Atoms last controlled by a particular chi
567  AtomIndices const &
569  return atoms_last_controlled_by_chi_[ chi ];
570  }
571 
572  /// @brief get indices for atoms used to define actcoord
573  AtomIndices const &
575  {
576  return actcoord_atoms_;
577  }
578 
579  //////////////////////////////////////////////////////////////////////
580  //////////////////////////////////////////////////////////////////////
581  //////////////////////////////////////////////////////////////////////
582  ///////////////// MMAtom Functions //////////////////////
583  //////////////////MMAtom Functions ///////////////////////
584  //////////////////////////////////////////////////////////////////////
585  //////////////////////////////////////////////////////////////////////
586 
587  /// @brief Get the MM atom_type for this atom by its index number in this residue
588  MMAtomType const &
589  mm_atom_type( Size const atomno ) const;
590 
591 
592  /// @brief Get the MM atom_type index number for this atom by its index number in this residue
593 
594  //////////////////////////////////////////////////////////////////////
595  //////////////////////////////////////////////////////////////////////
596  //////////////////////////////////////////////////////////////////////
597  ///////////////// Orbital Functions //////////////////////
598  //////////////// Orbital Functions //////////////////////
599  //////////////////////////////////////////////////////////////////////
600  //////////////////////////////////////////////////////////////////////
601 
603  orbital_type(int const orbital_index) const;
604 
605 // core::Size
606 // orbital_type_index( Size const orb_index ) const;
607 
608 
609  /// @brief number of orbitals
610  Size
611  n_orbitals() const
612  {
613  return n_orbitals_;
614  }
615 
616  /// @brief indices of the orbitals bonded to an atom
618  bonded_orbitals(Size const atomno)const
619  {
620  return orbital_bonded_neighbor_[atomno];
621  }
622 
623 
624  /// @brief is this orbital present in this residue?
625  bool
626  has_orbital( std::string const & orbital_name ) const
627  {
628  return ( orbitals_index_.find( orbital_name ) != orbitals_index_.end() );
629  }
630 
631  //@brief indices of atoms with orbitals
632  AtomIndices const &
634  {
635  return atoms_with_orb_index_;
636  }
637 
638 
639  /// @brief orbital name by index
640 // std::string const &
641 // orbital_name( Size const index ) const
642 // {
643 // return orbitals_[index].name();
644 // }
645 
646 
647  /// @brief get orbital index by name
648  core::Size
649  orbital_index( std::string const & name ) const;
650 
651 
652 
653  //////////////////////////////////////////////////////////////////////
654  //////////////////////////////////////////////////////////////////////
655  //////////////////////////////////////////////////////////////////////
656  ///////////////// Residue Functions //////////////////////
657  //////////////// Residue Functions //////////////////////
658  //////////////////////////////////////////////////////////////////////
659  //////////////////////////////////////////////////////////////////////
660 
661  ResidueTypeSet const &
662  residue_type_set() const;
663 
664  ///@brief set the residue type set of origin.
665  void
667 
668  /// @brief number of chi angles
669  Size
670  nchi() const
671  {
672  return chi_atoms_.size();
673  }
674 
675  /// @brief number of proton chis
676  Size
677  n_proton_chi() const
678  {
679  return proton_chis_.size();
680  }
681 
682  /// @brief number of proton chis
683  bool
684  is_proton_chi( Size const chino ) const
685  {
686  return ( std::find( proton_chis_.begin(), proton_chis_.end(), chino ) != proton_chis_.end() );
687  }
688 
689  /// @brief translate proton_chi to global chi
690  Size
691  proton_chi_2_chi( Size proton_chi_id ) const
692  {
693  return proton_chis_[ proton_chi_id ];
694  }
695  Size
696  chi_2_proton_chi( Size chi_index ) const
697  {
698  return chi_2_proton_chi_[ chi_index ];
699  }
700 
702  proton_chi_samples( Size proton_chi ) const
703  {
704  return proton_chi_samples_[ proton_chi ];
705  }
706 
708  proton_chi_extra_samples( Size proton_chi ) const
709  {
710  return proton_chi_extra_samples_[ proton_chi ];
711  }
712 
713 
714 
715  /// @brief set the atom which connects to the lower connection
716  void
717  set_lower_connect_atom( std::string const & atm_name );
718 
719  ///
720  ResidueConnection const & upper_connect() const;
721 
722  ///
723  ResidueConnection const & lower_connect() const;
724 
725  Size
727  {
728  return upper_connect_id_;
729  }
730 
731  Size
733  {
734  return lower_connect_id_;
735  }
736 
737  /// @brief index number of the atom which connects to the upper connection
738  Size
739  upper_connect_atom() const;
740 
741  /// @brief set the atom which connects to the upper connection
742  void
743  set_upper_connect_atom( std::string const & atm_name );
744 
745 
746  /// @brief all rotamers bins (mean, std) for a given chi angle
748  chi_rotamers( Size const chino ) const
749  {
750  return chi_rotamers_[ chino ];
751  }
752 
753 
754 
755  /// @brief number of ResidueConnections, counting polymeric residue connections
756  Size
757  n_residue_connections() const;
758 
759  Size
762  }
763 
764  Size
767  }
768 
769  /// @brief get a ResidueConection
770  ResidueConnection const & residue_connection( Size const i ) const;
771 
773 
774 
775  /// @brief Does an atom form any inter-residue chemical bonds?
776  bool
778  return atom_2_residue_connection_map_[ atomid ].size() != 0;
779  }
780 
781  /// @brief How many inter-residue chemical bonds does a particular atom form?
782  Size
783  n_residue_connections_for_atom( Size const atomid ) const {
784  return atom_2_residue_connection_map_[ atomid ].size();
785  }
786 
787  /// @brief Convenience access function for the residue connection
788  /// at a particular atom; requires that there is exactly one residue
789  /// connection at this atom.
790  Size
791  residue_connection_id_for_atom( Size const atomid ) const {
792  assert( atom_2_residue_connection_map_[ atomid ].size() == 1 );
793  return atom_2_residue_connection_map_[ atomid ][ 1 ];
794  }
795 
796  //// @brief Accessor for the full complement of residue connections for a single atom.
798  residue_connections_for_atom( Size const atomid ) const {
799  return atom_2_residue_connection_map_[ atomid ];
800  }
801 
802 
803  bool
804  residue_connection_is_polymeric( Size const resconn_id ) const {
805  return ( resconn_id == lower_connect_id_ || resconn_id == upper_connect_id_ );
806  }
807 
808  Size
809  residue_connect_atom_index( Size const resconn_id ) const;
810 
811 
812  /// @brief require actcoord?
813  inline
814  bool
816 
817  /// @brief update actcoord
818  void
820 
821 
822  //////////////////////////////////////////////////////////////////////
823  //////////////////////////////////////////////////////////////////////
824  //////////////////////////////////////////////////////////////////////
825  ///////////////// methods for building residue////////////////////////
826  //////////////////////////////////////////////////////////////////////
827  //////////////////////////////////////////////////////////////////////
828  //////////////////////////////////////////////////////////////////////
829 
830 
831  //////////////////////////////////////////////////////////////////////
832  /////////////////////////atoms////////////////////////////////////////
833  //////////////////////////////////////////////////////////////////////
834 
835  /// @brief add an atom into this residue
836  void
837  add_atom(
838  std::string const & atom_name,
839  std::string const & atom_type_name,
840  std::string const & mm_atom_type_name,
841  Real const charge /*
842  std::string const & count_pair_lower_name,
843  std::string const & count_pair_upper_name,
844  std::string const & count_pair_special*/
845  );
846 
847 
848  /// @brief flag an atom for deletion by adding its index to the delete_atom_ list
849  void
851  {
852  finalized_ = false;
853  assert( has( name ) );
854  delete_atoms_.push_back( atom_index( name ) );
855  }
856 
857  /// @brief set atom type
858  void
860  std::string const & atom_name,
861  std::string const & atom_type_name
862  );
863 
864 
865  /// @brief set mm atom type
866  void
868  std::string const & atom_name,
869  std::string const & mm_atom_type_name
870  );
871 
872 
873  /// @brief add a bond between atom1 and atom2, if bond type is not specified, default to SingleBond
874  void
875  add_bond(
876  std::string const & atom_name1,
877  std::string const & atom_name2
878  );
879 
880  // @brief add a bond between atom1 and atom2, specifying a bond type (SingleBond, DoubleBond, TripleBond, AromaticBond)
881  void add_bond(std::string const & atom_name1, std::string const & atom_name2, BondName bondLabel);
882 
883  /// @brief add a bond between atom1 and atom2, if bond type is not specified, default to a SingleBond
884  void
885  add_cut_bond(
886  std::string const & atom_name1,
887  std::string const & atom_name2
888  );
889 
890 
891  // nbr_atom and nbr_radius are used for rsd-rsd neighbor calculation
892 
893  /// @brief set nbr_atom used to define residue-level neighbors
894  void
896  {
897  nbr_atom_ = atom_index( atom_name );
898  }
899 
900  /// @brief get nbr_atom used to define residue-level neighbors
901  Size
902  nbr_atom() const
903  {
904  return nbr_atom_;
905  }
906 
907  /// @brief set nbr_radius_ used to define residue-level neighbors
908  void
909  nbr_radius( Real const radius )
910  {
911  nbr_radius_ = radius;
912  }
913 
914  /// @brief get nbr_radius_ used to define residue-level neighbors
915  Real
916  nbr_radius() const
917  {
918  return nbr_radius_;
919  }
920 
921  /// @brief get the molecular weight of this residue
922  core::Real const &
924  {
925  return molecular_mass_;
926  }
927 
928  /// @brief get the molecular weight of this residue
929  core::Real const &
930  molar_mass() const
931  {
932  return molar_mass_;
933  }
934 
935  /// @brief sets atom_base[ atom1 ] = atom2
936  void
938  std::string const & atom_name1,
939  std::string const & atom_name2
940  );
941 
942 
943  /// @brief set an atom as backbone heavy atom
944  /**
945  backbone stuff is a little tricky if we want to allow newly added atoms,
946  eg in patching, to be backbone atoms. We move any exsiting backbone heavy
947  atoms back into force_bb_ list and add the new one. Afterwards, the new
948  backbone heavy atom list will be generated in finalize() using info from
949  force_bb_.
950  **/
951  void
953 
954  /// @brief Dump out atomnames and icoor values
955  void
957 
958  /// @brief AtomICoord of an atom
959  AtomICoor const &
960  icoor( Size const atm ) const;
961 
962  /// @brief set AtomICoor for an atom
963  void
964  set_icoor(
965  std::string const & atm,
966  Real const phi,
967  Real const theta,
968  Real const d,
969  std::string const & stub_atom1,
970  std::string const & stub_atom2,
971  std::string const & stub_atom3,
972  bool const update_xyz = false
973  );
974 
975  /// @brief set AtomICoor for an atom
976  void
977  set_icoor(
978  Size const & index,
979  std::string const & atm,
980  Real const phi,
981  Real const theta,
982  Real const d,
983  std::string const & stub_atom1,
984  std::string const & stub_atom2,
985  std::string const & stub_atom3,
986  bool const update_xyz = false
987  );
988 
989  void assign_neighbor_atom();
990 
992 
993  /// @brief calculate AtomICoor for an atom and set it
994  void calculate_icoor(
995  std::string const & child,
996  std::string const & stub_atom1,
997  std::string const & stub_atom2,
998  std::string const & stub_atom3
999  );
1000 
1001  void
1002  set_ideal_xyz(
1003  std::string const & atm,
1004  Vector const & xyz_in
1005  );
1006 
1007  void
1008  set_ideal_xyz(
1009  Size index,
1010  Vector const & xyz_in
1011  );
1012 
1013  //////////////////////////////////////////////////////////////////////
1014  /////////////////////////orbitals/////////////////////////////////////
1015  //////////////////////////////////////////////////////////////////////
1016 
1017  ///@brief add an orbital onto a residue based upon atom
1018  void
1019  add_orbital(
1020  std::string & orbital_name,
1021  std::string & orbital_type_name
1022  );
1023 
1024  ///@brief add an orbital bond between an atom and an orbital.
1025  ///@note NOTE!!!!! This is indexed based upon atoms, not orbitals. That means that in your params file
1026  /// you must have the atom as the first and orbital as the second.
1027  void
1029  std::string const & atom_name1,
1030  std::string const & orbital_name
1031  );
1032 
1034  orbital_icoor_data(Size const orbital_index) const;
1035 
1036 
1039 
1040 
1041  ///@brief set OrbitalICoor for an orbital
1042  void
1044  std::string const & orbital,
1045  Real const phi,
1046  Real const theta,
1047  Real const d,
1048  std::string const & stub_atom1,
1049  std::string const & stub_atom2,
1050  std::string const & stub_atom3
1051  );
1052  //////////////////////////////////////////////////////////////////////
1053  /////////////////////////residues/////////////////////////////////////
1054  //////////////////////////////////////////////////////////////////////
1055 
1056 
1057  /// @brief add a chi angle defined by four atoms
1058  void
1059  add_chi(
1060  Size const chino,
1061  std::string const & atom_name1,
1062  std::string const & atom_name2,
1063  std::string const & atom_name3,
1064  std::string const & atom_name4
1065  );
1066 
1067 
1068  /// @brief redefine a chi angle based on four atoms
1069  // Added by Andy M. Chen in June 2009
1070  // This is needed for certain PTM's
1071  void
1072  redefine_chi(
1073  Size const chino,
1074  std::string const & atom_name1,
1075  std::string const & atom_name2,
1076  std::string const & atom_name3,
1077  std::string const & atom_name4
1078  );
1079 
1080  void
1082  Size chino,
1083  utility::vector1< Real > dihedral_samples,
1084  utility::vector1< Real > extra_samples
1085  );
1086 
1087  /// @brief add a rotamer bin for a given chi
1088  void
1090  Size const chino,
1091  Real const mean,
1092  Real const sdev
1093  );
1094 
1095  /// @brief recalculate derived data, potentially reordering atom-indices
1096  void
1097  finalize();
1098 
1099  /// @brief an assertion funtion to ensure an ResidueType has been finalized
1100  inline
1101  void
1103  {
1104  if ( !finalized_ ) {
1105  utility_exit_with_message( "need to finalize the residue first" );
1106  }
1107  }
1108 
1109 
1110  /// @brief add a ResidueConnection
1111  /// Doesnt set the ideal geometry -- maybe it should?
1112  ///
1113  Size
1115 
1116 
1117  //////////////////////////////////////////////////////////////////////
1118  //////////////////////////////////////////////////////////////////////
1119  //////////////////////////////////////////////////////////////////////
1120  ///////////////// properties /////////////////////////////////////////
1121  //////////////////////////////////////////////////////////////////////
1122  //////////////////////////////////////////////////////////////////////
1123  //////////////////////////////////////////////////////////////////////
1124 
1125  /// @brief acess specified properties
1127  properties() const;
1128 
1129  /// @brief add properties
1130  void
1131  add_property( std::string const & property );
1132 
1133  /// @brief delete properties
1134  // Added by Andy M. Chen in June 2009
1135  // This is needed for deleting properties, which occurs in certain PTM's
1136  void
1137  delete_property( std::string const & property );
1138 
1139 
1140  /// @brief add an atom to the list for calculating actcoord center
1141  void add_actcoord_atom( std::string const & atom );
1142 
1143 
1144  /// @brief is polymer?
1145  bool
1146  is_polymer() const
1147  {
1148  return is_polymer_;
1149  }
1150 
1151  /// @brief is protein?
1152  bool
1153  is_protein() const
1154  {
1155  return is_protein_;
1156  }
1157 
1158  /// @brief is DNA?
1159  bool
1160  is_DNA() const
1161  {
1162  return is_DNA_;
1163  }
1164 
1165  /// @brief is RNA?
1166  bool
1167  is_RNA() const
1168  {
1169  return is_RNA_;
1170  }
1171 
1172  /// @brief is coarse?
1173  bool
1174  is_coarse() const
1175  {
1176  return is_coarse_;
1177  }
1178 
1179  /// @brief is Nucleic Acid?
1180  bool
1181  is_NA() const
1182  {
1183  return is_NA_;
1184  }
1185 
1186  /// @brief is carbohydrate?
1187  bool
1189  {
1190  return is_carbohydrate_;
1191  }
1192 
1193  bool
1194  is_ligand() const
1195  {
1196  return is_ligand_;
1197  }
1198 
1199  /// @brief is surface? (e.g. enamel)
1200  bool
1201  is_surface() const
1202  {
1203  return is_surface_;
1204  }
1205 
1206  ///@brief does this residue have sidechain orbitals?
1207  bool
1209  {
1210  return has_sc_orbitals_;
1211  }
1212 
1213  /// @brief is polar?
1214  bool
1215  is_polar() const
1216  {
1217  return is_polar_;
1218  }
1219 
1220  /// @brief is charged?
1221  bool
1222  is_charged() const
1223  {
1224  return is_charged_;
1225  }
1226 
1227  /// @brief is aromatic?
1228  bool
1229  is_aromatic() const
1230  {
1231  return is_aromatic_;
1232  }
1233 
1234  /// @brief is terminus?
1235  bool
1236  is_terminus() const
1237  {
1238  return is_terminus_;
1239  }
1240 
1241  /// @brief is lower terminus?
1242  bool
1244  {
1245  return is_lower_terminus_;
1246  }
1247 
1248  /// @brief is upper terminus?
1249  bool
1251  {
1252  return is_upper_terminus_;
1253  }
1254 
1255  /// @brief is acetylated n terminus
1256  bool
1258  {
1259  return is_acetylated_nterminus_;
1260  }
1261 
1262  /// @brief is methylated c terminus
1263  bool
1265  {
1266  return is_methylated_cterminus_;
1267  }
1268 
1269  /// @brief is branch point for a branched polymer?
1270  bool
1272  {
1273  if (branch_point_atoms_.size() == 0) {
1274  return false;
1275  }
1276  return true;
1277  }
1278 
1279  /// @brief Check if atom is virtual.
1280  bool
1281  is_virtual( Size const & atomno ) const;
1282 
1283  /// @brief Check if residue is 'VIRTUAL_RESIDUE'
1284  bool
1285  is_virtual_residue() const;
1286 
1287  /// @brief is an adduct-modified residue?
1288  bool
1289  is_adduct() const
1290  {
1291  return is_adduct_;
1292  }
1293 
1294  void
1295  set_adduct_flag( bool adduct_in )
1296  {
1297  is_adduct_ = adduct_in;
1298  }
1299 
1300 
1301  /// @brief Generic property access -- SLOW!!!!!
1302  bool
1303  has_property( std::string const & property ) const
1304  {
1305  return ( std::find( properties_.begin(), properties_.end(), property ) != properties_.end() );
1306  }
1307 
1308  /// @brief Generic variant access -- SLOW!!!!!
1309  bool
1310  has_variant_type( VariantType const & variant_type ) const
1311  {
1312  return ( std::find( variant_types_.begin(), variant_types_.end(), variant_type ) != variant_types_.end() );
1313  }
1314 
1315  /// @brief get all the variant types for this ResidueType
1318  {
1319  return variant_types_;
1320  }
1321 
1322  /// @brief Does this residue have exactly the same set of properties as residue other?
1323  /// phil -- this code does not look correct to me
1324  /// should probably be other.has_variant_type not other.has_property
1325  ///
1326  bool
1327  variants_match( ResidueType const & other ) const;
1328 
1329  /// @brief similar to variants_match(), but allows different
1330  /// adduct-modified states
1331  bool
1332  nonadduct_variants_match( ResidueType const & other ) const;
1333 
1334 
1335  /// @brief add one more variant type to this ResidueType
1336  void
1337  add_variant_type( VariantType const & variant_type )
1338  {
1339  if ( !has_variant_type( variant_type ) ) {
1340  variant_types_.push_back( variant_type );
1341  }
1342  }
1343 
1344  /// @brief set our aa-type (could be "UNK")
1345  void
1346  aa( std::string const & type )
1347  {
1348  aa_ = aa_from_name( type );
1349  }
1350  /// @brief AA to use for rotamer library
1351  void
1352  rotamer_aa( std::string const & type )
1353  {
1354  rotamer_aa_ = aa_from_name( type );
1355  }
1356 
1357 
1358  //////////////////////////////////////////////////////////////////////
1359  //////////////////////////////////////////////////////////////////////
1360  //////////////////////////////////////////////////////////////////////
1361  ///////////////// Names //////////////////////////////////////////
1362  ///////////////// Names /////////////////////////////////////////
1363  //////////////////////////////////////////////////////////////////////
1364  //////////////////////////////////////////////////////////////////////
1365  //////////////////////////////////////////////////////////////////////
1366 
1367 
1368  /// @brief get our (unique) residue name
1369  std::string const &
1370  name() const
1371  {
1372  return name_;
1373  }
1374 
1375  /// @brief set our (unique) residue name
1376  void
1377  name( std::string const & name_in )
1378  {
1379  name_ = name_in;
1380  }
1381 
1382 
1383  /// @brief get our 3letter code
1384  std::string const &
1385  name3() const
1386  {
1387  return name3_;
1388  }
1389 
1390  /// @brief set our 3letter code
1391  void
1392  name3( std::string const & name_in )
1393  {
1394  name3_ = name_in;
1395  }
1396 
1397 
1398  /// @brief get our 1letter code
1399  char
1400  name1() const
1401  {
1402  return name1_;
1403  }
1404 
1405 
1406  /// @brief set our 1letter code
1407  void
1408  name1( char const code )
1409  {
1410  name1_ = code;
1411  }
1412 
1413 
1414  ///@brief set the MolData object
1415  void set_mol_data(sdf::MolData const & mol_data)
1416  {
1417  mol_data_ = mol_data;
1418  }
1419 
1421  {
1422  return mol_data_;
1423  }
1424 
1425 
1426  /// our traditional residue type, if any
1427  /**
1428  Used for knowledge-based scores, dunbrack, etc.
1429  could be "aa_unk"
1430 
1431  Not clear what AA is -- maybe an int, maybe an enum, maybe a "key"
1432  **/
1433  AA const &
1434  aa() const
1435  {
1436  return aa_;
1437  }
1438 
1439  AA const &
1440  rotamer_aa() const
1441  {
1442  if(rotamer_aa_==aa_unk) return aa_;
1443  return rotamer_aa_;
1444  }
1445 
1446 
1447 
1448 
1449 // /// @brief get csd atom name by index
1450 // std::string const &
1451 // csd_atom_name( Size const index ) const
1452 // {
1453 // return csd_atom_name_[ index ];
1454 // }
1455 
1456 
1457 
1459 
1460  /// @brief A residue parameter file can refer to a set of "pdb rotamers" that can be
1461  /// superimposed onto a starting position for use in the packer. These rotamers
1462  /// are loaded into the pack::dunbrack::RotamerLibrary at the time of their first use.
1464 
1465  //pack::dunbrack::SingleResidueRotamerLibraryCAP get_RotamerLibrary() const;
1466  //void set_RotamerLibrary(pack::dunbrack::SingleResidueRotamerLibraryCOP rotlib);
1467 
1468  //XRW_B_T1
1469  /*
1470  void set_translator(coarse::TranslatorCAP map) const {
1471  translator_ = map;
1472  }
1473  */
1474  //XRW_E_T1
1475  //
1476 
1477 
1478  ////////////////////////////////////////////////////////////////////////////
1479  /// dihedral methods
1480 public:
1481 
1482  /// @brief Return the indices for the set of atoms that define a particular
1483  /// intraresidue dihedral
1484  dihedral_atom_set const &
1485  dihedral( Size const dihe ) const
1486  {
1487  return dihedral_atom_sets_[ dihe ];
1488  }
1489 
1490  /// @brief Returns the list of all of the indices of all the intraresidue
1491  /// dihedrals a particular atom is involved in.
1492  /// Useful for calculating the derivatives for an atom.
1493  utility::vector1< Size > const &
1494  dihedrals_for_atom( Size atomno ) const
1495  {
1496  return dihedrals_for_atom_[ atomno ];
1497  }
1498 
1499  /// @brief Return the number of intraresidue dihedrals. This covers all pairs
1500  /// of atoms that are separated by four bonds, and all pairs of intervening
1501  /// atoms.
1502  Size
1503  ndihe() const
1504  {
1505  return ndihe_;
1506  }
1507 
1508  ///
1509  void
1510  print_dihedrals() const; // for debugging
1511 
1512  /// @brief Return the indices for the set of atoms that define a particular
1513  /// intraresidue angle
1514  bondangle_atom_set const &
1515  bondangle( Size const bondang ) const
1516  {
1517  return bondangle_atom_sets_[ bondang ];
1518  }
1519 
1520  /// @brief Returns the list of all of the indices of all the intraresidue
1521  /// bond angles a particular atom is involved in.
1522  /// Useful for calculating the derivatives for an atom.
1523  utility::vector1< Size > const &
1524  bondangles_for_atom( Size atomno ) const
1525  {
1526  return bondangles_for_atom_[ atomno ];
1527  }
1528 
1529  /// @brief get number of intraresidue bond angles
1530  Size
1532  {
1533  return bondangle_atom_sets_.size();
1534  }
1535 
1536  /// @brief print intraresidue bond angles to standard out
1537  void
1538  print_bondangles() const; // for debug
1539 
1540  /// @brief print chemical-bond path distances to standard out
1541  void
1542  print_pretty_path_distances() const; // for debug
1543 
1544  /// @brief Sets the path for the NCAA rotlib for the ResidueType
1545  void
1547  {
1548  ncaa_rotlib_path_ = path;
1549  }
1550 
1551  /// @brief Returns the path to the NCAA rotlib for the residue type
1552  std::string const &
1554  {
1555  return ncaa_rotlib_path_;
1556  }
1557 
1558  /// @brief Sets whether we are using a NCAA rotlib for the residue type
1559  void
1560  set_use_ncaa_rotlib( bool flag )
1561  {
1562  use_ncaa_rotlib_ = flag;
1563  }
1564 
1565  /// @brief Returns whether we are using a NCAA rotlib for the residue type
1566  bool
1568  {
1569  return use_ncaa_rotlib_;
1570  }
1571 
1572  /// @brief Sets the number of rotatable bonds described by the NCAA rotlib (not nesesarily equal to nchi)
1573  void
1575  {
1576  ncaa_rotlib_n_rots_ = n_rots;
1577  }
1578 
1579  /// @brief Returns the number of rotatable bonds described by the NCAA rotlib (not nesesarily equal to nchi)
1580  Size
1582  {
1583  return ncaa_rotlib_n_rots_;
1584  }
1585 
1586  /// @brief Sets the number of rotamers for each rotatable bond described by the NCAA rotlib
1587  void
1589 
1590  /// @brief Returns the number of rotamers for each rotatable bond described by the NCAA rotlib for a single bond
1591  Size
1593  {
1594  return ncaa_rotlib_n_bins_per_rot_[ n_rot ];
1595  }
1596 
1597  /// @brief Returns the number of rotamers for each rotatable bond described by the NCAA rotlib for all bonds
1598  utility::vector1<Size> const &
1600  {
1602  }
1603 
1604  /// @brief Returns a list of those atoms within one bond of a residue connection. For residue connection i,
1605  /// its position in this array is a list of pairs of atom-id's, the first of which is always the id
1606  /// for the atom forming residue connection i.
1609  {
1611  }
1612 
1613  /// @brief Returns a list of pairs for atom# atomid where
1614  /// first == the residue_connection id that lists atomid as being within one bond
1615  /// of a residue connection, and
1616  /// second == the index of the entry containing this atom in the
1617  /// atoms_within_one_bond_of_a_residue_connection_[ first ] array.
1618  /// Useful for calculating the derivatives for an atom.
1621  {
1622  return within1bonds_sets_for_atom_[ atomid ];
1623  }
1624 
1625  /// @brief Returns the list of those atoms within two bonds of
1626  /// residue connection # resconn. Each entry in this list is
1627  /// a triple of atom-id's, the first of which is always the id for
1628  /// the atom forming residue connection resconn.
1631  {
1633  }
1634 
1635  /// @brief Returns a list of pairs for atom # atomid where
1636  /// first == the residue_connection id that lists this atom as being within two bonds
1637  /// of a residue connection, and
1638  /// second == the index of the entry containing this atom in the
1639  /// atoms_within_two_bonds_of_a_residue_connection_[ first ] array.
1640  /// Useful for calculating the derivatives for an atom.
1643  return within2bonds_sets_for_atom_[ atomid ];
1644  }
1645 
1646  ///////////////////////////////////////////////////////////////
1648  RNA_type() const{
1649 
1650  return rna_residuetype_;
1651 
1652  }
1653 
1654  /// @brief Return the CarbohydrateInfo object containing sugar-specific properties for this residue.
1656 
1657  /// @brief Set force_nbr_atom_orient_, used to control orient atoms selected by select_orient_atoms
1658  void
1659  force_nbr_atom_orient( bool force_orient )
1660  {
1661  force_nbr_atom_orient_ = force_orient;
1662  }
1663 
1664  /// @brief Return force_nbr_atom_orient_, used to control orient atoms selected by select_orient_atoms
1666  {
1667  return force_nbr_atom_orient_;
1668  }
1669 
1670  /// @brief Selects three atoms for orienting this residue type
1671  void
1673  Size & center,
1674  Size & nbr1,
1675  Size & nbr2
1676  ) const;
1677 
1678 ///////////////////////////////////////////////////////////////////////////////////////////
1679 
1680 
1681 public:
1682  ////////////////////////////////////////////////////////////////////////////
1683  // adduct methods
1684  /// @brief get the adducts defined for this residue
1687  {
1688  return defined_adducts_;
1689  }
1690 
1691  void
1692  add_adduct( Adduct & adduct_in )
1693  {
1694  defined_adducts_.push_back( adduct_in );
1695  }
1696 
1697  void
1698  report_adducts();
1699 
1700  ////////////////////////////////////////////////////////////////////////////
1701  // private methods
1702 private:
1703 
1704  /// set up atom ordering map old2new, called by finalize()
1705  void
1706  setup_atom_ordering( AtomIndices & old2new );
1707 
1708  /// reorder primary data in ResidueType given the old2new map, called by finalize()
1709  void
1710  reorder_primary_data( AtomIndices const & old2new );
1711 
1712  /// update derived data in ResidueType, called by finalize()
1713  void
1715 
1716  void
1718 
1719  /// @brief compute the last controlling chi for an atom during the update_derived_data() stage.
1720  /// The last controlling chi is the furthest chi downstream of the mainchain which can change
1721  /// the location of an atom.
1722  void
1724 
1725  /// @brief Recursive subroutine invoked by update_last_controlling_chi().
1726  void
1727  note_chi_controls_atom( Size chi, Size atomno );
1728 
1729  ///@ recursive function to assign internal coordinates
1730  void assign_internal_coordinates(std::string const & current_atom);
1731 
1732  /////////////////////////////////////////////////////////////////////////////
1733  // data, see WARNING below
1734  /////////////////////////////////////////////////////////////////////////////
1735 
1736 private:
1737 
1738  /// AtomTypeSet Object
1739  /**
1740  used to define the set of allowed atomtypes for this residue and
1741  their properties
1742  */
1745  /// MMAtomTypeSet
1747  /// Orbital types
1749 
1750 // CSDAtomTypeSetCAP csd_atom_types_;
1751 
1752 
1754 
1755  /// vector of atoms:
1756  /**
1757  \note not pointers but Atom objects
1758  currently each Atom holds coords, atom_type, count_pair array index
1759 
1760  Atom order rules:
1761  (1) heavyatoms before hydrogens
1762  (2) backbone heavyatoms before sidechain heavyatoms
1763  (3) hydrogens are grouped by the heavyatom they are attached to
1764  and come in the order of those heavyatoms
1765  (4) as a consequence of (2)+(3) --> backbone hydrogens come before
1766  sidechain hydrogens
1767  (5) atom order in the residue file is preserved subject to rules 1-4
1768  see finalize() for the logic to determine the atom order
1769 
1770  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1771  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1772  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1773 
1774  If you add new properties that are associated with atoms and therefore
1775  depend on the atom order, and that get set during Residue creation
1776  before the call to finalize(), then you have to make sure to update them
1777  in finalize() if the atom order changes
1778 
1779  in general, anything that might be sensitive to atom order should
1780  be updated in finalize using the old2new mapping
1781 
1782  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1783  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1784  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1785 
1786  **/
1789 
1790  //////////////////////////////////////////////////////////////////
1791  // ints -- see the WARNING above if these are atom indices
1792  /// number of atoms
1794  /// number of heavy atoms
1796  /// number of hbond_acceptors
1798  /// number of hbond_donors
1800  /// number of orbitals
1802  /// number of backbone heavy atoms
1804  /// the index of first sidechain hydrogen atom
1806  /// number of dihedral angle atom sets
1808 
1809 
1810  //////////////////////////////////////////////////////////////////////
1811  // per-atom properties
1812  /// indices of the atoms psuedo bonded atoms. Used in orbital code
1814  /// indices of each atom's bonded neighbors
1816  /// indices of each atom's bonded neighbor type (uses the same indexing scheme and order as bonded_neighbor_
1818  /// indices of each atom's bonded neighbors
1820  /// indices of each atom's base atom
1822  /// indices of each atom's second base atom, for acceptors atom only
1824  /// indices of each heavyatom's first attached hydrogen
1826  /// indices of each heavyatom's last attached hydrogen
1828 
1829  /// atom parents
1831 
1832  //// Data for the mm potentials. List all of the intra-residue dihedral angles and bond angles.
1833 
1834  /// vector of sets of atoms that make up dihedral angles in the residue
1836  /// all intra-residue dihedral angles that each atom "participates" in.
1838  /// vector of sets of atoms that make up bond angles in the residue
1840  /// all intra-residue bond angles that each atom "participates" in.
1842 
1843  //// Data for controlling chi. Dependent data, computed in update_last_controlling_chi()
1844 
1845  /// for each atom, the last controlling chi angle for that atom. a chi of 0 represents
1846  /// an atom whose location is not determined by any chi.
1848 
1849  /// for chi i, the list of atoms last controlled by i. E.g. chi2 on LEU
1850  /// list cd1, 1hd1, 1hd2, 1hd3, cd2, 2hd1, 2hd2, 2hd3, and hg1
1852 
1853  //////////////////////////////////////////////////////////////////////////
1854  // vectors of indices
1855  /// indices of Hbond acceptor positions
1856 
1857  //indices of atoms with orbitals
1859  //indices of haro hydrogens
1861  //indices of hpolar hydrogens
1864  /// indices of polar Hydrogens for Hbond donors
1866  /// indices of apolar hydrogens
1868  /// indices of Hbond acceptor positions that are part of the sidechain
1869  /// must be a subset of the atoms listed in the accpt_pos_ array
1871  /// indices of polar Hydrogens for Hbond donors that are part of the sidechain
1872  /// must be a subset of the atoms listed in the Hpos_polar_ array
1874  /// Indices of all backbone atoms, hydrogens and heavyatoms
1876  /// Indices of all sidechain atoms, hydrogens and heavyatoms
1878 
1879  /// Vectors of booleans, represented as integers for speed (since vector1<bool> is optimized for space and is slow to read from)
1880  /// 1 for true, 0 for false
1881  utility::vector1< int > heavyatom_has_polar_hydrogens_; // is an atom both a heavy atom and chemically bonded to a polar hydrogen?
1882  utility::vector1< int > heavyatom_is_an_acceptor_; // is an atom both a heavy atom and capable of accepting hydrogen bonds?
1883  utility::vector1< int > atom_is_polar_hydrogen_; // is an atom a polar hydrogen?
1884 
1885  /// @brief indices of all mainchain atoms
1886  ///
1887  /// mainchain_atoms are those atoms on the shortest path from polymer lower_connect
1888  /// to upper_connect. For protein, this will be N, CA and C.
1890  /// indices of action coordinate centers
1891  /**
1892  the geometric center of the atoms listed defined the residue's
1893  "action coordinate"
1894  **/
1896 
1897  ///////////////////////////////////////////////////////////////////////////
1898  // vectors of vectors of indices
1899  /// indices of four atoms to build each chi angle
1906 
1907  /// number of bonds separated between any pair of atoms in this residue
1909 
1910  /// atom index lookup by atom name string
1911  std::map< std::string, int > atom_index_;
1912 
1913  /// atom index lookup by atom name string
1914  std::map< std::string, int > orbitals_index_;
1915 
1916  /// Additional non-dunbrack rotamer bins
1917  /**
1918  pair<Real,Real> ==> mean,sdev
1919  for each chi angle i and rotamer j: chi_rotamers_[i][j]
1920  **/
1922 
1924 
1925  /// NCAA rotlib stuff some of this is hardcoded elsewhere for the CAAs
1926  /// whether or not we should use the NCAA rotlib if it exists
1928  /// path to the NCAA rotlib
1930  /// the number of non-hydrogen chi angles in the NCAA rotlib
1932  /// the number of rotamer bins for each chi angle in the NCAA rotlib
1934 
1935 
1936  /////////////////////////////////////
1937  // properties -- some of these may be deducible from AA?
1938  //
1939  // if you add new things -- do they need to be initialized in the c-tor?
1940  // gcc debug does not seem to initialize bools to false!
1941 
1942  /// residue properties as defined in the residue param files
1948  //bool has_orbitals_;
1951  bool is_DNA_;
1952  bool is_RNA_;
1953  bool is_NA_;
1957  bool is_terminus_; // last or first residue in a chain; set to TRUE during terminus patching
1958  bool is_lower_terminus_; // first residue in a chain; set to TRUE during terminus patching
1959  bool is_upper_terminus_; // last residue in a chain; set to TRUE during terminus patching
1960  bool is_phosphonate_; // amino phosphonic acid instead of amino carboxylic acid
1964  bool is_coarse_; //currently for coarse_RNA only
1966  // etcetc
1967 
1968  /// here we store the patch operations/variant types that describe this residue
1970 
1971 
1972  //////////////////////////////////////////////////
1973  // features
1974 
1975  /// standard rosetta aa-type for knowledge-based potentials, may be aa_unk
1977 
1978  /// unique residue id
1980 
1981  /// pdb-file id, need not be unique
1983 
1984  /// one-letter code, also not necessarily unique
1985  char name1_;
1986 
1987  // for rsd-rsd neighbor calculations
1988  /// atom used for calculating residue-level neighbors
1990  /// radius cutoff to define neighors
1992 
1993  // Controls which atoms are selected by "select_orient_atoms",
1994  // used to overlay residues during packing.
1996 
1999 
2000  /// number of actcoord atoms
2001  /**
2002  the geometric center of the atoms listed defined the residue's "action coordinate"
2003  **/
2005 
2006  /// the unprocessed metadata
2008 
2009  /// @brief Vector of inter-residue connections expected for this residuetype
2010  /// NOW includes the polymer connections, as well as disulf-type connections
2011  /// @note ResidueConnection objects store the ideal internal coordinates for the connected atom
2012  /// @note Much of the code assumes at most one residue connection per atom.
2013  /// The pseudobond code has been partially written to handle cases where multiple connections
2014  /// to a single atom can exist, but much of the standard residue connection code assumes a
2015  /// simple correspondence between atoms and residue connections. That code will have to be
2016  /// updated to support single-atom "backbones."
2019 
2020  /// @brief For calculating inter-residue bond angle and bond torsion energies, it is useful to have a list of those
2021  /// atoms within one bond of a residue connection atom. For residue connection i,
2022  /// its position in this array is a list of pairs of atom-id's, the first of which is always the id
2023  /// for the atom forming residue connection i.
2025 
2026  /// @brief For atom i, its position in this vector is a list of pairs where
2027  /// first == the residue_connection id that lists this atom as being within one bond
2028  /// of a residue connection, and
2029  /// second == the index of the entry containing this atom in the
2030  /// atoms_within_one_bond_of_a_residue_connection_[ first ] array.
2032 
2033  /// @brief For calculating inter-residue bond torsion energies, it is useful to have a list of those
2034  /// atoms within two bonds of a residue connection atom. For residue connection i,
2035  /// its position in this array is a list of triples of atom-id's, the first of which is always the id for
2036  /// the atom forming residue connection i.
2038 
2039  /// @brief For atom i, its position in this vector is a list of pairs where
2040  /// first == the residue_connection id that lists this atom as being within two bonds
2041  /// of a residue connection, and
2042  /// second == the index of the entry containing this atom in the
2043  /// atoms_within_two_bonds_of_a_residue_connection_[ first ] array.
2045 
2046 
2047  /// @brief Polymer lower connections
2048  /// @note ResidueConnection objects store the ideal internal coordinates for the connected atom
2049  // ResidueConnection lower_connect_; // deprecated
2050  Size lower_connect_id_; // which connection is the lower connection?
2051  /// @brief Polymer upper connections
2052  /// @note ResidueConnection objects store the ideal internal coordinates for the connected atom
2053  // ResidueConnection upper_connect_; // deprecated
2054  Size upper_connect_id_; // which connection is the upper connection?
2055 
2058 
2059  // A list of all atoms (by atom name) to which other branches are attached.
2061 
2062  ///////////////////////////////////////////////////////////////////////
2063  // These arrays are temporary, will be cleared in finalize():
2064  /// a list of atom indices to be deleted
2065  /** in the next call to finalize(), used in delete_atom which is called during patching**/
2067  /// atom indices forced to be considered backbone
2069 
2070  ////////////////
2072 
2073  // A container for residue properties unique to carbohydrates.
2075 
2076  ////////////////
2077  /// status
2079 
2080  //XRW_B_T1
2081  /*
2082  // coarse residues have this set, NULL otherwise
2083  mutable coarse::TranslatorCAP translator_;
2084  */
2085  //XRW_E_T1
2086 
2087  // Adducts defined for this residue
2089 
2090 
2091  // may (?) also want: cp_atom_num, ta
2092  // angle_neighbor, dihe_neighbor, water properties
2093  //
2094 
2095 
2096  // boost serialize stuff
2097 #ifdef USEBOOSTSERIALIZE
2098  template<class Archive> friend void core::conformation::save_construct_data( Archive & ar, const core::conformation::Residue * t, const unsigned int file_version);
2099  template<class Archive> friend void core::conformation::load_construct_data( Archive & ar, core::conformation::Residue * t, const unsigned int file_version);
2100 #endif
2101 
2104 public:
2105  void nondefault(bool in) { nondefault_ = in;}
2108 
2109  // this is a total hack, im tired
2110  mutable bool serialized_;
2111 private:
2112  // end hack?
2113 };
2114 
2115 
2116 } // chemical
2117 } // core
2118 
2119 
2120 
2121 #endif // INCLUDED_core_chemical_Residues_HH