Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/jesus/devel/php/pear/Science/Chemistry/Molecule.php
Chemical classes - Science_Chemistry

Science_Chemistry_Molecule

Science_Chemistry_Molecule

Base class representing a Molecule

 

public class Science_Chemistry_Molecule

Base class representing a Molecule

AuthorsJesus M. Castagnetto <jmcastagnetto@php.net>
Version1.0

 
Direct known subclasses: Science_Chemistry_Molecule_XYZ, Science_Chemistry_Residue_PDB

Public Method Summary

object Science_Chemistry_Molecule

Science_Chemistry_Molecule(string $name, [ string $atoms ])

Constructor for the class, requires a molecule name
boolean

initMolecule(array $atoms)

Initializes the array of Science_Chemistry_Atom objects
boolean

addAtom(object Science_Chemistry_Atom $atom)

Adds a Science_Chemistry_Atom object to the list of atoms in the molecule
array

getAtoms()

Returns an array of Atom objects
boolean

isMolecule(object Science_Chemistry_Molecule $obj)

Checks if the object is an instance of Science_Chemistry_Molecule
string

toString()

Returns a string representation of the molecule
string

toCML([ string $title, string $id ], boolean $connect)

Returns a CML representation of the molecule
boolean

setBondCutoff(float $cutoff)

Sets the distance cutoff for bond determination
float

getBondCutoff()

Returns the bond cutoff uses to determine bonds
boolean

calcDistanceMatrix()

Calculates the atom-atom distance matrix in Angstroms
string

printDistanceMatrix()

Prints the atom-atom distance matrix
array

getDistanceMatrix()

Returns the atom-atom distance matrix
boolean

calcConnectionTable()

Calculates the connection table for the molecule
boolean

printConnectionTable()

Prints the molecule's connection table
array

getConnectionTable()

Returns an array of connected atoms and their bond distance

Public Field Summary

string

$name

Molecule name
integer

$num_atoms

Number of atoms in the molecule

Private Field Summary

array

$atoms

Array of atom objects in the molecule
array

$dist_matrix

Atom-Atom distance matrix
array

$conn_table

Atom-Atom connection (bond) table
float

$BONDCUTOFF

Distance cutoff for bond estimation

Public Method Details

Science_Chemistry_Molecule

public object Science_Chemistry_Molecule Science_Chemistry_Molecule( string $name, [ string $atoms ] )

  Constructor for the class, requires a molecule name
and an optional array of Science_Chemistry_Atom objects

Parameter
string $name
string $atoms = >>""<<
Returns object Science_Chemistry_Molecule

See Also $name, initMolecule()

initMolecule

public boolean initMolecule( array $atoms )

  Initializes the array of Science_Chemistry_Atom objects

Parameter
array $atoms
Returns boolean

See Also $num_atoms, $atoms, addAtom()

addAtom

public boolean addAtom( object Science_Chemistry_Atom $atom )

  Adds a Science_Chemistry_Atom object to the list of atoms in the molecule

Parameter
object Science_Chemistry_Atom $atom
Returns boolean

See Also initMolecule()

getAtoms

public array getAtoms( )

  Returns an array of Atom objects

Returns array

See Also $atoms

isMolecule

public boolean isMolecule( object Science_Chemistry_Molecule $obj )

  Checks if the object is an instance of Science_Chemistry_Molecule

Parameter
object Science_Chemistry_Molecule $obj
Returns boolean


toString

public string toString( )

  Returns a string representation of the molecule
as a XYZ-format file

Returns string


toCML

public string toCML( [ string $title, string $id ], boolean $connect )

  Returns a CML representation of the molecule
Accepts an optional id, and a flag to signalprinting of the connection table

Parameter
string $title = >>"molecule"<<
string $id = >>"mol1"<<
boolean $connect
Warning: documentation is missing.
Returns string


setBondCutoff

public boolean setBondCutoff( float $cutoff )

  Sets the distance cutoff for bond determination

Parameter
float $cutoff
Returns boolean

See Also $BONDCUTOFF, getBondCutoff(), calcConnectionTable()

getBondCutoff

public float getBondCutoff( )

  Returns the bond cutoff uses to determine bonds

Returns float

See Also $BONDCUTOFF, setBondCutoff(), calcConnectionTable()

calcDistanceMatrix

public boolean calcDistanceMatrix( )

  Calculates the atom-atom distance matrix in Angstroms

Returns boolean


printDistanceMatrix

public string printDistanceMatrix( )

  Prints the atom-atom distance matrix

Returns string


getDistanceMatrix

public array getDistanceMatrix( )

  Returns the atom-atom distance matrix

Returns array


calcConnectionTable

public boolean calcConnectionTable( )

  Calculates the connection table for the molecule

Returns boolean


printConnectionTable

public boolean printConnectionTable( )

  Prints the molecule's connection table

Returns boolean


getConnectionTable

public array getConnectionTable( )

  Returns an array of connected atoms and their bond distance
e.g. array ( array ($atomobj1, $atomobj2, $distance ), ... )

Returns array


Public Field Details

$name

public string $name

>>""<<

Molecule name


$num_atoms

public integer $num_atoms

>><<

Number of atoms in the molecule

See Also initMolecule()

Private Field Details

$atoms

private array $atoms

>>array()<<

Array of atom objects in the molecule

See Also initMolecule()

$dist_matrix

private array $dist_matrix

>>array()<<

Atom-Atom distance matrix

See Also calcDistanceMatrix()

$conn_table

private array $conn_table

>>array()<<

Atom-Atom connection (bond) table

See Also calcConnectionTable()

$BONDCUTOFF

private float $BONDCUTOFF

>>1.8<<

Distance cutoff for bond estimation

See Also setBondCutoff(), getBondCutoff(), calcConnectionTable()


Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta