Chemistry Reference
In-Depth Information
a schema of tables that can effectively represent molecular structure with-
out regard to its external file format representation. It is often necessary
to import a molecular structure stored in some particular file format.
The extension functions molfile _ to _ smiles , mofile _ mol , and
molfile _ properties accomplish this for molfiles. It is sometimes
desirable to export a molecular structure using some particular molecular
file format. The core extension function smiles _ to _ molfile will cre-
ate a string representation of a molfile. The implementations of this func-
tion shown in the Appendix do not make use of the coordinates. It would
be possible to create an import and export function for each molecular file
format of interest. Using the OpenBabel implementation of the core exten-
sion functions would be an excellent starting point for such an exercise.
11.7 Functions Using Three-Dimensional
Atomic Coordinates
The previous section shows how molecular structures stored in an RDBMS
can be made available to client programs that traditionally read molecu-
lar structure files. The advantage of storing molecular structures in an
RDBMS is that the information can be used from within the database, as
well as by external clients. For example, it would be possible to search a
table of molecular structures for three-dimensional overlap, much like it
might be searched for substructure match. Of course, such search func-
tions need to be written and installed as extensions to an RDBMS, just like
the matches functions was done for substructure searches. This section
shows some possible ways this might be accomplished.
There are many methods to overlap one molecule's three-dimensional
coordinates onto another molecule's. Perhaps the simplest method simply
finds the center of one molecule and translates the other molecule to that
central coordinate. The following functions can be used to do this. The
align function takes two arrays of coordinates and returns the difference
between the two centers. This difference can be applied to either molecule
to align it with the other. The functions center and difference are util-
ity functions.
Create Or Replace Function align(amol float[][3], float[][3])
Returns float[3] A s $$
Select difference(center($1), center($2));
$$ Language SQL Immutable;
Create Or Replace Function center(amol float[][3]) Returns float[3]
As $$
Declare
centrum Float[3] := Array[0., 0., 0.];
natoms Integer := array_upper(amol, 1);
i Integer;
Search WWH ::




Custom Search