Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef ESBTL_COARSE_CLASSIFIER_H
00036 #define ESBTL_COARSE_CLASSIFIER_H
00037
00038
00039 #include <ESBTL/atom_classifier.h>
00040
00041 namespace ESBTL{
00042
00043
00050 template <class NT,class Coarse_atom>
00051 class Radius_of_coarse_atom{
00052 private:
00053 typedef Radius_of_coarse_atom<NT,Coarse_atom> Self;
00054 NT radius_;
00055 public:
00056 typedef Coarse_atom Query_type;
00057 typedef std::string Key_type;
00058 typedef NT Value_type;
00059
00060
00061 Radius_of_coarse_atom(const NT& radius):radius_(radius){}
00062 NT value() const {return radius_;}
00063
00064
00065 template <class Dictionary,class Vector_properties>
00066 static unsigned default_loader(Dictionary& dict,Vector_properties& vect)
00067 {
00069 #include <ESBTL/properties/default_coarse_radii.h>
00071 }
00072
00074 static std::string make_key(const Coarse_atom& atom)
00075 {
00076 return atom.residue().residue_name();
00077 }
00078
00079 static
00080 int& index_of_default(){
00081 static int index_of_default=-1;
00082 return index_of_default;
00083 }
00084 };
00085
00087 template <class NT,class Coarse_atom>
00088 NT get_radius(const Radius_of_coarse_atom<NT,Coarse_atom>& property){
00089 return property.value();
00090 }
00091
00102 template<class Atom>
00103 struct Color_of_atom{
00107 std::string operator() (const Atom& atm) const{
00108 std::string name=atm.residue().residue_name();
00109 if ( name == "ALA" || name == "CYS" || name == "GLY" ||
00110 name == "PRO" || name == "SER" || name == "THR" )
00111 return std::string("1,1,0");
00112
00113 if ( name == "VAL" || name == "LEU" || name == "ILE" ||
00114 name == "MET" || name == "MSE" || name == "PHE" ||
00115 name == "TYR" || name == "TRP" )
00116 return std::string("0,0.80,0");
00117
00118 if ( name == "HIS" || name == "LYS" || name == "ARG")
00119 return std::string("0,0,0.93");
00120
00121 if ( name == "ASN" || name == "GLN" )
00122 return std::string("0.54,0.04,0.31 ");
00123
00124 if ( name == "GLU" || name == "ASP" )
00125 return std::string("0.77,0,0 ");
00126 return std::string("0.5,0.5,0.5 ");
00127 }
00128 };
00129
00136 template <class Atom>
00137 class Color_of_residues{
00138 std::string color_;
00139 public:
00140 static
00141 int& index_of_default(){
00142 static int index_of_default=-1;
00143 return index_of_default;
00144 }
00145
00146
00147
00148 typedef std::string Key_type;
00149 typedef Atom Query_type;
00150
00151 Color_of_residues(const std::string& color):color_(color){}
00152
00153 template <class Dictionary,class Vector_properties>
00154 static unsigned default_loader(Dictionary& dict,Vector_properties& vect)
00155 {
00156 dict["ALA"]=0;
00157 dict["CYS"]=0;
00158 dict["GLY"]=0;
00159 dict["PRO"]=0;
00160 dict["SER"]=0;
00161 dict["THR"]=0;
00162 vect.push_back(std::string("1,1,0"));
00163 dict["VAL"]=1;
00164 dict["LEU"]=1;
00165 dict["ILE"]=1;
00166 dict["MET"]=1;
00167 dict["MSE"]=1;
00168 dict["PHE"]=1;
00169 dict["TYR"]=1;
00170 dict["TRP"]=1;
00171 vect.push_back(std::string("0,0.80,0"));
00172 dict["HIS"]=2;
00173 dict["LYS"]=2;
00174 dict["ARG"]=2;
00175 vect.push_back(std::string("0,0,0.93"));
00176 dict["ASN"]=3;
00177 dict["GLN"]=3;
00178 vect.push_back(std::string("0.54,0.04,0.31 "));
00179 dict["GLU"]=4;
00180 dict["ASP"]=4;
00181 vect.push_back(std::string("0.77,0,0 "));
00182 vect.push_back(std::string("0.5,0.5,0.5 "));
00183 index_of_default()=4;
00184 return 5;
00185 }
00186
00187 static Key_type make_key(const Query_type& atom)
00188 {
00189 return get_residue_name(atom);
00190 }
00191 };
00192
00193 }
00194
00195 #endif //ESBTL_COARSE_CLASSIFIER_H