[ Lib_General64 | Source | Keywords | Summary | Ancestors | All Members | Descendants ]
public: | |
// Constructors | |
FMolecule() ; | |
// Adding Particles. | |
int readPDBfile(istream& PDBstream, const | PDB::Selector& selector )); |
class | Selector ; |
class | CaSelector ; |
void | add(const ParticleT& p); |
int | select (const Selector& selector); |
// 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(FMolecule& m); |
FMolecule | splitOnIndex(const int i); |
FMolecule& | operator+=(const Vector3& v); |
FMolecule& | operator*=(const Matrix3& lt); |
FMolecule& | operator*=(const RigidTrans3& rt); |
FMolecule& | operator=(const FMolecule& m); |
template<class ParticleTT> friend ostream& | operator<<(ostream& s, const FMolecule<ParticleTT>& 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
Function is currently defined inline.
Function is currently defined inline.
Function is currently defined inline.
Function is currently defined inline.
Function is currently defined inline.
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 MoleculeFMolecule() ;
Default constructor - empty molecule.
FMolecule() ;
int readPDBfile(istream& PDBstream, const PDB::Selector& selector ));
readPDBfile accepts an input stream (file or cin) and an atom selector.
The default atom selector defined under PDB - PDB::Selector selects all
atoms by default. To write different selection functions one has to
define descendants to PDB::Selector() and redefine the operato()(const
char* PDBrec) const function to operate as desired.
int readPDBfile(istream& 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() {}
};
class CaSelector ;
Selects CA atoms Molecule
class CaSelector : public Selector {
public:
bool operator()(const ParticleT* particle) const {
if (particle->isCA())
return true;
return false;
}
};
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);
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);
Vector3 operator()(unsigned int particle) const ;
The () operator returns a Particle's position according to index.
The virtual operator() is declared in MoleculeBase
a virtual class that serves as a base for Molecule. The operator() is
used by functions recieving Molecule objects of unknown types. See for
example Match.h.
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);
void rigidTrans(const RigidTrans3& rt);
Applies a rigid transformation on all molecule's Particles.
void rigidTrans(const RigidTrans3& rt);
void concat(FMolecule& m);
Concating two molecules together molecule m is added at the
end of *this molecule
void concat(FMolecule& m);
FMolecule 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
FMolecule splitOnIndex(const int i);
FMolecule& operator+=(const Vector3& v);
Moves all atom coordinates by given vector3 move.
FMolecule& operator+=(const Vector3& v);
FMolecule& operator*=(const Matrix3& lt);
Applies a linear transformation on all protein coordinates.
FMolecule& operator*=(const Matrix3& lt);
FMolecule& operator*=(const RigidTrans3& rt);
Applies a rigid transformation on all atom coordinates.
FMolecule& operator*=(const RigidTrans3& rt);
FMolecule& operator=(const FMolecule& m);
Equality operator.
FMolecule& operator=(const FMolecule& m);
template<class ParticleTT> friend ostream& operator<<(ostream& s, const FMolecule<ParticleTT>& m);
Output operator assuming the ParticleT class has its own
overload of the output operator.
template<class ParticleTT>
friend ostream& operator<<(ostream& s, const FMolecule<ParticleTT>& m);
All Members
public: // Adding Particles. int readPDBfile(istream& PDBstream, const PDB::Selector& selector )); class Selector ; class CaSelector ; void add(const ParticleT& p); int select (const Selector& selector); // 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(FMolecule& m); FMolecule splitOnIndex(const int i); FMolecule& operator+=(const Vector3& v); FMolecule& operator*=(const Matrix3& lt); FMolecule& operator*=(const RigidTrans3& rt); FMolecule& operator=(const FMolecule& m); template<class ParticleTT> friend ostream& operator<<(ostream& s, const FMolecule<ParticleTT>& m); protected: Ancestors
Inheritance chain for FMolecule:
Descendants
Generated from source by the Cocoon utilities on Tue Jan 5 18:47:30 2010
.