Daylight v4.9
Release Date: 1 February 2008


dt_mer_subselect - initiate a substructure search

Generic Prototype

dt_mer_subselect(dt_Handle, dt_Handle, dt_Integer, dt_Integer, dt_Integer,
dt_Integer, dt_String) => dt_Integer

C Prototype

#include "dt_merlin.h"

dt_Integer dt_mer_subselect(dt_Handle hitlist, dt_Handle column, dt_Integer searchtype, dt_Integer action, dt_Integer find_next, dt_Integer * status, dt_Integer smilen, dt_String smiles)

FORTRAN Prototype

include ''

integer*4 dt_f_mer_subselect(hitlist, column, searchtype, action, find_next, status, smiles)

integer*4 hitlist
integer*4 column
integer*4 searchtype
integer*4 action
integer*4 find_next
integer*4 status
character*() smiles


Begins a substructure search task on the server.

The hitlist 'hitlist' specifies where the resulting hits will be placed and, depending on the value of 'action', may specify the subset of the database to be searched.

The 'column' specifies the data to be searched.

The 'searchtype' specifies the type of substructure search to be performed. Currently, the only valid value is DX_SUBSTRUCT_SMILES

The 'action' specifies how the results of the search are to be combined with the original hitlist, as follows:


The original hitlist is discarded. The entire pool is searched. All rows which meet the criteria are included in the resulting hitlist.
All rows not on the original list are searched and hits are added to the current list.
All rows not on the original list are searched and non-hits are added to the current list.
The original hitlist is searched and hits are removed from the hitlist.
The original hitlist is searched and non-hits are removed from the hitlist.
The original hitlist is searched and as soon as a hit is found, its hitlist index is returned. The hitlist is unchanged. Data in derived columns is modified, even though the hitlist is unchanged. The parameter find_next indicates where the position in the hitlist where the search is to begin. The first row examined is 'find_next' + 1.
Like DX_ACTION_NEXT_HIT, except finds the next row which does not match the search criteria.
The parameter 'find_next' specifies where in the hitlist the search is to begin when the action is either DX_ACTION_NEXT_HIT or DX_ACTION_NEXT_NONHIT. A value of -1 indicates that the search should begin at the beginning of the hitlist. To continue a search from a previously-found hit, specify that hit's index (the value returned by the previous call to the search).

The substructure search uses the graph represented by the given 'smiles' string and searches the database for molecules or reactions whose graph is a subgraph of the given graph. Substructure searching uses the fingerprint datatype so if a row does not have a fingerprint dataitem, it will not be searched even if it has a valid SMILES.

Return Value

The status of the search task is returned in 'status' (see dt_continue(3) for descriptions). If the hitlist is short enough that time-slicing is not required, the value of 'status' will be DX_STATUS_DONE. Otherwise, the status will be DX_STATUS_IN_PROGRESS and dt_continue(3) will be required to finish the task.

The functions return value is either the progress on the task (see dt_done_when(3)) or -2 if an error is encountered.

Related Topics

dt_abort(3) dt_continue(3) dt_done_when(3) dt_mer_nsubselects(3)