chemaxon.sss.search
Class JChemSearchOptions

java.lang.Object
  extended by chemaxon.sss.search.SearchOptions
      extended by chemaxon.sss.search.JChemSearchOptions
All Implemented Interfaces:
SearchConstants, java.io.Serializable, java.lang.Cloneable

public class JChemSearchOptions
extends SearchOptions
implements java.io.Serializable, SearchConstants, java.lang.Cloneable

Class to encapsulate search parameters used by JChemSearch.

Since:
5.0
Author:
pkovacs, Tamas Csizmazia
See Also:
Serialized Form

Field Summary
 
Fields inherited from class chemaxon.sss.search.SearchOptions
dirty, options, verbose
 
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
 
Constructor Summary
JChemSearchOptions()
           
 
Method Summary
 java.lang.Object clone()
          Makes an identical copy of this SearchObject.
 void clonecopy(SearchOptions other)
          Copies parameters to other.
 int getAbsoluteStereo()
          Returns the absolute stereo matching mode.
 java.lang.String getDescriptorConfig()
          Getter for property descriptorConfig
 java.lang.String getDescriptorName()
          Getter for property descriptorName
 java.lang.String getDissimilarityMetric()
          Getter for property dissimilarityThreshold.
 float getDissimilarityThreshold()
          Getter for property dissimilarityThreshold.
 java.lang.String getFilterQuery()
          Getter for property filterQuery
 MatchCountOptions getMatchCountOptions()
          Getter for MatchCountOptions
 int getMaxResultCount()
          Getter for property maxResultCount.
 long getMaxTime()
          Getter for property maxTime.
 java.lang.String getOption(java.lang.String name)
          Returns search option value in string format.
 boolean isOptimizeQueries()
          Returns whether query should be optimized.
 boolean isReturnsNonHits()
          Indicates if an inverse hit list is to be returned.
 void setAbsoluteStereo(int absoluteStereo)
          Sets the absolute stereo matching mode.
 void setDescriptorConfig(java.lang.String descriptorConfig)
          Sets the configuration used for descriptor dissimilarity search
 void setDescriptorName(java.lang.String descriptorName)
          Sets the name of descriptor used for descriptor similarity search
 void setDissimilarityMetric(java.lang.String dissimilarityMetric)
          Sets the metric to be used during similarity search.
 void setDissimilarityThreshold(float dissimilarityThreshold)
          Setter for property dissimilarityThreshold.
 void setFilterQuery(java.lang.String filterQuery)
          Setter for property filterQuery.
 void setMatchCountOptions(int hitLimitLow, boolean isLowerLimitIncluded, int hitLimitHigh, boolean isHigherLimitIncluded)
          Deprecated. since JChem 5.1 use setMatchCountOptions(MatchCountOptions) instead.
 void setMatchCountOptions(MatchCountOptions matchCountOptions)
          Setter for MatchCountOptions
 void setMatchCountOptions(java.lang.String relation, int hitLimit)
          Deprecated. since JChem 5.1 use setMatchCountOptions(MatchCountOptions) instead.
 void setMaxResultCount(int maxResultCount)
          Setter for property maxResultCount.
 void setMaxTime(long maxTime)
          Setter for property maxTime.
 void setOptimizeQueries(boolean value)
          Sets whether the query molecule should be optimized.
 void setOption(java.lang.String name, java.lang.String value)
          Sets search options.
 void setReturnsNonHits(boolean returnsNonHits)
          Determines if the inverse of the hit set should be returned.
 java.util.ArrayList toList()
           
 
Methods inherited from class chemaxon.sss.search.SearchOptions
addUserComparator, clearChangesInUserComparators, deepCopy, deleteAllUserComparators, deleteUserComparator, getBoolean, getChargeMatching, getCheckSpHyb, getChemTermsFilter, getChemTermsFilterConfig, getDoubleBondStereoMatchingMode, getHCountMatching, getImplicitHMatching, getIsotopeMatching, getOption, getOptions, getRadicalMatching, getSearchType, getStereoModel, getStereoSearchType, getUndefinedRAtom, getUserComparators, getVagueBondLevel, hasChangesInUserComparators, hasUserComparators, isDiastereomerMatching, isDirty, isExactBondMatching, isExactFragment, isExactQueryAtomMatching, isExactStereoMatching, isKeepQueryOrder, isMixSgroupMatching, isOrderSensitiveSearch, isPerfectSearchType, isReactionUnpairedMapMatching, isStereoSearch, isSubgraphSearch, isSuperstructureSearch, isTautomerSearch, isValenceMatching, isVerbose, returnOptionString, setChargeMatching, setCheckSpHyb, setChemTermsFilter, setChemTermsFilterConfig, setDiastereomerMatching, setDirty, setDoubleBondStereoMatchingMode, setExactBondMatching, setExactFragment, setExactQueryAtomMatching, setExactStereoMatching, setHCountMatching, setImplicitHMatching, setIsotopeMatching, setKeepQueryOrder, setMixSgroupMatching, setOption, setOptions, setOptions, setOrderSensitiveSearch, setRadicalMatching, setReactionUnpairedMapMatching, setSearchType, setStereoModel, setStereoSearch, setStereoSearchType, setSubgraphSearch, setSuperstructureSearch, setTautomerSearch, setUndefinedRAtom, setVagueBondLevel, setValenceMatching, setVerbose, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JChemSearchOptions

public JChemSearchOptions()
Method Detail

setAbsoluteStereo

public void setAbsoluteStereo(int absoluteStereo)
Sets the absolute stereo matching mode.

Parameters:
absoluteStereo - the matching mode, one of the following constants: SearchConstants.ABS_STEREO_TABLE_OPTION, SearchConstants.ABS_STEREO_CHIRAL_FLAG, SearchConstants.ABS_STEREO_ALWAYS_ON,

getAbsoluteStereo

public int getAbsoluteStereo()
Returns the absolute stereo matching mode.

See Also:
setAbsoluteStereo(int)

getFilterQuery

public java.lang.String getFilterQuery()
Getter for property filterQuery

Returns:
Value of property filterQuery.

setFilterQuery

public void setFilterQuery(java.lang.String filterQuery)
Setter for property filterQuery. SQL query for filtering. The result should contain the cd_id values. Example:
    searcOptions.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 JChemSearch.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

setDissimilarityThreshold

public void setDissimilarityThreshold(float dissimilarityThreshold)
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.

getDissimilarityThreshold

public float getDissimilarityThreshold()
Getter for property dissimilarityThreshold.

Returns:
Value of property dissimilarityThreshold.

getMaxTime

public long getMaxTime()
Getter for property maxTime.

Returns:
Value of property maxTime.

setMaxTime

public void setMaxTime(long maxTime)
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()
Getter for property maxResultCount.

Returns:
Value of property maxResultCount.

setMaxResultCount

public void setMaxResultCount(int maxResultCount)
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 JChemSearch.setOrder(int) to JChemSearch.ORDERING_BY_ID_OR_SIMILARITY.

Parameters:
maxResultCount - New value of property maxResultCount.

setReturnsNonHits

public void setReturnsNonHits(boolean returnsNonHits)
Determines if the inverse of the hit set should be returned.

Parameters:
returnsNonHits - set to true to get non-hit structures. Default is false.
See Also:
isReturnsNonHits()

isReturnsNonHits

public boolean isReturnsNonHits()
Indicates if an inverse hit list is to be returned.

See Also:
setReturnsNonHits(boolean)

setDissimilarityMetric

public void setDissimilarityMetric(java.lang.String dissimilarityMetric)
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.
See Also:
JChemSearch.getDissimilarityMetrics(chemaxon.util.ConnectionHandler, String), setDissimilarityThreshold(float), getDissimilarityThreshold()

getDissimilarityMetric

public java.lang.String getDissimilarityMetric()
Getter for property dissimilarityThreshold.

Returns:
value of dissimilarityMetric
See Also:
setDissimilarityThreshold(float), getDissimilarityThreshold()

setDescriptorConfig

public void setDescriptorConfig(java.lang.String descriptorConfig)
Sets the configuration used for descriptor dissimilarity search

Parameters:
descriptorConfig - the configuration used for dissimilarity search calculation. Default value: null (means default configuration)
See Also:
getDescriptorConfig(), setDescriptorName(String), getDescriptorName()

getDescriptorConfig

public java.lang.String getDescriptorConfig()
Getter for property descriptorConfig

Returns:
value of property descriptorName
See Also:
setDescriptorConfig(String), setDescriptorName(String), getDescriptorName()

setDescriptorName

public void setDescriptorName(java.lang.String descriptorName)
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
See Also:
getDescriptorName(), setDescriptorConfig(String), getDescriptorConfig()

getDescriptorName

public java.lang.String getDescriptorName()
Getter for property descriptorName

Returns:
value of property descriptorName
See Also:
setDescriptorName(String), setDescriptorConfig(String), getDescriptorConfig()

setMatchCountOptions

public void setMatchCountOptions(MatchCountOptions matchCountOptions)
Setter for MatchCountOptions

Parameters:
matchCountOptions - a predefined MatchCountOptions object
See Also:
getMatchCountOptions()

setMatchCountOptions

