MTK++ Latest version: 0.2.0

collection.h
Go to the documentation of this file.
00001 
00033 #ifndef COLLECTION_H
00034 #define COLLECTION_H
00035 
00036 #include <iostream>
00037 #include <string>
00038 #include <vector>
00039 #include <map>
00040 #include <set>
00041 #include <algorithm>
00042 
00043 #include "Utils/constants.h"
00044 
00045 namespace MTKpp
00046 {
00047 
00048 class molecule;
00049 class submolecule;
00050 class atom;
00051 class vector3d;
00052 
00053 class elements;
00054 
00055 struct Bond;
00056 struct Angle;
00057 struct Torsion;
00058 struct Improper;
00059 
00060 // Molecular Mechanics
00061 class stdLibrary;
00062 class parameters;
00063 class atomTyper;
00064 struct bondParam;
00065 struct angleParam;
00066 struct torsionParam;
00067 struct improperParam;
00068 struct hBondParam;
00069 struct LJ612Param;
00070 struct LJ612SE;
00071 
00072 // metalloproteins
00073 class metalCenter;
00074 class metalGroup;
00075 
00076 // ============================================================
00077 // Class : collection()
00078 // ------------------------------------------------------------
00083 // ============================================================
00084 
00085 class collection
00086 {
00087     friend class molecule;
00088 public:
00089 
00091     collection();
00092 
00094     virtual ~collection();
00095 
00100     void                     setName(std::string name);
00101 
00106     std::string              getName();
00107 
00112     virtual molecule*        addMolecule();
00113 
00118     void                     delMolecule(molecule* pMol);
00119 
00123     void                     delAllMolecules();
00124 
00128     void                     clear();
00129 
00134     molecule*                getMolecule();
00135 
00142     molecule*                getMolecule(int id);
00143 
00150     molecule*                getMolecule(std::string name);
00151 
00156     molecule*                getLastAddedMolecule();
00157 
00162     virtual std::vector<molecule*>   getMoleculeList();
00163 
00172     atom*                    getAtom(int number, bool atomIndex = true,
00173                                                  bool fileId = false,
00174                                                  bool atomColIndex = false);
00175 
00180     virtual std::vector<atom*> getAtomList();
00181 
00186     int                      getNumberMolecules();
00187 
00192     int                      getNumberSubMolecules();
00193 
00198     int                      getNumAtoms();
00199 
00201 
00206     int                      getNumBonds();
00207 
00212     int                      getBonds(int bonds[]);
00213 
00218     int                      getBondParams(double bondParams[]);
00219 
00223     int                      getNumBondsWithH();
00224 
00228     int                      getNumBondsWithOutH();
00229 
00233     int                      getNumUniqueBondTypes();
00234 
00236 
00241     int                      getNumAngles();
00242 
00247     int                      getAngles(int angles[]);
00248 
00253     int                      getAngleParams(double angleParams[]);
00254 
00258     int                      getNumAnglesWithH();
00259 
00263     int                      getNumAnglesWithOutH();
00264 
00268     int                      getNumUniqueAngleTypes();
00269 
00271 
00276     int                      getNumTorsions();
00277 
00282     int                      getNumMMTorsions();
00283 
00289     int                      getMMTorsions(int torsions[], double torsionParams[]);
00290 
00292 
00297     int                      getNumImpropers();
00298 
00303     int                      getNumMMImpropers();
00304 
00310     int                      getMMImpropers(int impropers[], double improperParams[]);
00311 
00315     int                      getNumDihedralsWithH();
00316 
00320     int                      getNumDihedralsWithOutH();
00321 
00325     int                      getNumUniqueDihedralTypes();
00326 
00328 
00333     int                      getCoordinates(double coords[]);
00334 
00339     int                      setCoordinates(double coords[]);
00340 
00342     elements*                pElements;
00343 
00345     // - Molecular Mechanics - //
00347 
00349     virtual void             addStdLibrary();
00350 
00352     virtual stdLibrary*      getStdLibrary();
00353 
00355     void                     addAtomTyper();
00356 
00358     atomTyper*               getAtomTyper();
00359 
00361     void                     addParameters();
00362 
00364     parameters*              getParameters();
00365 
00367     int                      getNumMMnonBondedPairs(double cutoff);
00368 
00372     int                      getMMnonBondedPairs(int nonBonded[],
00373                               int nonBondedPtrs[], double nonBondedParams[],
00374                               int nonBonded14Ptrs[], double cutoff);
00375 
00381     int                      getMMCharges(double charges[]);
00382 
00388     int                      getAtomSymbols(char symbols[]);
00389 
00395     int                      getAtomNames(char names[]);
00396 
00402     int                      getAtomMasses(double masses[]);
00403 
00408     int                      getNumUniqueAtomTypes();
00409 
00414     std::vector<std::string> getUniqueAtomTypes();
00415 
00420     std::vector<bondParam*> getUniqueBondTypes();
00421 
00426     std::vector<angleParam*> getUniqueAngleTypes();
00427 
00432     std::vector<torsionParam*> getUniqueTorsionTypes();
00433 
00438     std::vector<improperParam*> getUniqueImproperTypes();
00439 
00445     int                      getAtomTypes(int a[]);
00446 
00452     int                      getAtomTypes(char a[]);
00453 
00460     int                      getLJParams(double r6[], double r12[]);
00461 
00466     int                      getNumExcludedAtoms();
00467 
00473     int                      getNumExcludedAtoms(int e[]);
00474 
00480     int                      getExcludedAtoms(int e[]);
00481 
00486     int                      getNumExcluded14Atoms();
00487 
00493     int                      getNumExcluded14Atoms(int e[]);
00494 
00500     int                      getExcluded14Atoms(int e[]);
00501 
00507     int                      getResidueNames(char resNames[]);
00508 
00514     int                      getResiduePointers(int resPointers[]);
00515 
00520     void                     setAtomIndex(const int& n);
00521 
00526     int                      getAtomIndex();
00527 
00532     void                     setSubMoleculeIndex(const int& n);
00533 
00538     int                      getSubMoleculeIndex();
00539 
00544     virtual int              getFormalCharge();
00545 
00552     int                      getNumNeighbors(atom* pAt, double d);
00553 
00560     int                      getNumHeavyNeighbors(atom* pAt, double d);
00561 
00566     int                      largestResidueSize();
00567 
00571     void                     renumber();
00572 
00574     molecule*                pMolecule;
00575 
00577     submolecule*             pSubMolecule;
00578 
00580     // -   Metalloproteins   - //
00582 
00586     bool                     hasMetal();
00587 
00591     void                     findMetals();
00592 
00596     void                     determineMetalEnvironments();
00597 
00601     void                     assignMetalPartners();
00602 
00606     void                     assignMetalParameters();
00607 
00611     std::vector<metalCenter*> getMetalCenters();
00612 
00613 protected: // functions
00614 
00623     void findMatchings(int pos, int nBondedAtoms,
00624                        int matchMatrix[], std::vector<int> &match,
00625                        std::vector<std::vector<int> > &matchings);
00626 
00634     void updateMatchMatrix(int iPos, int jPos, int nBondedAtoms, int matchMatrix[]);
00635 
00642     void refineMatchMatrix(int nBondedAtoms, int matchMatrix[], bool &mismatch);
00643 
00644 protected: // data
00645 
00647     std::vector<molecule*>   itsMoleculeList;
00648 
00650     std::string              itsName;
00651 
00653     int                      itsAtomIndex;
00654 
00656     int                      itsSubMoleculeIndex;
00657 
00659     stdLibrary*              pStdLibrary;
00660 
00662     parameters*              pParameters;
00663 
00665     atomTyper*               pAtomTyper;
00666 
00668     bondParam*               pBondParam;
00669 
00671     angleParam*              pAngleParam;
00672 
00674     torsionParam*            pTorsionParam;
00675 
00677     improperParam*           pImproperParam;
00678 
00680     hBondParam*              pHBondParam;
00681 
00683     LJ612Param*              pLJ612Param;
00684 
00686     LJ612SE*                 pLJ612SE;
00687 
00689     Bond*                    pBond;
00690 
00692     Angle*                   pAngle;
00693 
00695     Torsion*                 pTorsion;
00696 
00698     Improper*                pImproper;
00699 
00701     std::vector<std::string> atomTypesUsed;
00702 
00704     std::vector<bondParam*> uniqueBondParams;
00705 
00707     std::vector<angleParam*> uniqueAngleParams;
00708 
00710     std::vector<torsionParam*> uniqueTorsionParams;
00711 
00713     std::vector<improperParam*> uniqueImproperParams;
00714 
00715     //
00716     // METALS CENTERS
00717     //
00718 
00720     std::vector<std::string> availableMetals;
00721 
00723     std::map<std::string, double> metalDonorDists;
00724 
00726     std::vector<atom*> itsMetalAtoms;
00727 
00729     std::vector<metalCenter*> itsMetalCenters;
00730 
00732     std::vector<metalGroup*> itsMetalGroups;
00733 
00734     //
00735     // ITERATORS
00736     //
00737 
00739     typedef std::vector<molecule*>::iterator moleculeIterator;
00740 
00742     typedef std::vector<submolecule*>::iterator  sMolIterator;
00743 
00745     typedef std::vector<atom*>::iterator         AtomIterator;
00746 
00748     typedef std::map<int, Bond*>::iterator       BondMapIterator;
00749 
00751     typedef std::map<ULONG_KIND, Angle*>::iterator AngleMapIterator;
00752 
00754     typedef std::map<ULONG_KIND, Torsion*>::iterator    TorsionMapIterator;
00755 
00757     typedef std::map<int, Improper*>::iterator   ImproperMapIterator;
00758 
00760     typedef std::vector<metalCenter*>::iterator MetalCenterIterator;
00761 
00763     typedef std::vector<metalGroup*>::iterator MetalGroupIterator;
00764 
00766     typedef std::vector<unsigned int>::iterator intVectorIterator;
00767 
00769     typedef std::vector<std::string>::iterator stringVectorIterator;
00770 
00772     typedef std::map<std::string, double>::iterator strDbMapIterator;
00773 
00775     typedef std::map<std::string, int>::iterator strIntMapIterator;
00776 
00778     typedef std::map<std::string, std::string>::iterator strStrMapIterator;
00779 };
00780 
00781 } // MTKpp namespace
00782 
00783 #endif // COLLECTION_H

Generated on Fri Dec 23 2011 09:28:49 for MTK++ by Doxygen 1.7.5.1