[ GAMB | Source | Keywords | Summary | Ancestors | All Members | Descendants ]
public: | |
// Constructors | |
Molecule() ; | |
// Adding Particles. | |
template< class StreamT> int readPDBfile(StreamT& PDBstream, const | PDB::Selector& selector )); |
template< class StreamT> int readHetAtomsFromPDBfile(StreamT& PDBstream, const | PDB::Selector& selector )); |
int readAllPDBfile(const string& pdbFile, const | PDB::Selector& selector )); |
template< class StreamT> int readAllPDBfile(StreamT& PDBstream, const | PDB::Selector& selector )); |
class | Selector ; |
class | ChainSelector ; |
class | WaterHydrogenUnSelector ; |
class | CaSelector ; |
class | BackboneSelector ; |
int | select (const Selector& selector); |
int | select (const Selector& selector, Molecule< ParticleT>& m) const; |
void | add(const ParticleT& p); |
vector< Vector3> | getDiameterTriple() const; |
// Inspection. | |
Vector3 | operator()(unsigned int particle) const; |
Vector3 | centroid() const; |
// Operators. | |
void | transform(const Matrix3& lt); |
void | translate(const Vector3& move); |
void | rigidTrans(const RigidTrans3& rt); |
void | concat(const Molecule& m); |
Molecule | splitOnIndex(const int i); |
Molecule& | operator+=(const Vector3& v); |
Molecule& | operator*=(const Matrix3& lt); |
Molecule& | operator*=(const RigidTrans3& rt); |
Molecule& | operator=(const Molecule& m); |
template< class T> friend ostream& | operator<< (ostream& s, const Molecule& m); |
protected: |
Copyright: SAMBA group, Tel-Aviv Univ. Israel, 1997-9.
The Molecule may be built using the add method or using any other method supplied by the STL vector. Alternatively Particles may be added from a PDB format file using the readPDBfile method. This method may recieve a function object which will determine which of the atoms are loaded into memory.
Matrices, rigid transformations, vector additions may be applied to all particles simultaneously. See the operators.
The following is an example of using a Molecule<Particle> object to read in all C-alpha atom from a PDB file and print their coordinates after a rigid-transformation is applied to all the particles.
class CAlphaSelector : public PDB::Selector { // This class defines a selector that will pick only C-alpha atoms. public: bool operator()(const char *PDBrec) const { const char *type = PDB::atomType(PDBrec); return (*(type+1) == 'C' && *(type+2) == 'A'); } }; main() { Molecule<Particle> M; ifstream pdb("pdb1tpo.ent"); M.readPDBfile(pdb, CAlphaSelector()); pdb.close(); RigidTrans3 rt(Whatever); M*= rt; for (Molecule<Particle>::iterator i= M.begin(); i != M.end(); i++) cout << *i << '\n'; }Note that Molecule has 2 base classes. The MolculeBase class is a virtual class that has a sole virtual method - the () operator. This class may be used to pass Molecule
ifstream pdb("complex.pdb"); mol.readPDBfile(pdb); pdb.close();
Molecule<Atom>::ChainSelector selectorAntibody("LH"); Molecule<Atom>::ChainSelector selectorAntigen("A");
mol.select(selectorAntibody,antibody); mol.select(selectorAntigen); } END
Note: If the complex contained chains L,H,A than after the first select mol contains L,H,A and antibody contains L,H after the second select mol contains A.
Molecule() ;
Default constructor - empty molecule.
Molecule() ;
Function is currently defined inline.
Reads all ATOM records from the given PDB file according to the
given atom selector and returns the number of read atoms (a
negative value is returned in case of an error).
The default
atom selector is PDB::Selector that selects all records. To write
a different selection function one has to define a descendant of
PDB::Selector() and redefine the 'operator()(const char* PDBrec)
const' function to operate as desired.
template< class StreamT> int readPDBfile(StreamT& PDBstream, const PDB::Selector& selector = PDB::Selector());
template< class StreamT> int readHetAtomsFromPDBfile(StreamT& PDBstream, const PDB::Selector& selector ));
readHetAtomsFromPDBfile accepts an input stream (file or cin) a
PDB file format. Only HETATM records are read.
template< class StreamT> int readHetAtomsFromPDBfile(StreamT& PDBstream, const PDB::Selector& selector = PDB::Selector());
int readAllPDBfile(const string& pdbFile, const PDB::Selector& selector ));
Reads all ATOM and HETATM records from the given PDB file
according to the given atom selector and returns the number of
read atoms (a negative value is returned in case of an
error).
The default atom selector is PDB::Selector that
selects all records. To write a different selection function one
has to define a descendant of PDB::Selector() and redefine the
'operator()(const char* PDBrec) const' function to operate as
desired.
Note that to filter out hydrogen, water molecules
or anything else, use the PDB::WaterHydrogenUnSelector
int readAllPDBfile(const string& pdbFile, const PDB::Selector& selector = PDB::Selector());
Reads all ATOM and HETATM records from the given PDB file
according to the given atom selector and returns the number of
read atoms (a negative value is returned in case of an
error).
The default atom selector is PDB::Selector that
selects all records. To write a different selection function one
has to define a descendant of PDB::Selector() and redefine the
'operator()(const char* PDBrec) const' function to operate as
desired.
Note that to filter out hydrogen, water molecules
or anything else, use the PDB::WaterHydrogenUnSelector
template< class StreamT> int readAllPDBfile(StreamT& PDBstream, const PDB::Selector& selector = PDB::Selector());
class Selector ;
Enables to create selectors that can operate on a Molecule
after the Molecule object was created. For example a pdb file containing
several chains can be read only once to create a Molecule.
Each chain would be selected into a new Molecule object.
The selector can be operated on a Molecule using the select function.
class Selector { public: virtual bool operator()(const ParticleT*) const { return true;} virtual ~Selector() {} };
Function is currently defined inline.
class ChainSelector ;
Selects particles from a Molecule according to their chainId.
class ChainSelector : public Selector { public: ChainSelector(const string& chainID): chains(chainID) {} bool operator()(const ParticleT* particle) const { for (int i=0; i< (int)chains.length(); i++) if (particle->chainId() == chains[i]) return true; return false; } private: string chains; };
Function is currently defined inline.
class WaterHydrogenUnSelector ;
Selects particles from a Molecule, which are not water or hydrogens atoms.
class WaterHydrogenUnSelector : public Selector { public: bool operator()(const ParticleT* particle) const { if (!(particle->isWater() || particle->isH())) return true; return false; } };
Function is currently defined inline.
class CaSelector ;
Selects CA atoms Molecule
class CaSelector : public Selector { public: bool operator()(const ParticleT* particle) const { if (particle->isCA()) return true; return false; } };
Function is currently defined inline.
class BackboneSelector ;
Selects backbone atoms Molecule
class BackboneSelector : public Selector { public: bool operator()(const ParticleT* particle) const { if (particle->isBackbone()) return true; return false; } };
Function is currently defined inline.
int select (const Selector& selector);
Excludes particles that
are not selected by the Selector. The operating Molecule object may
be changed as a result of this function.
int select (const Selector& selector);
int select (const Selector& selector, Molecule< ParticleT>& m) const;
Adds particles that
are selected by the Selector to the input Molecule.
The operating Molecule object is NOT changed as a result of this function.
int select (const Selector& selector, Molecule< ParticleT>& m) const;
void add(const ParticleT& p);
Shorthand for vector push_back. Adds a new Particle at the end of the
Particle array.
void add(const ParticleT& p);
vector< Vector3> getDiameterTriple() const;
Return a triple of the positions of the most distant atoms
vector< Vector3> getDiameterTriple() const;
Vector3 operator()(unsigned int particle) const;
The () operator returns a Particle's position according to index.
Vector3 operator()(unsigned int particle) const;
Vector3 centroid() const;
Returns centroid of all particle positions.
Vector3 centroid() const;
void transform(const Matrix3& lt);
Transforms molecule using a linear transformation of type Matrix3.
void transform(const Matrix3& lt);
void translate(const Vector3& move);
Moves all atom coordinates by given vector3 move.
inline void translate(const Vector3& move);
Function is currently defined inline.
void rigidTrans(const RigidTrans3& rt);
Applies a rigid transformation on all molecule's Particles.
void rigidTrans(const RigidTrans3& rt);
void concat(const Molecule& m);
Concating two molecules together molecule m is added at the
end of *this molecule
void concat(const Molecule& m);
Molecule splitOnIndex(const int i);
Splitting a molecule on index i all the particles
from 0-i (included) will stay in this molecule
the other particles : i+1-end-of-molecule are returned
as a different molecule
Molecule splitOnIndex(const int i);
Molecule& operator+=(const Vector3& v);
Moves all atom coordinates by given vector3 move.
Molecule& operator+=(const Vector3& v);
Molecule& operator*=(const Matrix3& lt);
Applies a linear transformation on all protein coordinates.
Molecule& operator*=(const Matrix3& lt);
Molecule& operator*=(const RigidTrans3& rt);
Applies a rigid transformation on all atom coordinates.
Molecule& operator*=(const RigidTrans3& rt);
Molecule& operator=(const Molecule& m);
Equality operator.
Molecule& operator=(const Molecule& m);
template< class T> friend ostream& operator<< (ostream& s, const Molecule& m);
Output operator assuming the ParticleT class has its own
overload of the output operator.
template< class T> friend ostream& operator<< (ostream& s, const Molecule& m);
public: | ||
---|---|---|
// Adding Particles. | ||
template< class StreamT> int readPDBfile(StreamT& PDBstream, const | PDB::Selector& selector )); | |
template< class StreamT> int readHetAtomsFromPDBfile(StreamT& PDBstream, const | PDB::Selector& selector )); | |
int readAllPDBfile(const string& pdbFile, const | PDB::Selector& selector )); | |
template< class StreamT> int readAllPDBfile(StreamT& PDBstream, const | PDB::Selector& selector )); | |
class | Selector ; | |
class | ChainSelector ; | |
class | WaterHydrogenUnSelector ; | |
class | CaSelector ; | |
class | BackboneSelector ; | |
int | select (const Selector& selector); | |
int | select (const Selector& selector, Molecule< ParticleT>& m) const; | |
void | add(const ParticleT& p); | |
vector< Vector3> | getDiameterTriple() const; | |
// Inspection. | ||
Vector3 | operator()(unsigned int particle) const; | |
Vector3 | centroid() const; | |
// Operators. | ||
void | transform(const Matrix3& lt); | |
void | translate(const Vector3& move); | |
void | rigidTrans(const RigidTrans3& rt); | |
void | concat(const Molecule& m); | |
Molecule | splitOnIndex(const int i); | |
Molecule& | operator+=(const Vector3& v); | |
Molecule& | operator*=(const Matrix3& lt); | |
Molecule& | operator*=(const RigidTrans3& rt); | |
Molecule& | operator=(const Molecule& m); | |
template< class T> friend ostream& | operator<< (ostream& s, const Molecule& m); | |
protected: |
Report problems to jkotula@unimax.com