Chemistry Reference
In-Depth Information
atoms Integer[];
i Integer;
j Integer;
nmatch Integer;
Begin
Select gnova.list_matches($1, $2, 1, 1) into atoms;
if atoms Is Null Then
Return Null;
End If;
nmatch = array_upper(atoms, 1);
i = atoms[1];
scoords = coords[i:i][1:3];
For j In 2 .. nmatch Loop
i = atoms[j];
scoords = scoords || coords[i:i][1:3];
End Loop;
--Return scoords[2:nmatch+1];
Return scoords;
End;
$$ Language plpgsql Strict Immutable;
Comment On Function subset(text, text, float[]) Is
'Return subset of molecule''s atomic coordinates for atoms matching
SMARTS';
There are a great many more elaborate methods that might be used to align
three-dimensional molecular structures. Each of these could be imple-
mented as new SQL functions and used in SQL statements like the ones
above to produce the alignment to be applied to each structure of interest.
11.8 Conformations
When a project involves three-dimensional structures, it often includes
multiple conformations for any particular structure. In previous sections
of this chapter, an array of three-dimensional coordinates was stored for
each structure. When a project needs multiple conformations, another
table is needed to accommodate this. Instead of a coords column in a
structure table, a conformations table will be used. The unique cid
column in the structure table will function as a primary key related to
a cid foreign key column in the conformation table. The entity relation-
ship diagram in Figure 11.3 illustrates this. This effectively allows many
conformations for any structure. Each one has an energy and comment
conformation
structure
coords
NUMERIC[]
NUMERIC
PK cid *
INTEGER
energy
smiles
TEXT
name TEXT
comment
TEXT
FK cid *
INTEGER
Figure 11.3 Entity relationship diagram for structures and conformations.
Search WWH ::




Custom Search