Chemistry Reference
In-Depth Information
Table 10.1 Core Extension Functions
Function Name
Returns
Arguments
valid
Boolean
smiles
cansmiles
Text
smiles
isosmiles
Text
smiles
keksmiles
Text
smiles
matches
Boolean
smiles, smarts
list_matches
Integer[]
smiles, smarts, imatch, istart
count_matches
Integer
smiles, smarts
molfile_to_smiles
Text
molfile text
smiles_to_molfile
Text
smiles text
fp
Bit
smiles, nbits, maxpath
contains
Boolean
bit, bit
function is not implemented using PerlMol or FROWNS. The keksmiles
function is not implemented using FROWNS.
10.5.4 C Language Functions
It is possible to write PostgreSQL functions in C. Because PostgreSQL itself
is written in C, any extension functions can take advantage of the internal
representation of RDMBS data. In fact, examples on which C functions
might be based are the very functions used by the PostgreSQL RDMBS
for processing standard SQL data. This puts any C functions on an equal
footing with any built-in SQL functions. For this reason, C functions are
the best choice when issues of speed are important.
The CHORD 6 chemical cartridge is a commercial product from
gNova, Inc. It is written using C functions and the OEChem toolkit from
OpenEye. It provides the core functions discussed in this topic, such as
cansmiles , matches , count _ matches , list _ matches , smiles _
to _ molfile , molfile _ to _ smiles , and xform . CHORD makes it
possible to efficiently process RDBMS tables containing many millions of
chemical structures.
Unlike the procedural languages discussed above, C language func-
tions are compiled separately. The code itself is not included in the SQL
create function command. Instead, the create function command
refers to a compiled object such as shared object (.so) file located in some
directory on the server running the RDBMS. For example, the CHORD
oe _ smiles function is defined as follows.
Create or Replace Function oe_smiles(Text, integer)
Returns Text As 'gnova', 'oe_anysmiles'
Language 'c' Immutable Strict;
Comment On Function oe_smiles(Text, integer)
Is 'smiles to smiles of various types';
Search WWH ::




Custom Search