Search Method

Applies To:

Document object

Description:

Queries a ChemFinder database. It supports substructure, text, and numerical searches.

Syntax:

Document.Search ( LPDISPATCH/Object moleculeQuery,
                               [VARIANT formulaQuery],
                               [VARIANT molWeightQuery],
                               [VARIANT sqlQuery],
                               [VARIANT searchFlags],
                               [VARIANT similarityThreshold],
                               [VARIANT maxHits
] )
moleculeQuery Molecule object
formulaQuery
Molecular formula
molWeightQuery
Molecular weight
sqlQuery 
SQL query
searchFlags 
Specify search parameters
similarityThreshold Tanimoto coefficient
maxHits
Maximum hit limit

Remarks:

The first argument, a Molecule object, is the only one that is required; however, it can be set to Nothing to allow searching by other fields. See Examples below.
searchFlags 
                     kCFDoubleBondStereo
                          requires that double bond stereochemistry match
                     kCFFragmentsOverlap
                         allows fragments to overlap (share one or more atom)
                     kCFFullStructure
                       requires an exact full structure match
                     kCFHitAnyChargeCarbon
                        allows uncharged carbon atoms in query to match charged carbon                           atoms in target
                     kCFHitAnyChargeHetero
                        allows uncharged hetro atoms in query to match charged hetero                           atoms in target
                     kCFPermitExtraneousFragments
                        permits extraneous fragments in target in addition to query
                     kCFSearchOverCurrentList
                        limits search to current hitlist
                     kCFSimilar
                        performs a similarity search
                     kCFTetrahedralStereo
                       requires matching tetrahedral stereochemistry
                     kCFUseReactionCenter
             uses reaction centers specified in query

 

Examples:

Example 1:  Substructure Search

The following Visual Basic code performs a substructure search:

Dim FinderDoc As Object 'Document object
Dim molQuery As Object  'Molecule object

FinderDoc.Search molQuery 'Performs query

'Note that code to create and set molQuery molecule and FinderDoc 'document is omitted.

'You will get 123 hits if you try this using molQuery set 'to benzene and FinderDoc set to the CS_Demo database as in 'Chapter 2, Tutorial 1 of the ChemFinder User's Guide.

Example 2: Formula Search

This VB example searches the database for molecules containing 6 carbons and 1 to 2 nitrogens.

Dim FinderDoc As Object    'Document object
Dim molQuery As Object     'Required molQuery object
Dim FormulaQuery As String 'Query string
Set molQuery = Nothing   'set required argument to Nothing
FormulaQuery = "C6 N1-2" 'specify formula

FinderDoc.Search molQuery, FormulaQuery 'Performs query

This will get 12 hits from the CS_Demo database.


'Code required to create FinderDoc is omitted.

See Also:

Molecule Object


2005 CambridgeSoft Corporation. All Rights Reserved. Privacy Statement
Tel  800 315-7300 / 617 588-9300     Fax  617 588-9390     Email   info@cambridgesoft.com
CambridgeSoft Corporation, 100 CambridgePark Drive, Cambridge, MA 02140 USA