MOLECULE.CPP
Description : Member functions of Atom and Molecule classes.
Header files called upon : fstream.h, iomanip.h, strstream.h, string.h, math.h, stdlib.h
, VECTOR.H
, MATRIX.H
, MOLECULE.H
Class details are as follows:
Non-class functions
- void *operator new(size_t s, int no_of_atoms)
- Overloads 'new' operator to include an integer parameter to clarify specifically, for example, which array element of an object memory is being allocated for (useful when memory is exhausted as function will write out specifically which array element it failed at)
- eg atm[i] = new(i) Atom;
- NB function declared in MOLECULE.H
Further class member definitions : Atom
Constructors (public)
- Atom::Atom(char* pdb_line) : no_of_bonds(0)
- Constructor that stores the following information as extracted from a line from a PDB file: atom name, atom number, residue name, residue number, coordinates
- eg Atom atm1(line);
- NB function declared in MOLECULE.H
Member functions (public)
- void Atom::rotatePdbAtoms(const char *inFile, const char *outFile, const Matrix &rot, const Vector &axis)
- Opens a PDB file, reads in coordinate lines, extracts coordinates, rotates coordinates according to matrix using vector as centre of rotation (not origin), and outputs into user-specified file in PDB format
- eg rotatePdbAtoms(infile, outfile, mat1, vec1);
- NB1 number of atoms restricted by MAXATS as defined in MOLECULE.H
- NB2 function declared in MOLECULE.H
- void Atom::rotatePdbAtoms(const char *inFile, const char *outFile, const Matrix &rot, const Matrix &scale, const Vector &trans)
- Opens a PDB file, reads in coordinate line, extracts coordinates, scales coordinates, adds translation vector to coordinates, rotates coordinates about origin (not vector as centre of rotation) and outputs into user-specified file in PDB format
- eg rotatePdbAtoms(infile, outfile, mrot, mscale, vtrans);
- NB1 number of atom restricted by MAXATS as defined in MOLECULE.H
- NB2 function declared in MOLECULE.H
Further class member definitions : LigandAtom (derived from class Atom)
Constructors (public)
- LigandAtom::LigandAtom(char* buffer)
- Constructor that stores the following information as extracted from a line from a PDB file: coordinates, residue name, residue identifier (ie number as string)
- eg LigandAtom latm1(line);
- NB function declared in MOLECULE.H
Further class member definitions : Molecule
Member variables (protected)
- int Molecule::count; used for array reference of *geomAtom[4] declared in MOLECULE.H
- Atom *Molecule::geomAtom[4]; pointer to a maximum of four different atoms, used to explore bond connectivity network for calculation of bond distances, bond angles and torsion angles declared in MOLECULE.H
Constructors (public)
- Molecule::Molecule(const Molecule &mol, const Matrix &rot, const Vector &trans) : mol_name("rotated molecule"), no_of_atoms(mol.no_of_atoms)
- Constructor that creates a molecule by rotation about the origin, followed by a translation, of an already initialized molecule
- eg Molecule mol2(mol1,matrot,vectrans);
- NB1 mol2 is allocated the name 'rotated molecule', and number of atoms equal to that of mol1
- NB2 function declared in MOLECULE.H
- Molecule::Molecule(const Molecule &m1, const Molecule &m2) : mol_name("molecular sum")
- Constructor that creates a molecule by linearly concatenating two individual molecules by linking the atoms linearly
- eg Molecule mol3(mol1,mol2);
- NB1 mol3 is allocated the name "molecular sum", and contains number of atoms equal to the sum of those in mol1 and mol2
- NB2 function declared in MOLECULE.H
Member functions (public)
- void Molecule::compare(Molecule &mol)
- Checks for equivalent quantity of atoms, then executes an RMS deviation calculation by fitting parameterized molecule onto non-parameterized molecule (also detailing eigenvectors and eigenvalues) and specifies any atoms of the non-parameterized molecule whose RMS deviation with its
counterpart is less than 2*sigma
- eg mol1.compare(mol2);
- NB function declared in MOLECULE.H
Further class member definitions : Protein (derived from class Molecule)
Constructors (public)
- Protein::Protein(const char *mol_name) : Molecule(mol_name), no_of_res(0)
- Constructor to create protein class, details of which are extracted from PDB file (specified by molecule name) containing residue name, residue number and residue count
- eg Protein prot1("p2ovo.pdb")
- NB function declared in MOLECULE.H
Further class member definitions : ProteinMainChain (derived from class Molecule)
Constructors (public)
- ProteinMainChain::ProteinMainChain(const char *mol_name) : Molecule(mol_name)
- Constructor to create protein main-chain, details of which are extracted from PDB file (specified by molecule name), and contain Atom class details of main-chain atoms
- eg ProteinMainChain protmc1("p2ovo.pdb");
- NB function declared in MOLECULE.H
Further class member definitions : AlphaCarbonChain (derived from class Molecule)
Constructors (public)
- AlphaCarbonChain::AlphaCarbonChain(const char *mol_name) : Molecule(mol_name)
- Constructor to create alpha-carbon chain, details of which are extracted from a PDB file (specified by molecule name), and contain Atom class details of alpha-carbon atoms
- eg AlphaCarbonChain alphacc1("p2ovo.pdb")
- NB function declared in MOLECULE.H