Molmodel

Ligands.h

Go to the documentation of this file.
00001 #include "molmodel/internal/common.h"
00002 #include "molmodel/internal/Compound.h"
00003 #include <iostream>
00004 #include <fstream>
00005 //#include <ios>
00006 
00007 namespace SimTK 
00008 {
00009 
00010 //
00011 //  This ligand is from 1UUI.pdb.  Reference is:
00012 //  1. Davis, B. et al. Rational design of inhibitors of HIV-1 TAR RNA through the stabilisation of electrostatic "hot spots". J. Mol. Biol 336, 343-56(2004).
00013 //
00014 
00015 class P12 : public Compound {
00016 public:
00017     //takes a DuMMForceFieldSubsystem as a reference argument so as to define all Biotypes, etc within the class.   
00018     P12(DuMMForceFieldSubsystem &dumm)
00019     {
00020  
00021         setBaseCompound("methyl", MethylGroup() );
00022         bondAtom(BivalentAtom("OA1",Element::Oxygen(),109.5*Deg2Rad),   "methyl/bond" ,.141);// third arg of bivalentatom is a bond angle in rads ;. angle betw bond1 and bond2.  third argument of bondAtom is a distance.
00023         bondAtom(TrivalentAtom("C4",   Element::Carbon()),"OA1/bond2",.141);//120*Deg2Rad);
00024         bondCompound("C3compound",AromaticSixMemberedCHGroup(),"C4/bond2",.141);//4th param is a distance.
00025         bondCompound("C5compound",AromaticSixMemberedCHGroup(),"C4/bond3",.141);
00026         bondCompound("C6compound",AromaticSixMemberedCHGroup(),"C5compound/C/bond2",.141);
00027         bondAtom(TrivalentAtom("C1",   Element::Carbon()),"C6compound/C/bond2",.141);
00028         bondAtom(TrivalentAtom("C2",   Element::Carbon()),"C3compound/C/bond2",.141);
00029     addRingClosingBond("C1/bond3",  "C2/bond3", 0.1410);
00030         nameAtom("C5", "C5compound/C");
00031         nameAtom("C6", "C6compound/C");
00032         defineDihedralAngle("C4C3CC2C1","C4","C3compound/C","C2"  ,"C1");//OA/bond2", "C1/bond2");
00033         setDefaultDihedralAngle("C4C3CC2C1", 0.00*Deg2Rad);
00034         bondCompound("CAcompound",MethyleneGroup(),"C2/bond2" ,.141);
00035         nameAtom("CA", "CAcompound/C");
00036         nameAtom("HA1", "CAcompound/H1");
00037         nameAtom("HA2", "CAcompound/H2");
00038         defineDihedralAngle("theta", "C4","C3compound/C","C2","CA");//OA/bond2", "C1/bond2");
00039         setDefaultDihedralAngle("theta",140.0 *Deg2Rad);
00040         bondAtom(QuadrivalentAtom("NB",Element::Nitrogen()),"CAcompound/bond2",.141);// last param is distance; set to something more real // trivalent antom takes 2 bond angles, betw bond1 and bond2, and betw bond1 and bond3.  //trivalents default to planar
00041         bondAtom(   UnivalentAtom("HB",Element::Hydrogen()),"NB/bond4",.141);// last param is distance; set to something more real // trivalent antom takes 2 bond angles, betw bond1 and bond2, and betw bond1 and bond3.  //trivalents default to planar
00042         defineDihedralAngle("omega", "C3compound/C","C2","CA","NB");//OA/bond2", "C1/bond2");
00043         setDefaultDihedralAngle("omega", 40.0 *Deg2Rad);
00044         bondAtom(BivalentAtom("OA",Element::Oxygen(),109.5*Deg2Rad),   "C1/bond2"    ,.141);
00045 
00046         bondCompound( "CBcompound",MethyleneGroup(),"OA/bond2" ,.141);
00047         nameAtom( "CB", "CBcompound/C");
00048         nameAtom( "HB1","CBcompound/H1");
00049         nameAtom( "HB2","CBcompound/H2");
00050 
00051         defineDihedralAngle("alpha", "C6compound/C","C1","OA","CB");//OA/bond2", "C1/bond2");
00052         setDefaultDihedralAngle("alpha", 40.0 *Deg2Rad);
00053 
00054         //bondAtom(QuadrivalentAtom("CG",Element::Carbon()),  "CBcompound/bond2" ,.141);
00055         bondCompound("CGcompound",MethyleneGroup(),"CBcompound/bond2" ,.141);
00056         nameAtom("CG", "CGcompound/C");
00057         nameAtom("HG1","CGcompound/H1");
00058         nameAtom("HG2","CGcompound/H2");
00059         //bondAtom(QuadrivalentAtom("CD",Element::Carbon()),  "CGcompound/bond2" ,.141);
00060         bondCompound( "CDcompound",MethyleneGroup(),"CGcompound/bond2" ,.141);
00061         nameAtom("CD", "CDcompound/C");
00062         nameAtom("HD1","CDcompound/H2");
00063         nameAtom("HD2","CDcompound/H1");
00064         defineDihedralAngle("zeta", "C1","OA","CB","CG");//OA/bond2", "C1/bond2");
00065         setDefaultDihedralAngle("zeta" , 40.0 *Deg2Rad);
00066         //bondAtom(QuadrivalentAtom("NE",Element::Nitrogen()),"CDcompound/bond2",.141);// last param is distance; set to something more real // trivalent antom takes 2 bond angles, betw bond1 and bond2, and betw bond1 and bond3.  //trivalents default to planar
00067         bondCompound("NEcompound",PrimaryAmineGroup(),"CDcompound/bond2" ,.141);
00068         nameAtom("NE", "NEcompound/N");
00069         nameAtom("HE1","NEcompound/H1");
00070         nameAtom("HE2","NEcompound/H2");
00071         nameAtom("HE3","NEcompound/H3");
00072 
00073         defineDihedralAngle("gamma", "C3compound/C","C2","CA","NB");//OA/bond2", "C1/bond2");
00074         setDefaultDihedralAngle("gamma", 140.0*Deg2Rad);
00075         //bondAtom(QuadrivalentAtom("CG1",Element::Carbon()),   "NB/bond3"    ,.141);
00076         bondCompound("CG1compound",MethyleneGroup(),"NB/bond2" ,.141);
00077         nameAtom("CG1", "CG1compound/C");
00078         nameAtom("HG11","CG1compound/H2");
00079         nameAtom("HG12","CG1compound/H1");
00080         bondCompound("CG2compound",MethyleneGroup(),"NB/bond3" ,.141);
00081         nameAtom("CG2", "CG2compound/C");
00082         nameAtom("HG21","CG2compound/H1");
00083         nameAtom("HG22","CG2compound/H2");
00084         bondCompound("CD1compound",MethyleneGroup(),"CG1compound/bond2" ,.141);
00085         nameAtom("CD1", "CD1compound/C");
00086         nameAtom("HD11","CD1compound/H1");
00087         nameAtom("HD12","CD1compound/H2");
00088         bondCompound("CD2compound",MethyleneGroup(),"CG2compound/bond2" ,.141);
00089         nameAtom("CD2", "CD2compound/C");
00090         nameAtom("HD21","CD2compound/H2");
00091         nameAtom("HD22","CD2compound/H1");
00092 
00093         bondAtom(TrivalentAtom("NE1",Element::Nitrogen()),"CD1compound/bond2",.141);
00094         bondAtom(   TrivalentAtom("CZ" ,Element::Carbon()),    "NE1/bond2"    ,.141);
00095     addRingClosingBond("CD2compound/bond2",  "NE1/bond3", 0.1410);
00096         bondAtom(TrivalentAtom("NH1",Element::Nitrogen()), "CZ/bond2",.141);
00097         bondAtom(UnivalentAtom("HH11",Element::Hydrogen()),"NH1/bond2",.141);
00098         bondAtom(UnivalentAtom("HH12",Element::Hydrogen()),"NH1/bond3",.141);
00099         bondAtom(TrivalentAtom("NH2",Element::Nitrogen()), "CZ/bond3",.141);
00100         bondAtom(UnivalentAtom("HH21",Element::Hydrogen()),"NH2/bond2",.141);
00101         bondAtom(UnivalentAtom("HH22",Element::Hydrogen()),"NH2/bond3",.141);
00102 
00103         defineDihedralAngle("delta", "NH1" ,"CZ","NE1","CD1");//OA/bond2", "C1/bond2");
00104         setDefaultDihedralAngle("delta", 70.00*Deg2Rad);
00105 
00106         defineDihedralAngle("beta" , "C1","OA","CB","CG");//OA/bond2", "C1/bond2");
00107         setDefaultDihedralAngle("beta" , 40.0 *Deg2Rad);
00108         
00109    
00110         
00111 
00112         nameAtom("CB1", "methyl/C");// just an alias or shorthand
00113         nameAtom("HB11", "methyl/H1");
00114         nameAtom("HB12", "methyl/H2");
00115         nameAtom("HB13", "methyl/H3");
00116         nameAtom("C3", "C3compound/C");
00117         nameAtom("H3", "C3compound/H");
00118         nameAtom("H5", "C5compound/H");
00119         nameAtom("H6", "C6compound/H");
00120        // nameAtom("O", "OA1");
00121 
00122 
00123 
00124 
00125         setAtomBiotype("CB1" ,"P12","CB1" );
00126         setAtomBiotype("HB11","P12","HB11");
00127         setAtomBiotype("HB12","P12","HB11");
00128         setAtomBiotype("HB13","P12","HB11");
00129         setAtomBiotype("HA1" ,"P12","HC"  );
00130         setAtomBiotype("HA2" ,"P12","HC"  );
00131         setAtomBiotype("HB1" ,"P12","HC"  );
00132         setAtomBiotype("HB2" ,"P12","HC"  );
00133         //setBiotypeIndex( "HD1", Biotype::get("P12", "HC").getIndex() );
00134         setAtomBiotype("HD1" ,"P12","HC"  );
00135         //setBiotypeIndex( "HD2", Biotype::get("P12", "HC").getIndex() );
00136         setAtomBiotype("HD2" ,"P12","HC"  );
00137         //setBiotypeIndex( "HG1", Biotype::get("P12", "HC").getIndex() );
00138         setAtomBiotype("HG1" ,"P12","HC"  );
00139         //setBiotypeIndex( "HG2", Biotype::get("P12", "HC").getIndex() );
00140         setAtomBiotype("HG2" ,"P12","HC"  );
00141         //setBiotypeIndex("HG11", Biotype::get("P12", "HC").getIndex() );
00142         setAtomBiotype("HG11","P12","HC"  );
00143         //setBiotypeIndex("HG12", Biotype::get("P12", "HC").getIndex() );
00144         setAtomBiotype("HG12","P12","HC"  );
00145         //setBiotypeIndex("HG21", Biotype::get("P12", "HC").getIndex() );
00146         setAtomBiotype("HG21","P12","HC"  );
00147         //setBiotypeIndex("HG22", Biotype::get("P12", "HC").getIndex() );
00148         setAtomBiotype("HG22","P12","HC"  );
00149         //setBiotypeIndex("HD11", Biotype::get("P12", "HC").getIndex() );
00150         setAtomBiotype("HD11","P12","HC"  );
00151         //setBiotypeIndex("HD12", Biotype::get("P12", "HC").getIndex() );
00152         setAtomBiotype("HD12","P12","HC"  );
00153         //setBiotypeIndex("HD21", Biotype::get("P12", "HC").getIndex() );
00154         setAtomBiotype("HD21","P12","HC"  );
00155         //setBiotypeIndex("HD22", Biotype::get("P12", "HC").getIndex() );
00156         setAtomBiotype("HD22","P12","HC"  );
00157         setAtomBiotype("HE1" ,"P12", "HE1");
00158         //setBiotypeIndex("HE1" , Biotype::get("P12", "HE1").getIndex() );
00159         //setBiotypeIndex("HE2" , Biotype::get("P12", "HE1").getIndex() );
00160         setAtomBiotype("HE2" ,"P12","HE1" );
00161         //setBiotypeIndex("HE3" , Biotype::get("P12", "HE1").getIndex() );
00162         setAtomBiotype("HE3" ,"P12","HE1" );
00163         setAtomBiotype("HA1" ,"P12","HC"  );
00164         //setBiotypeIndex("HH11", Biotype::get("P12", "HH11").getIndex() );
00165         setAtomBiotype("HH11","P12","HH11");
00166         //setBiotypeIndex("HH12", Biotype::get("P12", "HH11").getIndex() );
00167         setAtomBiotype("HH12","P12","HH11");
00168         //setBiotypeIndex("HH21", Biotype::get("P12", "HH11").getIndex() );
00169         setAtomBiotype("HH21","P12","HH11");
00170         //setBiotypeIndex("HH22", Biotype::get("P12", "HH11").getIndex() );
00171         setAtomBiotype("HH22","P12","HH11");
00172         //setBiotypeIndex( "OA1", Biotype::get("P12", "OA1").getIndex() );
00173         setAtomBiotype("OA1" ,"P12","OA1" );
00174     //cout<<"check OA"<<endl;
00175         //setBiotypeIndex( "OA", Biotype::get("P12", "OA1").getIndex() );
00176         setAtomBiotype("OA" ,"P12","OA1" );
00177         //setBiotypeIndex( "NE", Biotype::get("P12", "NE").getIndex() );//this can only be called for an existing atom.
00178         setAtomBiotype("NE"  ,"P12", "NE" );
00179         //setBiotypeIndex( "NE1", Biotype::get("P12", "NE1").getIndex() );//this can only be called for an existing atom.
00180         setAtomBiotype("NE1"  ,"P12", "NE1" );
00181         //setBiotypeIndex( "NH1", Biotype::get("P12", "NH1").getIndex() );//this can only be called for an existing atom.
00182         setAtomBiotype("NH1" ,"P12", "NH1");
00183         //setBiotypeIndex( "NH2", Biotype::get("P12", "NH1").getIndex() );//this can only be called for an existing atom.
00184         setAtomBiotype("NH2" ,"P12","NH1" );
00185         //setAtomBiotype("NE"  ,"P12", "NE" );
00186         //setBiotypeIndex( "NB", Biotype::get("P12", "NE").getIndex() );//this can only be called for an existing atom.
00187         setAtomBiotype("NB"  ,"P12","NE"  );
00188         //setBiotypeIndex( "C4", Biotype::get("P12", "C4").getIndex() );//FIRST argument is atom name within the particular compound
00189         setAtomBiotype("C4"  ,"P12","C4"  );
00190         //setBiotypeIndex( "C1", Biotype::get("P12", "C4").getIndex() );//FIRST argument is atom name within the particular compound
00191         //setBiotypeIndex( "C1","P12", "C4");
00192         setAtomBiotype("C1"  ,"P12","C4"  );
00193         setAtomBiotype("C3"  ,"P12", "C3" );
00194         setAtomBiotype("H3"  ,"P12", "H3" );
00195         //setBiotypeIndex( "C5", Biotype::get("P12", "C3").getIndex() );//FIRST argument is atom name within the particular compound
00196         setAtomBiotype("C5"  ,"P12","C3"  );
00197         //setBiotypeIndex( "H5", Biotype::get("P12", "H3").getIndex() );//FIRST argument is atom name within the particular compound
00198         setAtomBiotype("H5"  ,"P12","H3"  );
00199         //setBiotypeIndex( "C6", Biotype::get("P12", "C3").getIndex() );//FIRST argument is atom name within the particular compound
00200         setAtomBiotype("C6"  ,"P12","C3"  );
00201         //setBiotypeIndex( "H6", Biotype::get("P12", "H3").getIndex() );//FIRST argument is atom name within the particular compound
00202         setAtomBiotype("H6"  ,"P12","H3"  );
00203         //setBiotypeIndex( "C2", Biotype::get("P12", "C2").getIndex() );//FIRST argument is atom name within the particular compound
00204         setAtomBiotype("C2"  ,"P12", "C3" );
00205         setAtomBiotype("CB"  ,"P12", "CD" );//setBiotypeIndex( "CB", Biotype::get("P12", "CD").getIndex() );//FIRST argument is atom name within the particular compound
00206         setAtomBiotype("CD"  ,"P12", "CD" );
00207         //setBiotypeIndex( "CG", Biotype::get("P12", "CD").getIndex() );//FIRST argument is atom name within the particular compound
00208         setAtomBiotype("CG"  ,"P12","CD"  );
00209         //setBiotypeIndex( "CD", Biotype::get("P12", "CD").getIndex() );//FIRST argument is atom name within the particular compound
00210         setAtomBiotype("CD"  ,"P12","CD"  );
00211         setAtomBiotype("CA"  ,"P12","CD"  );
00212         setAtomBiotype("CG1" ,"P12","CD"  );
00213         setAtomBiotype("CG2" ,"P12","CD"  );
00214         setAtomBiotype("CD1","P12","CD");//setBiotypeIndex("CD1", Biotype::get("P12", "CD").getIndex() );//FIRST argument is atom name within the particular compound
00215         setAtomBiotype("CD2" ,"P12","CD"  );
00216         setAtomBiotype("CZ"  ,"P12", "CZ" );
00217         setAtomBiotype("C4"  ,"P12","C4"  );
00218 
00219 /*
00220     DuMM::AtomClassIndex amber1CTAtomClassIndex(1); 
00221     DuMM::AtomClassIndex amber3CAAtomClassIndex(1); 
00222     DuMM::AtomClassIndex amber9CBAtomClassIndex(1); 
00223     DuMM::AtomClassIndex amber19N2AtomClassIndex(1); 
00224     DuMM::AtomClassIndex amber23OSAtomClassIndex(1); 
00225     DuMM::AtomClassIndex amber29H1AtomClassIndex(1); 
00226     DuMM::AtomClassIndex amber33HAAtomClassIndex(1); 
00227     DuMM::AtomClassIndex amber34HCAtomClassIndex(1); 
00228 */
00229 
00230     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(37),Biotype::get("P12","CB1").getIndex());
00231     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(38),Biotype::get("P12","HB11").getIndex());
00232     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(34),Biotype::get("P12","HC").getIndex());
00233     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(371),Biotype::get("P12","HE1").getIndex());
00234     cout << "setting parameters for P12 HB"<<endl;
00235         setAtomBiotype("HB","P12","HB");
00236     if (! dumm.hasChargedAtomType(DuMM::ChargedAtomTypeIndex(4000))) 
00237     {
00238         dumm.defineChargedAtomType(DuMM::ChargedAtomTypeIndex(4000),"P12 HB",DuMM::AtomClassIndex(29),.6);  
00239         dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(4000),Biotype::get("P12","HB").getIndex());
00240 
00241         }       
00242         /*dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(303),Biotype::get("P12","HB").getIndex());
00243     if (! Biotype::exists("P12", "HB" ) ) 
00244     {
00245     cout<<"apparently biotype P12 HB doesn't exist.."<<endl;
00246         //setAtomBiotype("HB","P12","HB");
00247         Biotype::defineBiotype(Element::Hydrogen(),1,"P12","HB");
00248         dumm.defineChargedAtomType(DuMM::ChargedAtomTypeIndex(4000),"P12 HB",DuMM::AtomClassIndex(29),.6);  
00249         dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(4000),Biotype::get("P12","HB").getIndex());
00250     } else 
00251     cout << "Biotype P12 HB exists"<<endl;
00252 */
00253     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(303),Biotype::get("P12","HH11").getIndex());
00254     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(1068),Biotype::get("P12","OA1").getIndex());
00255     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(368),Biotype::get("P12","NE").getIndex());
00256     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(1078),Biotype::get("P12","NE1").getIndex());
00257     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(302),Biotype::get("P12","NH1").getIndex());
00258     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(130),Biotype::get("P12","C4").getIndex());
00259     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(133),Biotype::get("P12","C3").getIndex());
00260     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(134),Biotype::get("P12","H3").getIndex());
00261     //dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(1049),Biotype::get("P12","C2").getIndex());
00262     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(33),Biotype::get("P12","CD").getIndex());
00263     dumm.setBiotypeChargedAtomType(DuMM::ChargedAtomTypeIndex(301),Biotype::get("P12","CZ").getIndex());
00264  
00265  for (int r =0 ; r<getNumBonds(); r++)    //)//(Compound::Index(q)).
00266     {
00267         setBondMobility(BondMobility::Free ,Compound::BondIndex(r));
00268     }
00269 
00270     setPdbResidueNumber(1046);
00271     setPdbResidueName("P12") ;
00272     setPdbChainId('B');
00273 
00274     std::ifstream inFileStream("1UUI.pdb",std::ifstream::in);
00275     //assert(inFileStream.good());  
00276     //assert(inFileStream.bad());   
00277     //assert(0);
00278     PdbStructure pdbStructure(inFileStream);
00279     Compound::AtomTargetLocations atomTargets = createAtomTargets(pdbStructure);
00280     std::cout<<"atomtargest.szie "<<atomTargets.size()<<std::endl;
00281     matchDefaultBondLengths(atomTargets);
00282     matchDefaultBondAngles(atomTargets);
00283     matchDefaultAtomChirality(atomTargets);
00284     matchDefaultDihedralAngles(atomTargets);
00285     matchDefaultTopLevelTransform(atomTargets);
00286     //int mpResidueNumber = 1046;
00287     }
00288    /* 
00289 */
00290 
00291 };
00292 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines