chemaxon.jchem.db
Class JChemSearch

java.lang.Object
  extended by chemaxon.util.ErrorHandler
      extended by chemaxon.jchem.db.JChemSearch
All Implemented Interfaces:
TableTypeConstants, chemaxon.license.Licensable, SearchConstants, java.io.Serializable

public class JChemSearch
extends ErrorHandler
implements java.io.Serializable, SearchConstants, TableTypeConstants, chemaxon.license.Licensable

JavaBean for structure searching in structure tables of relational databases.

Example for using the class:

    searcher = new JChemSearch();
    searcher.setQueryStructure("c1cnccc1Cl");
    searcher.setConnectionHandler(conHandler);
    searcher.setStructureTable("cduser.structures");
    
    searchOptions = new JChemSearchOptions();
    searchOptions.setSearchType(JChemSearch.SIMILARITY);
    searchOptions.setDissimilarityThreshold(0.8);
    searchOptions.setMaxResultCount(100);
    searchOptions.setMaxTime(60000);
    searcher.setSearchOptions(searchOptions);
    
    searcher.setRunMode(JChemSearch.RUN_MODE_SYNCH_COMPLETE);
    searcher.run();
 

This class can be used as an ActiveX component. To avoid problems caused by exceptions in environments where exceptions can not be handled, exceptions are caught and stored using the chemaxon.util.ErrorHandler super class in methods with name like <method name>_NE (where NE means "no exception").

Author:
Ferenc Csizmadia, Szilard Dorant
See Also:
Serialized Form

Nested Class Summary
static class JChemSearch.DissimilarityMetrics
          Class for presenting the available dissimilarity metrics for similarity search.
 
Field Summary
static int APPEND_TO_RESULT_TABLE
          Constant for the generation of result tables.
static int CREATE_OR_REPLACE_RESULT_TABLE
          Constant for the generation of result tables.
static int NO_ORDERING
          Constant for ordering the result.
static int NO_RESULT_TABLE
          Constant for the generation of result tables.
static int ORDERING_BY_FILTER_ID_LIST
          Constant for ordering the result.
static int ORDERING_BY_ID
          Constant for ordering the result.
static int ORDERING_BY_ID_OR_SIMILARITY
          Constant for ordering the result.
static int QM_ALWAYS_SMARTS
          Deprecated. since JChem 3.2. Will always use the default mode in the future.
static int QM_ALWAYS_SMILES
          Deprecated. since JChem 3.2. Will always use the default mode in the future.
static int QM_DEFAULT
          Deprecated. since JChem 3.2. Will always use the default mode in the future.
static int RUN_MODE_ASYNCH_COMPLETE
          Runs the search in a new thread; run() or setRunning(boolean) return immediately.
static int RUN_MODE_ASYNCH_PROGRESSIVE
          Runs the search in a new thread; run() or setRunning(boolean) return immediately.
