Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Sparta.hh
Go to the documentation of this file.
1 /* */
2 /* ---- SPARTA ---- */
3 /* Shifts Prediction from Analogue of Residue type and Torsion Angle */
4 /* Yang Shen and Ad Bax */
5 /* J. Biomol. NMR, 38, 289-302 (2007) */
6 /* NIH, NIDDK, Laboratory of Chemical Physics */
7 /* version, 1.2 (build 2009.0928.17) */
8 /* */
9 /* for any problem, please contact */
10 /* shenyang@niddk.nih.gov */
11 /* */
12 /******************************************************************************/
13 
14 #ifndef SPARTA_H
15 #define SPARTA_H
16 
17 #include <protocols/sparta/GDB.hh>
18 #include <protocols/sparta/PDB.hh>
19 #include <protocols/sparta/ANN.hh>
20 
21 #include <boost/unordered_map.hpp>
22 
23 #include <core/pose/Pose.fwd.hh>
24 
25 #include <core/types.hh>
26 #include <utility/vector1.hh>
27 #include <utility/vector0.hh>
28 
29 namespace protocols {
30 namespace sparta {
31 
33 typedef boost::unordered_map<float, boost::unordered_map<float, float> > PHIPSI_ERR_SURF;
34 
35 /* this is not thread-safe... */
36 
37 class Sparta {
38  ///mini specific additions...
39 public:
40 
41  Sparta( std::string const & chem_shifts );
42  ~Sparta();
43 
44  static void register_options();
45  core::Real score_pose( core::pose::Pose const & pose );
47 
48 private:
49  class SpartaLib;
50  SpartaLib& lib() { return *lib_instance_; } //no it is not a constant reference since we do the calculation in SPARTA_LIB. assumption here: no threads
51  core::Real run_A_ANN_Prediction(); // Run ANN prediction for a single protein
56 
57  static bool options_registered_;
58 
59 private: ///{ most of the original SPARTA class goes into SpartaLib -- to be reused between different evaluators...
60  class SpartaLib { //private sub-class so the elements are public such that they can be accessed from main class without too much text changes..
61  public:
62  SpartaLib();
63  void setup_for_scoring(core::pose::Pose const & pose);
64  void deallocate_arrays();
65  void init();
66  GDB get_ANN_data( bool create_output );
67  void getResInfo( bool create_output ); //Get the list of useful shifts from a given residue. get 2nd chemical shift and apply correction
68 
69  float getANN_PredError(float phi, float psi, std::string aa, std::string aName); // get the prediction error from error surface
70  void init_PredErrorSurface();
71 
72  // get random coil chemical shift for atom 'aName' of residue 'resName'
73  float getRC(const std::string& resName, const std::string& aName);
74  float getRCadj(const std::string& resName, const std::string& aName);
75  float getPrevRCadj(const std::string& prev_rName, const std::string& aName);
76  float getNextRCadj(const std::string& next_rName, const std::string& aName);
77  float getWeight(const std::string& Name, const std::string& aName);
78 
79  //preset the args form command line
80  void setup_defaults();
81 
82  void mkdir_pred(const std::string& d);// create a directory for prediction results
83 
84  ////SPARTA originals
87  char buf[300], lbuf[1000];
88 
89  std::string inName; // input PDB coordinates file name
90  std::string inNames; // name list of multiple input PDB coordinates files
92  GDB inTab; //inTab, input table file from PDB coordinates file
93 
94  std::string sumName; // output summary name
95  std::string sourceName; // output summary name
96 
97  float** U_ANGLES;
98  float** U_RING_SHIFTS;
100  float *U_HN_HB, *U_HA_HB, *U_CO_HB;// *HB_SHIFT_HN;
101 
103  GDB TRIPLET_Tab; //triplet table file
104 
105  std::string weightFileName; // file name for wieght talble of score function
106  GDB WEIGHT_Tab; // talble for weights of score function
107 
108  std::string homoFileName; // file name for sequence homology talble
109  GDB HOMO_Tab; // homology talble
110 
111  std::string rcFileName; //file name for random coil chemical shift talble
112  GDB RC_Tab; // random coil chemical shift talble
113 
114  std::string adjFileName; //file name for the adjustment of random coil chemical shift talble
115  GDB ADJ_Tab; // "Random Coil Adjustment Table"
116 
117  std::string prevFileName; // file name for the table of "Random Coil Adjustments for Previous Residue Type"
118  GDB PREV_Tab; // talble for "Random Coil Adjustments for Previous Residue Type"
119 
120  std::string nextFileName; // file name for the table of "Random Coil Adjustments for Next Residue Type"
121  GDB NEXT_Tab; // talble for "Random Coil Adjustments for Next Residue Type"
122 
123  std::string fitFileName; // file name for the table of "fitting parameters"
124  GDB FIT_Tab; // talble for "fitting parameters"
125 
126 
127 
128  int firstRes, lastRes; // First/last RESID to use for prediction
129 
130  int r1,rN; // first and last RESID in seqList
131 
132  float tVal; // Max similarity score threshold, not used in the program
133 
134  std::map< int, std::string > residList; // one-letter amino acid residue list from input PDB coordinates file
135  std::string sequence; // one-letter amino acid residue list from input PDB coordinates file in the format of one std::string
136 
137  boost::unordered_map< int, std::string > aN/*, aN_ALL*/; // Backbone atom list used by program "N HA C CA CB H"
138 
139  int matchCount; //Max Match Count per query triplet
140 
141  std::string pdbListName; //table file name for names of candidate proteins
142 
143  boost::unordered_map<std::string, boost::unordered_map<std::string, float> > Fitting;
144 
145  std::string AAlist; // amino acid list (with a sequence allowed by ANN)
146  boost::unordered_map< std::string, utility::vector0< float > > BLOSUM_62; // BLOSUM 62 matrix
147  boost::unordered_map< int, utility::vector0< float > > ANN_IN_MTX; // input matrix for neural netwrok calculation
148  boost::unordered_map< std::string, boost::unordered_map< int, utility::vector0< float > > > ANN_CS_OUTPUT_FULL; // input matrix from neural netwrok calculation, indexed by atom name, resID and prediction
149  boost::unordered_map< int, float > CHI2_ANGLES, OMEGA_ANGLES;
150 
151  boost::unordered_map< int, boost::unordered_map< std::string,float > > SURFACE_EXPOSURE; //indexed by resID, atomName
152 
153  boost::unordered_map< int, std::string >::iterator itN;
154  boost::unordered_map< int, boost::unordered_map< std::string, std::string > >::iterator it;
155 
156  boost::unordered_map< std::string, ANN> SPARTA_ANN;
157  boost::unordered_map< std::string, boost::unordered_map< std::string, PHIPSI_ERR_SURF> > SPARTA_ERR_SURF; //indexed by AA, atomName, phi, psi
158  };
159 };
160 
161 } // sparta
162 } // protocols
163 
164 #endif