public void setMatchCountOptions(int hitLimitLow,
                                 boolean isLowerLimitIncluded,
                                 int hitLimitHigh,
                                 boolean isHigherLimitIncluded)
Deprecated. since JChem 5.1 use setMatchCountOptions(MatchCountOptions) instead.

Sets the MatchCountOptions in between mode

Parameters:
hitLimitLow - The lower limit for the number of hits.
isLowerLimitIncluded - If true, equality is allowed with hitLimitLow.
hitLimitHigh - The upper limit for the number of hits.
isHigherLimitIncluded - isHigherLimitIncluded If true, equality is allowed with hitLimitHigh.
See Also:
MatchCountOptions, setMatchCountOptions(String, int), getMatchCountOptions()

setMatchCountOptions

public void setMatchCountOptions(java.lang.String relation,
                                 int hitLimit)
Deprecated. since JChem 5.1 use setMatchCountOptions(MatchCountOptions) instead.

Sets the MatchCountOptions in relation mode

Parameters:
relation - The relational operation of the question. This operation will be used to compare the number of hits to hitLimit. Available values:
"=" - tests equality to hitLimit.
"<" - returns true if the number of found hits is less than hitLimit.
"<=" - less than or equality
">" - greater than
">=" - greater than or equality
Specifying null disables match count rules.
hitLimit - The limit for the number of hits.
See Also:
MatchCountOptions, setMatchCountOptions(int, boolean, int, boolean), getMatchCountOptions()

getMatchCountOptions

public MatchCountOptions getMatchCountOptions()
Getter for MatchCountOptions

Returns:
the matchCountOptions
See Also:
MatchCountOptions, setMatchCountOptions(String, int), setMatchCountOptions(int, boolean, int, boolean)

isOptimizeQueries

public boolean isOptimizeQueries()
Returns whether query should be optimized. (certain atomlists and bondlists are enumerated)

Returns:
true if the query molecule should be optimized

setOptimizeQueries

public void setOptimizeQueries(boolean value)
Sets whether the query molecule should be optimized. (certain atomlists and bondlists are enumerated)

Parameters:
value - true if the query molecule should be optimized. Default is true.

setOption

public void setOption(java.lang.String name,
                      java.lang.String value)
Sets search options.

Overrides:
setOption in class SearchOptions
Parameters:
name - Name (case insensitive) of search option (e.g. absoluteStereo).
value - String form (case insensitive) of search parameter value (y, T, false...).
In case of boolean parameters 'true' is acceptable instead of 'y' and 'false' instead of 'n'.

Useable search parameters are all the acceptable values of SearchOptions.setOption(String, String) plus the following ones:

  • absoluteStereo
  • expression
  • maxTime
  • maxResults or maxHitCount
  • optimizeQueries
  • dissimilarityThreshold or simThreshold
  • orderSensitive
  • dissimilarityMetric
  • returnNonHits
  • filterQuery
  • descriptorConfig
  • descriptorName
  • matchCountOptions
  • See Also:
    getOption(String), SearchOptions.setOption(String, String)

    getOption

    public java.lang.String getOption(java.lang.String name)
    Returns search option value in string format.

    Overrides:
    getOption in class SearchOptions
    Parameters:
    name - Name (case insensitive) of search option (e.g. stereoSearch).

    Useable search parameters are all the acceptable values of SearchOptions.getOption(String) plus the following ones:

  • absoluteStereo
  • expression
  • maxTime
  • maxResults or maxHitCount
  • optimizeQueries
  • dissimilarityThreshold or simThreshold
  • orderSensitive
  • dissimilarityMetric
  • returnNonHits
  • filterQuery
  • descriptorConfig
  • descriptorName
  • matchCountOptions
  • Returns:
    string value of the given option (true --> y, false --> n)
    See Also:
    setOption(String, String), SearchOptions.getOption(String)

    clone

    public java.lang.Object clone()
                           throws java.lang.CloneNotSupportedException
    Makes an identical copy of this SearchObject.

    Overrides:
    clone in class SearchOptions
    Throws:
    java.lang.CloneNotSupportedException

    clonecopy

    public void clonecopy(SearchOptions other)
    Copies parameters to other. It copies
    - all parameters if other is a JchemSearchOptions object
    - only the parameters defined in SearchOptions if it is a SearchOptions or MolSearchOptions object

    Overrides:
    clonecopy in class SearchOptions

    toList

    public java.util.ArrayList toList()
    Overrides:
    toList in class SearchOptions
    Returns:
    An arraylist that contains strings of format "optionname:optionvalue". Doesn't contain options that have their default value.
    See Also:
    SearchOptions.setOptions(String), SearchOptions.toString()