The cartridge is able to perform real-time shape similarity searches by working in concert with a FastROCS server. Once an RMI server is installed on a GPU capable machine with a pre-existing FastROCS installation, shape searches are performed using FastROCS domain operators.
To create a FastROCS index for shape searches use:
create index fastrocs_index on struct_table(conformers) indextype is c$arnachm1.fastrocsIndexType;
It is recommended to build FastROCS indexes on columns of pre-built multi-conformer molecules for large data tables. Building an index on a column of SMILES or SDF strings may require a prohibitive amount of compute time for a large data table.
To change the OMEGA parameters maxconfs and maxtime from their default values use:
create index fastrocs_index on nci_open(smiles) indextype is c$arnachm1.fastrocsIndexType parameters ('max_conf:50 max_time:10.0');
To change from the default RMI server for the index build use:
create index fastrocs_index on nci_open(smiles) indextype is c$arnachm1.fastrocsIndexType parameters ('rmi_hostname:name_of_remote_host');
The name_of_remote_host may either be specified as a fully qualified domain name or IP address.
To defragment the external index (remove “holes” that are created when compounds are removed or edited) use:
alter index fastrocs_index rebuild;
Note that for the FastROCS index the change log table is committed whenever the table is read.
To completely rebuild the index (deleting the current change log table and serialized Java object then rebuilding that object) use:
alter index fastrocs_index rebuild parameters('full');
To load the index into the RMI server memory use:
alter index fastrocs_index parameters('load');
To unload/remove the index from the memory of the RMI server use:
alter index fastrocs_index parameters('unload');
To validate the structure of the external file of persisted multi-conformer OEMols use:
alter index fastrocs_index parameters('validate');
The index will automatically adjust during column renames, table renames and table truncates. To delete the index use:
drop index fastrocs_index;
To perform a FastROCS search on an indexed column use:
select * from table_name where c$arnachm1.fastrocs(column_name, query, minimum_similarity, max_hits) = 1;
select * from mol_table where c$arnachm1.fastrocs(conformers, 'COc1ccc(cc1)c2nnc(o2)SCC(=O)c3cc(ccc3F)F',1.2, 5000) = 1;
Queries may be submitted as a varchar2 containing a SMILES query or a clob containing a 3D conformer in MDL MOL/SDF format. If the query is submitted as a SMILES string, an OMEGA toolkit license will be required on the RMI server on which the index was built. The minimum_similarity may be used to filter the returned hits to those exceeding the minimum TanimotoCombo similarity threshold. The maximum number of hits can be used to limit the maximum number of rows returned by the query.
Similarity scores for returned rows my be obtained by the ancillary operator fastrocs_score. As for all ancillary operators, fastrocs_score takes a single integer argument that must match the extra argument passed to the FastROCS domain index operator. For example:
select id, c$arnachm1.fastrocs_score(1) from mol_table where c$arnachm1.fastrocs(conformers, 'COc1ccc(cc1)c2nnc(o2)SCC(=O)c3cc(ccc3F)F',1.2, 5000, 1) = 1;
Matching conformations superimposed to the coordinates of a 3D query may be obtained by the ancillary operator fastrocs_conformation. To obtain the superimposed conformations (returned as CLOBs), use:
select id, dbms_lob.getlength(c$arnachm1.fastrocs_conformation(1)) from mol_table where c$arnachm1.fastrocs(conformers, 'COc1ccc(cc1)c2nnc(o2)SCC(=O)c3cc(ccc3F)F',1.2, 5000, 1) = 1;
Note that the preceding SQL example shows the length of the matching conformation instead of the conformation itself. This is due to the 4000 character limit for varchar2 strings that exists in SQLPLUS. Exceeding this limit results in an error. The full conformations are best retrieved using a programming API as illustrated in the examples.
In cases where the query is submitted as a SMILES string, the conformation used in the shape search may be obtained by the function smiles_to_sdf_conformer_clob. This function may be called prior to a search to obtain the query conformation, and subsequently passed to the search. An example of the correct way to write this:
var conformation_clob clob; exec :conformation_clob := c$arnachm1.chem_structure.smiles_to_sdf_conformer_clob( 'COc1ccc(cc1)c2nnc(o2)SCC(=O)c3cc(ccc3F)F'); select id from mol_table where c$arnachm1.fastrocs(conformers, :conformation_clob, 1.2, 5000) = 1;
Care should be used in writing the SQL statement to convert the query to 3D prior to the search. In the following example, the 3D conversion will be performed once for every row returned:
select id from mol_table where c$arnachm1.fastrocs(conformers, c$arnachm1.chem_structure.smiles_to_sdf_conformer_clob( 'CCCc1ccc(cc1)S(=O)(=O)Nc2cc(on2)C'), 0.60, 5000) = 1;
This is a limitation from the Oracle implementation of extensible indexes.
The RMI server spawns external processes that may continue running if the RMI server crashes or is not shut down properly. While building a FastROCS index on a column, if the RMI server process is terminated, external OMEGA processes used to create 3D conformations may be left running. This will need to be terminated manually. It is not possible to stop OMEGA external processes from within Java.
When a FastROCS index is loaded into memory, a ShapeDatabaseServer.py process is created. The FastROCS proceses will be terminated upon normal shutdown of the RMI server (i.e. with the UNIX kill signal). However, if the RMI server is terminated abruptly (i.e. UNIX term signal) the ShapeDatabaseServer.py processes will continue running and will need to be stopped manually.
RMI communication as implemented in the cartridge is insecure. Any distributed system is thus best run on a secure intranet or virtual private network. The RMI server must leave port 1521 open to the Oracle server.