static int RUN_MODE_SYNCH_COMPLETE
          The "runner" methods (run() or setRunning(boolean) return only after all hits has been found.
 
Fields inherited from class chemaxon.util.ErrorHandler
CLASS_NOT_FOUND_ERROR, DATABASE_SEARCH_ERROR, exception, ILLEGAL_ACCESS_ERROR, INSTANTIATION_ERROR, IO_ERROR, MAX_SEARCH_FREQUENCY_EXCEEDED_ERROR, MOL_FORMAT_ERROR, NO_ERROR, PROPERTY_NOT_SET_ERROR, SQL_ERROR, UNIDENTIFIED_ERROR
 
Fields inherited from interface chemaxon.sss.SearchConstants
ABS_STEREO_ALWAYS_ON, ABS_STEREO_CHIRAL_FLAG, ABS_STEREO_TABLE_OPTION, CHARGE_MATCHING_DEFAULT, CHARGE_MATCHING_EXACT, CHARGE_MATCHING_IGNORE, DEFAULT_DISSIMILARITY_THRESHOLD, DEFAULT_SIMILARITY_THRESHOLD, DISSIMILARITY, EXACT, EXACT_FRAGMENT, EXACT_FRAGMENT_OFF, EXACT_FRAGMENT_ON, HCOUNT_MATCHING_AUTO, HCOUNT_MATCHING_EQUAL, HCOUNT_MATCHING_GREATER_OR_EQUAL, IMPLICIT_H_MATCHING_DEFAULT, IMPLICIT_H_MATCHING_DISABLED, IMPLICIT_H_MATCHING_ENABLED, ISOTOPE_MATCHING_DEFAULT, ISOTOPE_MATCHING_EXACT, ISOTOPE_MATCHING_IGNORE, KEEP_QUERY_ORDER, MARKUSH_AROM_FINAL_CHECK, MARKUSH_AROM_NO_FINAL_CHECK, MARKUSH_AROM_OFF, MARKUSH_DISABLED, MARKUSH_ENABLED, MARKUSH_HIT_ORIGINAL, MARKUSH_HIT_SUPERGRAPH, MATCH_COUNT_BETWEEN, MATCH_COUNT_RELATION, MIX_SGROUP_MATCHING_OFF, MIX_SGROUP_MATCHING_ON, NO_ABAS, NO_SCREEN, OPTION_CHARGE_MATCHING, OPTION_EXACT_FRAGMENT, OPTION_ISOTOPE_MATCHING, OPTION_KEEP_QUERY_ORDER, OPTION_MARKUSH_AROM, OPTION_MARKUSH_ENABLED, OPTION_MARKUSH_HIT, OPTION_MIX_SGROUP_MATCHING, OPTION_RADICAL_MATCHING, OPTION_STEREO_MODEL, OPTION_TAUTOMER_SEARCH, OPTION_VAGUE_BOND, OPTION_VALENCE_MATCHING, PERFECT, R_NODE_PLACEHOLDER, RADICAL_MATCHING_DEFAULT, RADICAL_MATCHING_EXACT, RADICAL_MATCHING_IGNORE, REARRANGE_QUERY, REGULAR_SEARCH, SEARCH_MODE_NAMES, SEARCH_OPTIONS_LENGTH, SIMILARITY, STEREO_DIASTEREOMER, STEREO_EXACT, STEREO_IGNORE, STEREO_MODEL_COMPREHENSIVE, STEREO_MODEL_DEFAULT, STEREO_MODEL_GLOBAL, STEREO_MODEL_LOCAL, STEREO_SPECIFIC, SUBSTRUCTURE, SUPERSTRUCTURE, TAUTOMER_SEARCH_OFF, TAUTOMER_SEARCH_ON, UNDEF_R_MATCHING_ALL, UNDEF_R_MATCHING_UNDEF_R, VAGUE_BOND_DEFAULT, VAGUE_BOND_LEVEL1, VAGUE_BOND_LEVEL2, VAGUE_BOND_LEVEL3, VAGUE_BOND_LEVEL4, VAGUE_BOND_OFF, VALENCE_MATCHING_IGNORE, VALENCE_MATCHING_ON
 
Fields inherited from interface chemaxon.jchem.db.TableTypeConstants
FP_DEFAULT_BITS_PER_PATTERN, FP_DEFAULT_LENGTH_IN_INTS, FP_DEFAULT_PATTERN_LENGTH, MYSQL_DEFAULT_TABLE_TYPE, MYSQL_FORCE_INNO_DB, MYSQL_FORCE_MYISAM, TABLE_TYPE_ANY_STRUCTURES, TABLE_TYPE_DEFAULT, TABLE_TYPE_EXPLANATIONS, TABLE_TYPE_IS_NOT_SUPPORTED, TABLE_TYPE_MARKUSH_LIBRARIES, TABLE_TYPE_MOLECULES, TABLE_TYPE_NAMES, TABLE_TYPE_QUERY_STRUCTURES, TABLE_TYPE_REACTIONS
 
Constructor Summary
JChemSearch()
          Creates new JChemSearch class
JChemSearch(java.lang.String indexedTable, java.lang.String indexedColumn)
          For internal use only.
 
Method Summary
 void cleanResults()
          Cleans stored search results.
static void clearCache()
          Clears the cache that stores fingerprints and structures.
 int getAbsoluteStereo()
          Deprecated. since JChem 5.0. use JChemSearchOptions.getAbsoluteStereo() instead
 int[] getAvailableNewHits(int arraySize)
          Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE.
 java.util.Hashtable getCachedTables()
          Gets the names and sizes of tables currently in the cache.
 java.lang.String getCacheError()
          For checking for cache errors.
 java.sql.Connection getConnection()
          Getter for property connection.
 ConnectionHandler getConnectionHandler()
          Getter for property connectionHandler.
 int getCurrentId()
          Getter for property currentId.
 float[] getDissimilarity()
          Getter for dissimilarity results.
 float getDissimilarity(int index)
          Indexed getter for property dissimilarity.
static JChemSearch.DissimilarityMetrics getDissimilarityMetrics(ConnectionHandler ch, java.lang.String tableName)
          Returns the available dissimilarity metrics for the given table.
 float getDissimilarityThreshold()
          Deprecated. since JChem 5.0. Use JChemSearchOptions.getDissimilarityThreshold() instead
 int getDoubleBondStereoMatchingMode()
          Deprecated. since JChem 5.0. use SearchOptions.getDoubleBondStereoMatchingMode() instead
 java.lang.Throwable getException()
          Getter for property exception.
 java.lang.String getFilter()
          Deprecated. Since 5.0 Use SearchOptions.getChemTermsFilter() instead.
 java.lang.String getFilterConfigFileName()
          Deprecated. Since 5.0 Use SearchOptions.getChemTermsFilterConfig() instead.
 java.lang.String getFilterQuery()
          Deprecated. since JChem 5.0. use JChemSearchOptions.getFilterQuery() instead
 java.lang.String getFilterTable()
          Deprecated. since 2.3. Please use setFilterQuery(String) instead.
 int getHCountMatching()
          Deprecated. since JChem 5.0. use SearchOptions.getHCountMatching() instead
 Molecule[] getHitsAsMolecules(int[] idList, HitColoringAndAlignmentOptions options, java.util.ArrayList dataFieldNames, java.util.ArrayList dataFieldValues)
          Returns hits ready for display.
 int getMaxResultCount()
          Deprecated. since JChem 5.0. use JChemSearchOptions.getMaxResultCount() instead
 long getMaxTime()
          Deprecated. since JChem 5.0. use JChemSearchOptions.getMaxTime() instead
 int getNextHit()
          Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE.
 int getOption(int option)
          Deprecated. since 5.0, use getters in
  • see getSearchOptions()
  • see SearchOptions
  • see JChemSearchOptions
  •  int getOrder()
              Getter for property order.
     java.lang.String getProgressMessage()
              Getter for property progressMessage.
     int getQueryMode()
              Deprecated. since JChem 3.2. Will always use the default mode in the future.
     java.lang.String getQueryStructure()
              Getter for property queryStructure.
     int getResult(int index)
              Indexed getter for property results.
     int getResultCount()
              Getter for property resultCount.
     int[] getResults()
              Returns an int array containing the cd_id values of found compounds.
     java.lang.String getResultTable()
              Getter for property resultTable.
     int getResultTableMode()
              Getter for property resultTableMode.
     int getRunMode()
              Retruns the current run mode.
     int getScreenedCount()
              Gets the number of screeened structures.
     long getScreeningTime()
              Gets the screening time.
     JChemSearchOptions getSearchOptions()
              Returns the SearchOptions object associated with this Search object.
     long getSearchTime()
              Gets the total search time.
     int getSearchType()
              Deprecated. since JChem 5.0 use SearchOptions.getSearchType() instead
     float getSimilarity(int index)
              Deprecated. Use getDissimilarity(int) instead.
     float getSimilarityThreshold()
              Deprecated. Use getDissimilarityThreshold() instead
     java.lang.String getStructureTable()
              Getter for property structureTable.
     boolean getTautomerSearch()
              Deprecated. since JChem 5.0. use SearchOptions.isTautomerSearch() instead
     int getTimeout()
              Gets the current timout setting.
     int getVagueBondLevel()
              Deprecated. since JChem 5.0. use SearchOptions.getVagueBondLevel() instead
     boolean hasMoreHits()
              Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE.
     boolean isDeleteFilterTableWhenReady()
              Deprecated. since 2.3. Please use JChemSearchOptions.getFilterQuery() instead.
     boolean isExactChargeMatching()
              Deprecated. since JChem 3.2 Please use SearchOptions.getChargeMatching() instead.
     boolean isExactIsotopeMatching()
              Deprecated. since JChem 3.2 Please use SearchOptions.getIsotopeMatching() instead.
     boolean isExactQueryAtomMatching()
              Deprecated. since JChem 5.0. use SearchOptions.isExactQueryAtomMatching() instead
     boolean isExactRadicalMatching()
              Deprecated. since JChem 3.2 Please use SearchOptions.getRadicalMatching() instead.
     boolean isExactStereoMatching()
              Deprecated. since JChem 5.0. use SearchOptions.isExactStereoMatching() instead
     boolean isInfoToStdError()
              Getter for property infoToStdError.
     boolean isLicensed()
              Returns information about the licensing of the product.
     boolean isMaxResultCountReached()
              Getter for property maxResultCountReached.
     boolean isMaxTimeReached()
              Getter for property maxTimeReached.
     boolean isRunning()
              Getter for property running.
     boolean isStereoSearch()
              Deprecated. since JChem 5.0. use SearchOptions.isStereoSearch() instead
     boolean isStructureCaching()
              Getter for property structureCaching.
     boolean isWaitingForResult()
              Deprecated. Replaced by getRunMode().
     void run_NE()
              Starts searching.
     void run()
              Starts searching.
     void setAbsoluteStereo(int absoluteStereo)
              Deprecated. since JChem 5.0. use JChemSearchOptions.setAbsoluteStereo(int) instead
     void setCacheExpirationTime(double hours)
              Sets the expiration time for the structure cache.
     void setConnection(java.sql.Connection connection)
              Deprecated. It is recommended to use setConnectionHandler instead.
     void setConnectionHandler(ConnectionHandler connectionHandler)
              Setter for property connectionHandler.
     void setDeleteFilterTableWhenReady(boolean deleteFilterTableWhenReady)
              Deprecated. since 2.3. Please use JChemSearchOptions.getFilterQuery() instead.
     void setDescriptorConfig(java.lang.String descriptorConfig)
              Deprecated. since JChem 5.0 use JChemSearchOptions.setDescriptorConfig(String) instead
     void setDescriptorName(java.lang.String descriptorName)
              Deprecated. since JChem 5.0 use JChemSearchOptions.setDescriptorName(String) instead
     void setDissimilarityMetric(java.lang.String dissimilarityMetric)
              Deprecated. since JChem 5.0. Use JChemSearchOptions.setDissimilarityMetric(String) instead
     void setDissimilarityThreshold(float dissimilarityThreshold)
              Deprecated. since JChem 5.0. Use JChemSearchOptions.setDissimilarityThreshold(float) instead
     void setDoubleBondStereoMatchingMode(int mode)
              Deprecated. since JChem 5.0. use SearchOptions.setDoubleBondStereoMatchingMode(int) instead
     void setExactChargeMatching(boolean exactChargeMatching)
              Deprecated. since JChem 3.2 Please use SearchOptions.setChargeMatching(int) instead.
     void setExactIsotopeMatching(boolean exactIsotopeMatching)
              Deprecated. since JChem 3.2 Please use SearchOptions.setIsotopeMatching(int) instead.
     void setExactQueryAtomMatching(boolean exactQueryAtomMatching)
              Deprecated. since JChem 5.0. use SearchOptions.setExactQueryAtomMatching(boolean) instead
     void setExactRadicalMatching(boolean exactRadicalMatching)
              Deprecated. since JChem 3.2 Please use SearchOptions.setRadicalMatching(int) instead.
     void setExactStereoMatching(boolean exactStereoMatching)
              Deprecated. since JChem 5.0. use SearchOptions.setExactStereoMatching(boolean) instead
     void setFilter(java.lang.String filterExpression)
              Deprecated. Since 5.0 Use SearchOptions.setChemTermsFilter(String) instead.
     void setFilterConfigFileName(java.lang.String fileName)
              Deprecated. Since 5.0 Use SearchOptions.setChemTermsFilterConfig(String) instead, using the content of the file as parameter.
     void setFilterIDList(int[] ids)
              Specifies a list of cd_id's that are allowed to be included in the result set.
     void setFilterIDNotList(int[] ids)
              Specifies a list of cd_id's that should not to be included in the result set.
     void setFilterQuery(java.lang.String filterQuery)
              Deprecated. since JChem 5.0 use JChemSearchOptions.setFilterQuery(String)
     void setFilterTable(java.lang.String filterTable)
              Deprecated. since 2.3. Please use JChemSearchOptions.getFilterQuery() instead.
     void setHCountMatching(int HCountMatching)
              Deprecated. since JChem 5.0. use SearchOptions.setHCountMatching(int) instead
     void setInfoToStdError(boolean infoToStdError)
              Setter for property infoToStdError.
     void setLicenseEnvironment(java.lang.String env)
              Every license can have a modifier environment that's tipically an integration environment.
     void setMatchCountBetween(int hitLimitLow, boolean isLowerLimitIncluded, int hitLimitHigh, boolean isHigherLimitIncluded)
              Deprecated. since JChem 5.0 use chemaxon.sss.search.JChemSearchOptions#setMatchCountOption(MatchCountOptions) instead
     void setMatchCountInRelation(java.lang.String relation, int hitLimit)
              Deprecated. since JChem 5.0 use chemaxon.sss.search.JChemSearchOptions#setMatchCountOption(MatchCountOptions) instead
     void setMaxCacheSize(int maxCacheSizeMB)
              Sets the desired cache memory allocation policy.
     void setMaxResultCount(int maxResultCount)
              Deprecated. since JChem 5.0. use JChemSearchOptions.setMaxResultCount(int) instead
     void setMaxTime(long maxTime)
              Deprecated. since JChem 5.0. use JChemSearchOptions.setMaxTime(long) instead
     void setMinNonCachedMemory(int minNonCachedMemoryMB)
              Sets the desired cache memory allocation policy.
     void setNumberOfProcessingThreads(int threads)
              Sets the number of processing threads.
     void setOption(int option, int value)
              Deprecated. since 5.0, use setters in SearchOptions
  • see getSearchOptions()
  • see SearchOptions
  • see JChemSearchOptions
  •  void setOrder(int order)
              Setter for property order.
     void setQueryMode(int queryMode)
              Deprecated. since JChem 3.2. Will always use the default mode in the future.
     void setQueryStructure(Molecule queryMol)
              Sets the query structure.
     void setQueryStructure(java.lang.String queryStructure)
              Setter for property queryStructure.
     void setRegCode(long code)
              Sets the registration code.
     void setResultTable(java.lang.String resultTable)
              Setter for property resultTable.
     void setResultTableMode(int resultTableMode)
              Setter for property resultTableMode.
     void setReturnsNonHits(boolean value)
              Deprecated. since JChem 5.0 use JChemSearchOptions.setReturnsNonHits(boolean) instead
     void setRunMode(int runMode)
              Specifies whether the search is performed synchronously or asychronously and if performed asynchronously, whether the hits can be obtained as soon as they are found or only after the search has completed.
     void setRunning(boolean run)
              Setter for property running.
     void setSearchOptions(JChemSearchOptions options)
              Sets search parameters.
     void setSearchType(int searchType)
              Deprecated. since JChem 5.0 use SearchOptions.setSearchType(int) instead
     void setSimilarityThreshold(float similarityThreshold)
              Deprecated. Use instead
     void setStereoSearch(boolean stereoSearch)
              Deprecated. since JChem 5.0. use SearchOptions.setStereoSearch(boolean) instead
     void setStructureTable(java.lang.String structureTable)
              Setter for property structureTable.
     void setTautomerSearch(boolean value)
              Deprecated. since JChem 5.0. use SearchOptions.setTautomerSearch(boolean) instead
     void setThreadPriority(int priority)
              Sets the priority of the processing threads.
     void setTimeout(int seconds)
              Sets the timeout value in seconds.
     void setVagueBondLevel(int level)
              Deprecated. since JChem 5.0. use SearchOptions.setVagueBondLevel(int) instead
     void setWaitingForResult(boolean waitingForResult)
              Deprecated. replaced by setRunMode(int).
     void waitUntilSearchComplete()
              Waits until after the search has completed.
     
    Methods inherited from class chemaxon.util.ErrorHandler
    checkError, checkException, getError, getErrorMessage, getStackTrace
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    NO_RESULT_TABLE

    public static final int NO_RESULT_TABLE
    Constant for the generation of result tables. Meaning: Don't store the results in a table. (Value=0)

    See Also:
    Constant Field Values

    CREATE_OR_REPLACE_RESULT_TABLE

    public static final int CREATE_OR_REPLACE_RESULT_TABLE
    Constant for the generation of result tables. Meaning: Create a result table. If a table with same name exists, replace it with the new one. (Value=2)

    See Also:
    Constant Field Values

    APPEND_TO_RESULT_TABLE

    public static final int APPEND_TO_RESULT_TABLE
    Constant for the generation of result tables. Meaning: Append to an existing result table. Create a new one if it doesn't exist (Value=3)

    See Also:
    Constant Field Values

    NO_ORDERING

    public static final int NO_ORDERING
    Constant for ordering the result. Meaning: Don't order the result (Value=0)

    See Also:
    Constant Field Values

    ORDERING_BY_ID

    public static final int ORDERING_BY_ID
    Constant for ordering the result. Meaning: Order the result according to the cd_id values (Value=1)

    See Also:
    Constant Field Values

    ORDERING_BY_ID_OR_SIMILARITY

    public static final int ORDERING_BY_ID_OR_SIMILARITY
    Constant for ordering the result. Meaning: Order the result according to the calculated dissimilarity in the case of dissimilarity searching, use the cd_id values otherwise (Value=2)

    See Also:
    Constant Field Values

    ORDERING_BY_FILTER_ID_LIST

    public static final int ORDERING_BY_FILTER_ID_LIST
    Constant for ordering the result. Meaning: Order the result according to the filterIDList

    See Also:
    Constant Field Values

    QM_DEFAULT

    public static final int QM_DEFAULT
    Deprecated. since JChem 3.2. Will always use the default mode in the future.
    If search type is SearchConstants.PERFECT, SearchConstants.SUPERSTRUCTURE or SearchConstants.SIMILARITY, treats SMILES/SMARTS input strings as SMILES, otherwise as SMARTS.

    See Also:
    Constant Field Values

    QM_ALWAYS_SMILES

    public static final int QM_ALWAYS_SMILES
    Deprecated. since JChem 3.2. Will always use the default mode in the future.
    Always treats SMILES/SMARTS input strings as SMILES.

    See Also:
    Constant Field Values

    QM_ALWAYS_SMARTS

    public static final int QM_ALWAYS_SMARTS
    Deprecated. since JChem 3.2. Will always use the default mode in the future.
    Always treats SMILES/SMARTS input strings as SMARTS.

    See Also:
    Constant Field Values

    RUN_MODE_SYNCH_COMPLETE

    public static int RUN_MODE_SYNCH_COMPLETE
    The "runner" methods (run() or setRunning(boolean) return only after all hits has been found. (Corresponds to calling setWaitingForResult(boolean) with true.)

    Since:
    JChem 5.0

    RUN_MODE_ASYNCH_COMPLETE

    public static int RUN_MODE_ASYNCH_COMPLETE
    Runs the search in a new thread; run() or setRunning(boolean) return immediately. (Corresponds to calling setWaitingForResult(boolean) with false)

    Since:
    JChem 5.0

    RUN_MODE_ASYNCH_PROGRESSIVE

    public static int RUN_MODE_ASYNCH_PROGRESSIVE
    Runs the search in a new thread; run() or setRunning(boolean) return immediately. The methods hasMoreHits(), getNextHit() and getAvailableNewHits(int) can be used retrieve hits as soon as they become available.
    This mode doesn't support

    Since:
    JChem 5.0
    Constructor Detail

    JChemSearch

    public JChemSearch()
    Creates new JChemSearch class


    JChemSearch

    public JChemSearch(java.lang.String indexedTable,
                       java.lang.String indexedColumn)
    For internal use only.

    Method Detail

    getQueryStructure

    public java.lang.String getQueryStructure()
    Getter for property queryStructure.

    Returns:
    Value of property queryStructure.

    setQueryStructure

    public void setQueryStructure(java.lang.String queryStructure)
    Setter for property queryStructure. The query structure may be in MDL Molfile, Smiles or other format recognized by JChem. If the specified value is null or empty string, then the search returns all molecules.

    NOTE for Daylight formats: If search type is SearchConstants.PERFECT, SearchConstants.SUPERSTRUCTURE or SearchConstants.SIMILARITY, treats SMILES/SMARTS input strings as SMILES, otherwise as SMARTS.

    Parameters:
    queryStructure - New value of property queryStructure.

    setQueryStructure

    public void setQueryStructure(Molecule queryMol)
    Sets the query structure. If the specified value is null, then the search returns all molecules.

    Parameters:
    queryMol - the query structure.

    getStructureTable

    public java.lang.String getStructureTable()
    Getter for property structureTable.

    Returns:
    Value of property structureTable.

    setStructureTable

    public void setStructureTable(java.lang.String structureTable)
    Setter for property structureTable. It specifies the name of the table to be searched for structures containing the query.

    Parameters:
    structureTable - New value of property structureTable.

    getSearchType

    public int getSearchType()
    Deprecated. since JChem 5.0 use SearchOptions.getSearchType() instead

    Getter for property searchType.

    Returns:
    Value of property searchType.

    setSearchType

    public void setSearchType(int searchType)
    Deprecated. since JChem 5.0 use SearchOptions.setSearchType(int) instead

    Sets different search options according to a predefined search type. For full explanation see JChem Query Guide.
    Acceptable values: SearchConstants.NO_SCREEN, SearchConstants.NO_ABAS, SearchConstants.SUBSTRUCTURE (default), SearchConstants.SUPERSTRUCTURE (no query fetures allowed), SearchConstants.SIMILARITY, SearchConstants.EXACT, SearchConstants.EXACT_FRAGMENT and SearchConstants.PERFECT.

    WARNING: This method may affect other search settings, therefore if other search options are adjusted, this method should be called first! The following options are affected:

    Parameters:
    searchType - New value of property searchType.

    setOption

    public void setOption(int option,
                          int value)
    Deprecated. since 5.0, use setters in SearchOptions
  • see getSearchOptions()
  • see SearchOptions
  • see JChemSearchOptions
  • Setter for some advanced search options.

    Parameters:
    option - Option identifier to be set.
    value - Value of option to be set.
    The list of accepted option identifiers:
    Since:
    JChem 3.2

    getOption

    public int getOption(int option)
    Deprecated. since 5.0, use getters in
  • see getSearchOptions()
  • see SearchOptions
  • see JChemSearchOptions
  • Getter for some advanced search options.

    Parameters:
    option - Option identifier.
    The list of accepted identifiers:
    Returns:
    the setting of the given option
    Since:
    JChem 3.2

    getException

    public java.lang.Throwable getException()
    Getter for property exception. The ancestor's method is overloaded to allow handling exceptions occuring in the searching thread.

    Overrides:
    getException in class ErrorHandler
    Returns:
    Value of property exception.

    getCacheError

    public java.lang.String getCacheError()
    For checking for cache errors. Should be called after the search is finished.

    Returns:
    the error text, or null in case of normal execution.
    Since:
    JChem 3.0

    getCachedTables

    public java.util.Hashtable getCachedTables()
    Gets the names and sizes of tables currently in the cache.

    Returns:
    the names and allocated memory size in bytes as key - value (String - Long) pairs.
    Since:
    JChem 3.0

    getMaxTime

    public long getMaxTime()
    Deprecated. since JChem 5.0. use JChemSearchOptions.getMaxTime() instead

    Getter for property maxTime.

    Returns:
    Value of property maxTime.

    setMaxTime

    public void setMaxTime(long maxTime)
    Deprecated. since JChem 5.0. use JChemSearchOptions.setMaxTime(long) instead

    Setter for property maxTime. Sets the maximum amount of time in milliseconds, which is available for searching. If the time is passed searching stops. If maxTime is 0, then there is no limit. (Default: 0)

    Parameters:
    maxTime - New value of property maxTime.

    getMaxResultCount

    public int getMaxResultCount()
    Deprecated. since JChem 5.0. use JChemSearchOptions.getMaxResultCount() instead

    Getter for property maxResultCount.

    Returns:
    Value of property maxResultCount.

    setMaxResultCount

    public void setMaxResultCount(int maxResultCount)
    Deprecated. since JChem 5.0. use JChemSearchOptions.setMaxResultCount(int) instead

    Setter for property maxResultCount. Limits the number of molecules returned by the search to maxResultCount". This can save time when there would be too many results. If maxResultCount is 0, then there is no limit. (Default: 0)

    NOTE: The search will stop after the maximum result count is reached. This is also true for SIMILARITY searches: after the search has found the given number of compounds that falls below the specified similarity threshold, it stops and returns them. To find the n most similar structures in table, please set maxResultCount to 0 (unlimitied, default), and use the first n results with ordering set by setOrder(int) to ORDERING_BY_ID_OR_SIMILARITY.

    Parameters:
    maxResultCount - New value of property maxResultCount.

    getFilterQuery

    public java.lang.String getFilterQuery()
    Deprecated. since JChem 5.0. use JChemSearchOptions.getFilterQuery() instead

    Getter for property filterQuery

    Returns:
    Value of property filterQuery.
    Since:
    JChem 2.3

    setFilterQuery

    public void setFilterQuery(java.lang.String filterQuery)
    Deprecated. since JChem 5.0 use JChemSearchOptions.setFilterQuery(String)

    Setter for property filterQuery. SQL query for filtering. The result should contain the cd_id values. Example:
        searcher.setFilterQuery("select cd_id from mystructures where cd_id>1000");
     
    If the SELECT contains an "ORDER BY" clause, the results will be ordered accordingly, the setting for setOrder(int) will be ignored, except when an inverse hit list is requested.

    NOTE: The filtered cd_id values are cached. Invoke setFilterQuery again before the next search, if the filter needs to be refreshed.

    Parameters:
    filterQuery - New value of property filterQuery.
    Since:
    JChem 2.3

    setFilterIDList

    public void setFilterIDList(int[] ids)
    Specifies a list of cd_id's that are allowed to be included in the result set. Useful for narrowing the result of a previous search.

    Parameters:
    ids - the cd_id values in an array
    Since:
    JChem 3.1

    setFilterIDNotList

    public void setFilterIDNotList(int[] ids)
    Specifies a list of cd_id's that should not to be included in the result set.

    Parameters:
    ids - the cd_id values in an array
    Since:
    JChem 3.1.2

    getFilterTable

    public java.lang.String getFilterTable()
    Deprecated. since 2.3. Please use setFilterQuery(String) instead.

    Getter for property filterTable.

    Returns:
    Value of property filterTable.

    setFilterTable

    public void setFilterTable(java.lang.String filterTable)
    Deprecated. since 2.3. Please use JChemSearchOptions.getFilterQuery() instead.

    Setter for property filterTable. Sets a table or a view to be used as a filter. (The structure table and the filter table will be joined by their cd_id columns during the search) This feature can also be used for ordering the results by columns outside the structure table.

    Parameters:
    filterTable - The name of an optional table used for decreasing the size of the set to be searched. It containes a subset of the id-s in the structure table. (The search will be peformed in the inner join of the structure table and the filter table.)
    See Also:
    setDeleteFilterTableWhenReady

    isDeleteFilterTableWhenReady

    public boolean isDeleteFilterTableWhenReady()
    Deprecated. since 2.3. Please use JChemSearchOptions.getFilterQuery() instead.

    Getter for property deleteFilterTableWhenReady.

    Returns:
    Value of property deleteFilterTableWhenReady.

    setDeleteFilterTableWhenReady

    public void setDeleteFilterTableWhenReady(boolean deleteFilterTableWhenReady)
    Deprecated. since 2.3. Please use JChemSearchOptions.getFilterQuery() instead.

    Setter for property deleteFilterTableWhenReady. Determines if the filter table should be dropped after the search. (Default: false)

    Parameters:
    deleteFilterTableWhenReady - New value of property deleteFilterTableWhenReady.
    See Also:
    setFilterTable

    getSimilarityThreshold

    public float getSimilarityThreshold()
    Deprecated. Use getDissimilarityThreshold() instead

    Getter for property similarityThreshold.

    Returns:
    1-dissimilarityThreshold, or zero if dissimilarityThreshold>1.

    getDissimilarityThreshold

    public float getDissimilarityThreshold()
    Deprecated. since JChem 5.0. Use JChemSearchOptions.getDissimilarityThreshold() instead

    Getter for property dissimilarityThreshold.

    Returns:
    Value of property dissimilarityThreshold.

    setSimilarityThreshold

    public void setSimilarityThreshold(float similarityThreshold)
    Deprecated. Use instead

    Setter for property similarityThreshold. Sets the threshold for similarity searches. The value has to be between 0 and 1. A greater threshold results less hits that are more similar to the query structure. (Default: 0.7)

    Parameters:
    similarityThreshold - New value of property similarityThreshold.

    setDissimilarityThreshold

    public void setDissimilarityThreshold(float dissimilarityThreshold)
    Deprecated. since JChem 5.0. Use JChemSearchOptions.setDissimilarityThreshold(float) instead

    Setter for property dissimilarityThreshold. Sets the threshold for similarity searches. A lower threshold results less hits that are more similar to the query structure. (Default: 0.3)

    Parameters:
    dissimilarityThreshold - New value of property dissimilarityThreshold.

    setDissimilarityMetric

    public void setDissimilarityMetric(java.lang.String dissimilarityMetric)
    Deprecated. since JChem 5.0. Use JChemSearchOptions.setDissimilarityMetric(String) instead

    Sets the metric to be used during similarity search.

    Parameters:
    dissimilarityMetric - the name of the metric to be used. Specify null for the default metric.
    Since:
    JChem 3.2
    See Also:
    getDissimilarityMetrics(chemaxon.util.ConnectionHandler, String)

    getDissimilarityMetrics

    public static JChemSearch.DissimilarityMetrics getDissimilarityMetrics(ConnectionHandler ch,
                                                                           java.lang.String tableName)
                                                                    throws java.sql.SQLException
    Returns the available dissimilarity metrics for the given table.

    Parameters:
    ch - ConnaectionHandler with live connection
    tableName - the name of the JChem structure table
    Returns:
    the information about the available metrics, or null if no metrics are available
    Throws:
    java.sql.SQLException
    Since:
    JChem 3.2
    See Also:
    setDissimilarityMetric(String), MolecularDescriptor.getDefaultDissimilarityMetricThresholds(), MolecularDescriptor.getDissimilarityMetrics(), MolecularDescriptor.getDefaultMetricIndex(), MolecularDescriptor.getMetricName(int), setDissimilarityMetric(String)

    setDescriptorName

    public void setDescriptorName(java.lang.String descriptorName)
    Deprecated. since JChem 5.0 use JChemSearchOptions.setDescriptorName(String) instead

    Sets the name of descriptor used for descriptor similarity search

    Parameters:
    descriptorName - the descriptor identifier used for similatiry search. If not specified or null, structural fingerprint similarity search performed by default.
    Since:
    JChem 2.0

    setDescriptorConfig

    public void setDescriptorConfig(java.lang.String descriptorConfig)
    Deprecated. since JChem 5.0 use JChemSearchOptions.setDescriptorConfig(String) instead

    Sets the configuration used for descriptor dissimilarity search

    Parameters:
    descriptorConfig - the configuration used for dissimilarity search calculation. Default value: null (means default configuration)
    Since:
    JChem 2.0.0

    isStructureCaching

    public boolean isStructureCaching()
    Getter for property structureCaching.

    Returns:
    Value of property structureCaching.

    isInfoToStdError

    public boolean isInfoToStdError()
    Getter for property infoToStdError.

    Returns:
    Value of property infoToStdError.

    setInfoToStdError

    public void setInfoToStdError(boolean infoToStdError)
    Setter for property infoToStdError. If set to true, information useful for testing will be written in the servlet server's error log file. (Default: false)

    Parameters:
    infoToStdError - New value of property infoToStdError.

    getConnectionHandler

    public ConnectionHandler getConnectionHandler()
    Getter for property connectionHandler.

    Returns:
    Value of property connectionHandler.

    setConnectionHandler

    public void setConnectionHandler(ConnectionHandler connectionHandler)
    Setter for property connectionHandler. By setting connectionHandler, you also set the connection property. The usage of connectionHandler is suggested in a JavaBean or * ActiveX environment.

    Parameters:
    connectionHandler - New value of property connectionHandler.

    getConnection

    public java.sql.Connection getConnection()
    Getter for property connection.

    Returns:
    Value of property connection.

    setConnection

    public void setConnection(java.sql.Connection connection)
                       throws java.beans.PropertyVetoException
    Deprecated. It is recommended to use setConnectionHandler instead.

    Setter for property connection.
    Assumes that the name of the property table is "JChemProperties"

    Parameters:
    connection - New value of property connection.
    Throws:
    java.beans.PropertyVetoException

    isWaitingForResult

    public boolean isWaitingForResult()
    Deprecated. Replaced by getRunMode().

    Getter for property waitingForResult.

    Returns:
    Value of property waitingForResult.

    setWaitingForResult

    public void setWaitingForResult(boolean waitingForResult)
    Deprecated. replaced by setRunMode(int).

    Setter for property waitingForResult. If the property is true, then processing waits until the end of the search. Otherwise searching takes place in a new thread and run() (or its alternative) returns immediately. (Default: false)

    Parameters:
    waitingForResult - New value of property waitingForResult.

    getRunMode

    public int getRunMode()
    Retruns the current run mode.

    Returns:
    the current run mode.
    Since:
    JChem 5.0
    See Also:
    setRunMode(int)

    setRunMode

    public void setRunMode(int runMode)
    Specifies whether the search is performed synchronously or asychronously and if performed asynchronously, whether the hits can be obtained as soon as they are found or only after the search has completed. Accepted values: The default run mode is RUN_MODE_SYNCH_COMPLETE

    Parameters:
    runMode -
    Since:
    JChem 5.0

    setReturnsNonHits

    public void setReturnsNonHits(boolean value)
    Deprecated. since JChem 5.0 use JChemSearchOptions.setReturnsNonHits(boolean) instead

    Determines if the inverse of the hit set should be returned.

    Parameters:
    value - set to true to get non-hit structures. Default is false.
    Since:
    JChem 2.2

    setSearchOptions

    public void setSearchOptions(JChemSearchOptions options)
    Sets search parameters.

    Parameters:
    options - search options. Will be copied, modification of the original object does not affect future searches unless this method is called again.
    Since:
    JChem 5.0
    See Also:
    getSearchOptions()

    getSearchOptions

    public JChemSearchOptions getSearchOptions()
    Returns the SearchOptions object associated with this Search object. The object returned is linked with this Search object, so modifications in the returned SearchOptions object will change directly the behaviour of this Search object.

    Since:
    JChem 5.0
    See Also:
    setSearchOptions(JChemSearchOptions)

    getAbsoluteStereo

    public int getAbsoluteStereo()
    Deprecated. since JChem 5.0. use JChemSearchOptions.getAbsoluteStereo() instead

    Returns the absolute ste