File size: 2,921 Bytes
8efb4bd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | #ifndef CHEM_LIB
#define CHEM_LIB
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
/*
CLASS
ChemEntry
This is a class that keeps protein atom attributes: type, radius and charge
KEYWORD
ChemEntry, ChemAtom radius, charge, type
AUTHORS
Dina Schneidman (duhovka@tau.ac.il)
copyright: GAMBA Group , Tel-Aviv Univ. Israel, 2004.
GOALS
ChemEntry keeps atom attribures that are not given in PDB file.
CHANGES LOG
<UL>
</UL>
USAGE
*/
class ChemEntry {
public:
// GROUP: Inspectors
////
bool isSameEntry(const std::string residueName, const std::string atomName) const;
//// returns radius
float getEntryRadius() const { return radius_; }
//// returns charge
float getEntryCharge() const { return charge_; }
//// returns atom type
int getEntryChemType() const { return chemType_; }
//// read entry
friend std::istream& operator>>(std::istream& s, ChemEntry &entry) {
return s >> entry.residueName_ >> entry.atomName_ >> entry.radius_ >> entry.charge_ >> entry.chemType_;
}
//// output entry
friend std::ostream& operator<<(std::ostream& s, const ChemEntry &entry) {
s << entry.residueName_ << ' ' << entry.atomName_ << ' '
<< entry.radius_ << ' ' << entry.charge_ << ' ' << entry.chemType_;
return s;
}
public:
std::string residueName_;
std::string atomName_;
float radius_;
float charge_;
int chemType_;
};
/*
CLASS
ChemLib
This is a class that serves as a library for protein attributes:
type, radius and charge.
KEYWORD
ChemEntry, ChemAtom, ChemLib radius, charge, type
AUTHORS
Dina Schneidman (duhovka@tau.ac.il)
copyright: GAMBA Group , Tel-Aviv Univ. Israel, 2004.
GOALS
ChemLib keeps attribures for each of the 20 amino acids atoms. These
attribures are not given in PDB file.
CHANGES LOG
<UL>
</UL>
USAGE
The ChemLib is initialized with the special library file (mol/lib/gamb++/chem.lib).
*/
class ChemLib {
public:
// GROUP: Constructors
//// Init and load library
ChemLib(const std::string libFileName);
void loadLibrary(const std::string libFileName);
// GROUP: Inspectors
//// get radius
float getAtomRadius(const char* residueName, const char* atomPDBType) const;
//// get charge
float getAtomCharge(const char* residueName, const char* atomPDBType) const;
//// get chemical type
int getAtomChemType(const char* residueName, const char* atomPDBType) const;
//// print function
void printLibrary(std::ostream& outFile) const;
//// get the whole lib entry
const ChemEntry* getLibEntry(const char* residueName, const char* atomPDBType) const;
private:
const ChemEntry* searchLibEntry(const std::string residueName, const std::string atomName) const;
private:
std::vector<ChemEntry> libVector;
};
#endif
|