Package chemaxon.sss.search
Class JChemSearchOptions
java.lang.Object
chemaxon.sss.search.SearchOptions
chemaxon.sss.search.JChemSearchOptions
- All Implemented Interfaces:
SearchConstants
,Serializable
,Cloneable
@PublicApi
public class JChemSearchOptions
extends SearchOptions
implements Serializable, SearchConstants, Cloneable
Class to encapsulate search parameters used by
JChemSearch
.- Since:
- 5.0
- See Also:
-
Field Summary
Fields inherited from class chemaxon.sss.search.SearchOptions
DEFAULT_TIMEOUT_LIMIT, dirty, timeoutLimitMilliseconds, verbose
Fields inherited from interface chemaxon.sss.SearchConstants
ABS_STEREO_ALWAYS_ON, ABS_STEREO_CHIRAL_FLAG, ABS_STEREO_TABLE_OPTION, ATTACHED_DATA_MATCH_EXACT, ATTACHED_DATA_MATCH_GENERAL, ATTACHED_DATA_MATCH_IGNORE, ATTACHMENT_ATOM, ATTACHMENT_LABEL, ATTACHMENT_MAP, ATTACHMENT_NONE, ATTACHMENT_POINT, ATTACHMENT_RLABEL, CHARGE_MATCHING_DEFAULT, CHARGE_MATCHING_EXACT, CHARGE_MATCHING_IGNORE, DEFAULT_DISSIMILARITY_THRESHOLD, DEFAULT_SEARCHTYPE, DISSIMILARITY_PROPERTY_NAME, DUPLICATE, FULL, FULL_FRAGMENT, HCOUNT_MATCHING_AUTO, HCOUNT_MATCHING_EQUAL, HCOUNT_MATCHING_GREATER_OR_EQUAL, HIT_EXCLUDEDQ, HIT_LP, HIT_MULTICENTER, HIT_NON_R, HIT_ORDERING_NONE, HIT_ORDERING_UNDEF_R_MATCHING_GROUP_FIRST, HIT_R, HIT_R_EMPTY_MATCH, HIT_UNMAPABLE, IMPLICIT_H_MATCHING_DEFAULT, IMPLICIT_H_MATCHING_DISABLED, IMPLICIT_H_MATCHING_ENABLED, IMPLICIT_H_MATCHING_IGNORE, ISOTOPE_MATCHING_DEFAULT, ISOTOPE_MATCHING_EXACT, ISOTOPE_MATCHING_IGNORE, MARKUSH_HIT_INNER, MARKUSH_HIT_ORIGINAL, MATCH_COUNT_BETWEEN, MATCH_COUNT_RELATION, NO_ABAS, NO_SCREEN, POSITION_ON_0TH_HEAVY_ATOM, RADICAL_MATCHING_DEFAULT, RADICAL_MATCHING_EXACT, RADICAL_MATCHING_IGNORE, SEARCH_MODE_NAMES, SEARCH_TYPE_NAMES, SIMILARITY, STEREO_DIASTEREOMER, STEREO_ENANTIOMER, STEREO_EXACT, STEREO_IGNORE, STEREO_MODEL_COMPREHENSIVE, STEREO_MODEL_DEFAULT, STEREO_MODEL_GLOBAL, STEREO_MODEL_LOCAL, STEREO_SPECIFIC, SUBSTRUCTURE, SUPERSTRUCTURE, TAUTOMER_SEARCH_DEFAULT, TAUTOMER_SEARCH_OFF, TAUTOMER_SEARCH_ON, TAUTOMER_SEARCH_ON_IGNORE_TAUTOMERSTEREO, UNDEF_R_MATCHING_ALL, UNDEF_R_MATCHING_GROUP, UNDEF_R_MATCHING_GROUP_H, UNDEF_R_MATCHING_GROUP_H_EMPTY, UNDEF_R_MATCHING_UNDEF_R, VAGUE_BOND_DEFAULT, VAGUE_BOND_LEVEL_HALF, VAGUE_BOND_LEVEL1, VAGUE_BOND_LEVEL2, VAGUE_BOND_LEVEL3, VAGUE_BOND_LEVEL4, VAGUE_BOND_OFF
-
Constructor Summary
ConstructorDescriptionJChemSearchOptions
(int searchType) Creates a JChemSearchOptions object while setting different search options according to a predefined search type. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Makes an identical copy of this SearchObject.void
clonecopy
(SearchOptions other) Copies parameters toother
.void
clonecopyOptions
(SearchOptions other) Copies all search options except search type to other.int
Get the absolute stereo matching mode.Get the screening configuration string used for descriptor dissimilarity search.Get the name of descriptor used for descriptor similarity searchGet the property dissimilarity metric property.Get the parameters of the dissimilarity metric.float
Get the dissimilarity threshold.Get the filter query property.Get the query set for formula search.int
Gets the type set for formula search.Get the current error handling behaviour option.boolean
getMarkushScreeningType
(chemaxon.sss.search.options.MarkushScreeningType type) Internal use only!
Gets whether a given Markush screening is enabled or disabledGet the match count options.int
Get the maximum result count.int
The search on a single target timeouts reaching this amount of time.final int
The total search on a database table timeouts reaching this amount of time.boolean
Only for internal use!boolean
Get the dissimilarity threshold exclusion option.boolean
Gets whether screening methods are used for Markush search before ABAS step.boolean
Get whether query should be optimized.boolean
Indicates if an inverse hit list is to be returned.void
setAbsoluteStereo
(int absoluteStereo) Sets the absolute stereo matching mode.void
setCacheRegistrationNeeded
(boolean value) Only for internal use!void
setDescriptorConfig
(String descriptorConfig) Sets the screening configuration string used for descriptor dissimilarity search.void
setDescriptorName
(String descriptorName) Sets the name of descriptor used for descriptor similarity searchvoid
setDissimilarityMetric
(String dissimilarityMetric) Sets the metric to be used during similarity search.void
setDissimilarityMetricParameters
(String dissimilarityMetricParam) Sets the parameters of dissimilarity metric to be used during similarity search.void
setDissimilarityThreshold
(float dissimilarityThreshold) Setter for property dissimilarityThreshold.void
setDissimilarityThresholdExcluded
(boolean thresholdExcluded) Setter for property dissimilarityThresholdExcluded.void
setFilterQuery
(String filterQuery) Setter for property filterQuery.void
setFormulaSearchQuery
(String formulaSearchQuery) Sets the query for the formula search.void
setFormulaSearchType
(int formulaSearchType) Sets the type for the formula search.void
setHaltOnError
(HaltOnErrorOption value) Set whether search should stop at first error or log the error and continue search if possible.void
setMarkushScreeningEnabled
(boolean value) Set whether to use screening for Markush search before ABAS step.void
setMarkushScreeningType
(chemaxon.sss.search.options.MarkushScreeningType type, boolean enabled) Internal use only!
Sets the use of a given Markush screening options.void
setMarkushScreeningTypes
(String types) Internal use only!
Enables all Markush screening options represented by the given option string.void
setMatchCountOptions
(MatchCountOptions matchCountOptions) Setter for MatchCountOptionsvoid
setMaxResultCount
(int maxResultCount) Sets the maximum number of molecules returned by the search.void
setOptimizeQueries
(boolean value) Sets whether the query molecule should be optimized.void
setReturnsNonHits
(boolean returnsNonHits) Determines if the inverse of the hit set should be returned.void
setTotalSearchTimeoutLimitMilliseconds
(int value) The total search on a database timeouts reaching this amount of time.toList()
Returns the text representation of this options object as a list of "optionname:optionvalue" strings.Methods inherited from class chemaxon.sss.search.SearchOptions
addUserComparator, areMonomersTransformed, clearChangesInUserComparators, deleteAllUserComparators, deleteUserComparator, getAllOptionsAsString, getAllOptionsAsString, getAttachedDataMatch, getAttachedDataPrefixes, getBoolean, getChargeMatching, getCheckSpHyb, getChemTermsFilter, getChemTermsFilterConfig, getChemTermsFilterOption, getCompleteHG, getDoubleBondStereoMatchingMode, getExactSpecialAtomMatching, getExhaustiveModeLimit, getHCountMatching, getHitOrdering, getHomologyBroadTranslation, getHomologyNarrowTranslation, getImplicitHMatching, getIsotopeMatching, getMarkushAromHandling, getOption, getOptionNames, getRadicalMatching, getRLigandEqualityCheck, getSearchType, getSearchType, getSSRType, getStereoModel, getStereoSearchType, getTargetHomologyMatchingMode, getTautomerSearch, getUndefinedRAtom, getUserComparators, getVagueBondLevel, hasChangesInUserComparators, hasUserComparators, isBridgingRAllowed, isCopolymerMatching, isDirty, isEndgroupMatching, isExactBondMatching, isExactQueryAtomMatching, isIgnoreAxialStereo, isIgnoreCumuleneOrRingCisTransStereo, isIgnoreDoubleBondStereo, isIgnoreSynAntiStereo, isIgnoreTetrahedralStereo, isKeepQueryOrder, isMixSgroupMatching, isOrderSensitiveSearch, isPhaseShiftedMatching, isPolymerMatching, isReactionUnpairedMapMatching, isThrowExceptionOnTimeout, isUndefinedRAtomMatchingGroup, isValenceMatching, isVerbose, nonPositiveToInfinite, returnOptionString, setAttachedDataMatch, setAttachedDataPrefixes, setBridgingRAllowed, setChargeMatching, setCheckSpHyb, setChemTermsFilter, setChemTermsFilterConfig, setChemTermsFilterConfig, setChemTermsFilterOption, setCompleteHG, setCopolymerMatching, setDirty, setDoubleBondStereoMatchingMode, setEndgroupMatching, setExactBondMatching, setExactQueryAtomMatching, setExactSpecialAtomMatching, setExhaustiveModeLimit, setHCountMatching, setHitOrdering, setHomologyBroadTranslation, setHomologyNarrowTranslation, setIgnoreAxialStereo, setIgnoreCumuleneOrRingCisTransStereo, setIgnoreDoubleBondStereo, setIgnoreSynAntiStereo, setIgnoreTetrahedralStereo, setImplicitHMatching, setIsotopeMatching, setKeepQueryOrder, setMarkushAromHandling, setMixSgroupMatching, setMonomerTransform, setOption, setOptions, setOrderSensitiveSearch, setPhaseShiftedMatching, setPolymerMatching, setRadicalMatching, setReactionUnpairedMapMatching, setRLigandEqualityCheck, setSSRType, setStereoModel, setStereoSearchType, setTargetHomologyMatchingMode, setTautomerSearch, setThrowExceptionOnTimeout, setTimeoutLimitMilliseconds, setUndefinedRAtom, setUndefinedRAtomUserDefined, setVagueBondLevel, setValenceMatching, setVerbose, toString, toString
-
Constructor Details
-
JChemSearchOptions
public JChemSearchOptions(int searchType) Creates a JChemSearchOptions object while setting 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 features allowed),SearchConstants.SIMILARITY
,SearchConstants.FULL
,SearchConstants.DUPLICATE
andSearchConstants.FULL_FRAGMENT
.- Parameters:
searchType
- the predefined search type
-
-
Method Details
-
setAbsoluteStereo
public void setAbsoluteStereo(int absoluteStereo) Sets the absolute stereo matching mode.- Parameters:
absoluteStereo
- absolute stereo matching mode
Default value isSearchConstants.ABS_STEREO_TABLE_OPTION
.- See Also:
-
getAbsoluteStereo
public int getAbsoluteStereo()Get the absolute stereo matching mode.- Returns:
- selected absolute stereo matching mode.
Default value isSearchConstants.ABS_STEREO_TABLE_OPTION
. - See Also:
-
setFormulaSearchType
public void setFormulaSearchType(int formulaSearchType) Sets the type for the formula search.- Parameters:
formulaSearchType
- Formula search type.
Default value isFormulaSearch.NONE
.- See Also:
-
getFormulaSearchType
public int getFormulaSearchType()Gets the type set for formula search.- Returns:
- formula search type.
Default value isFormulaSearch.NONE
. - See Also:
-
setFormulaSearchQuery
Sets the query for the formula search.- Parameters:
formulaSearchQuery
- Formula search query. E.g. "C6-8 H-20 N1"
Default value isnull
.- See Also:
-
getFormulaSearchQuery
Get the query set for formula search.- Returns:
- the chemical formula set for the query.
Default value isnull
. - See Also:
-
getFilterQuery
Get the filter query property.- Returns:
- Value of property filterQuery.
Default value isnull
. - See Also:
-
setFilterQuery
Setter for property filterQuery. SQL query for filtering. The result should contain the cd_id values. Example:searchOptions.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 forJChemSearch.setOrder(int)
will be ignored, except when aninverse 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.
Default value isnull
.- Since:
- JChem 2.3
- See Also:
-
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.- Parameters:
dissimilarityThreshold
- value of the dissimilarity threshold.
Default value is0.3
.- See Also:
-
getDissimilarityThreshold
public float getDissimilarityThreshold()Get the dissimilarity threshold.- Returns:
- Value of property dissimilarityThreshold.
Default value is0.3
. - See Also:
-
setDissimilarityThresholdExcluded
public void setDissimilarityThresholdExcluded(boolean thresholdExcluded) Setter for property dissimilarityThresholdExcluded. Determines whether dissimilarity values equaling the threshold value are considered hits or not.- Parameters:
thresholdExcluded
- Iftrue
, only dissimilarity values less than the threshold value are considered hits. Iffalse
, dissimilarity values equaling the threshold value are also considered hits. (Defaults tofalse
.)
Default value isfalse
.- See Also:
-
isDissimilarityThresholdExcluded
public boolean isDissimilarityThresholdExcluded()Get the dissimilarity threshold exclusion option.- Returns:
- the value of the dissimilarity threshold exclusion.
Default value isfalse
. - See Also:
-
getMaxResultCount
public int getMaxResultCount()Get the maximum result count.- Returns:
- number of maximum results.
Default value is0
. - See Also:
-
setMaxResultCount
Sets the maximum number of molecules returned by the search. If the given parameter is 0, then there is no limit.NOTE:
- In case of non-similarity search, the search process will be stopped when the maximum result count is reached. This can save time when there would be too many results.
- In case of similarity searches, the full search is performed and the
maxResultCount
most similar results will be given back. In this case this option does not mean speedup.
- Parameters:
maxResultCount
- New value of property maxResultCount. Default value is0
, i.e. there is no limit.- Throws:
IllegalArgumentException
- if maxResultCount was negative number.- See Also:
-
setReturnsNonHits
public void setReturnsNonHits(boolean returnsNonHits) Determines if the inverse of the hit set should be returned.- Parameters:
returnsNonHits
- set totrue
to get non-hit structures. Default isfalse
.
Default value isfalse
.- See Also:
-
isReturnsNonHits
public boolean isReturnsNonHits()Indicates if an inverse hit list is to be returned.- Returns:
true
if inverse hit list it to be returned.
Default value isfalse
.- See Also:
-
setDissimilarityMetric
Sets the metric to be used during similarity search.- Parameters:
dissimilarityMetric
- the name of the metric to be used. Specifynull
for the default metric. For reaction tables seeReactionFingerprint
. For molecule and any tables the default metrics can be replaced by the metrics described inSimilarityCalculatorFactory.create(String)
.
Default value isnull
.- See Also:
-
getDissimilarityMetric
Get the property dissimilarity metric property.- Returns:
- value of dissimilarityMetric
Default value isnull
. - See Also:
-
setDissimilarityMetricParameters
Sets the parameters of dissimilarity metric to be used during similarity search.- Parameters:
dissimilarityMetricParam
- parameters of the dissimilarity metric e.g. for Tversky: "0.3,0.7" or equivalenly: "queryWeight=0.3,targetWeight=0.7" Specify empty string for no parameters or default parameter.For molecule and any tables the available metrics are the ones described in
SimilarityCalculatorFactory.create(String)
.
Default value isnull
.- See Also:
-
getDissimilarityMetricParameters
Get the parameters of the dissimilarity metric.- Returns:
- dissimilarity metric parameters
Default value isnull
. - See Also:
-
setDescriptorConfig
Sets the screening configuration string used for descriptor dissimilarity search.- Parameters:
descriptorConfig
- the configuration string used for dissimilarity search calculation. Default value: null (means default configuration)
Default value isnull
.- See Also:
-
getDescriptorConfig
Get the screening configuration string used for descriptor dissimilarity search.- Returns:
- the screening configuration string
Default value isnull
. - See Also:
-
setDescriptorName
Sets the name of descriptor used for descriptor similarity search- Parameters:
descriptorName
- the descriptor identifier used for similarity search. If not specified ornull
, structural fingerprint similarity search performed by default.
Default value isnull
.- Since:
- JChem 2.0
- See Also:
-
getDescriptorName
Get the name of descriptor used for descriptor similarity search- Returns:
- the name of the descriptor
Default value isnull
. - See Also:
-
setMatchCountOptions
Setter for MatchCountOptions- Parameters:
matchCountOptions
- a predefinedMatchCountOptions
object- See Also:
-
getMatchCountOptions
Get the match count options.- Returns:
- the matchCountOptions
- See Also:
-
isOptimizeQueries
public boolean isOptimizeQueries()Get whether query should be optimized. (Certain atomlists and bondlists are enumerated.)- Returns:
true
if the query molecule should be optimized
Default value istrue
.- See Also:
-
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 value istrue
.- See Also:
-
setCacheRegistrationNeeded
public void setCacheRegistrationNeeded(boolean value) Only for internal use!- Parameters:
value
- new value for cacheRegistration
-
isCacheRegistrationNeeded
public boolean isCacheRegistrationNeeded()Only for internal use!- Returns:
- current value
-
setMarkushScreeningEnabled
public void setMarkushScreeningEnabled(boolean value) Set whether to use screening for Markush search before ABAS step. If set totrue
all known screening methods are enabled, if set tofalse
all known screening methods are disabled.
By default all known Markush screening methods are enabled.- Parameters:
value
- markush screening should be used or not.
Default value istrue
.- See Also:
-
isMarkushScreeningEnabled()
setMarkushScreeningType(MarkushScreeningType, boolean)
MarkushScreeningType
-
isMarkushScreeningEnabled
public boolean isMarkushScreeningEnabled()Gets whether screening methods are used for Markush search before ABAS step.- Returns:
true
if screening is used,false
otherwise.- See Also:
-
setMarkushScreeningType
public void setMarkushScreeningType(chemaxon.sss.search.options.MarkushScreeningType type, boolean enabled) Internal use only!
Sets the use of a given Markush screening options. Enables or disables its usage while performing Markush table searches- Parameters:
type
- Markush screening option enabled or disabledenabled
-true
to enable screening option,false
to disable screening option- See Also:
-
setMarkushScreeningEnabled(boolean)
getMarkushScreeningType(MarkushScreeningType)
MarkushScreeningType
-
setMarkushScreeningTypes
Internal use only!
Enables all Markush screening options represented by the given option string.- Parameters:
types
- Markush screening options to enable separated by a comma. If null (default), all screening options are enabled. If empty string, no methods are enabled.
-
getMarkushScreeningType
public boolean getMarkushScreeningType(chemaxon.sss.search.options.MarkushScreeningType type) Internal use only!
Gets whether a given Markush screening is enabled or disabled- Parameters:
type
- Markush screening option to check- Returns:
true
if screening is enabled,false
if screening method is disabled- See Also:
-
getMarkushScreeningType(MarkushScreeningType)
MarkushScreeningType
-
setHaltOnError
Set whether search should stop at first error or log the error and continue search if possible.- Parameters:
value
- stop at first error or not.
Default value isHaltOnErrorOption.DEFAULT
- See Also:
-
getHaltOnError
Get the current error handling behaviour option.- Returns:
- the option set for error handling behaviour
- See Also:
-
clone
Makes an identical copy of this SearchObject.- Overrides:
clone
in classSearchOptions
- Throws:
CloneNotSupportedException
-
clonecopy
Copies parameters toother
. It copies
- all parameters ifother
is a JchemSearchOptions object
- only the parameters defined in SearchOptions if it is a SearchOptions or MolSearchOptions object- Overrides:
clonecopy
in classSearchOptions
- Parameters:
other
- search option to overwrite.
-
clonecopyOptions
Description copied from class:SearchOptions
Copies all search options except search type to other.- Overrides:
clonecopyOptions
in classSearchOptions
- Parameters:
other
- search option object to overwrite
-
getTimeoutLimitMilliseconds
public int getTimeoutLimitMilliseconds()The search on a single target timeouts reaching this amount of time. If the total timeout limit is less than the single search timeout limit, this function returns with the total timeout limit.- Overrides:
getTimeoutLimitMilliseconds
in classSearchOptions
- Returns:
- The timeout limit in milliseconds.
Default value is 120000 - See Also:
-
getTotalSearchTimeoutLimitMilliseconds
public final int getTotalSearchTimeoutLimitMilliseconds()The total search on a database table timeouts reaching this amount of time.- Returns:
- The timeout limit in milliseconds.
- See Also:
-
setTotalSearchTimeoutLimitMilliseconds
public void setTotalSearchTimeoutLimitMilliseconds(int value) The total search on a database timeouts reaching this amount of time. Set it to a negative value if you do not want to the search time out. Note: ifSearchOptions.setTimeoutLimitMilliseconds(int)
is set the search still can time out.
If the search is running in asynchronous mode,JChemSearch.isRunning()
must be constantly called within the specified time interval, otherwise the search stops. Useful if the user no longer monitors the search process, e.g. closes the browser window. It also means that in asynchronous mode ifJChemSearch.isRunning()
is called constantly, then the search will not be stopped even ifsetTotalSearchTimeoutLimitMilliseconds(int)
is set. The time limit is calcualated from the last call ofJChemSearch.isRunning()
.- Parameters:
value
- The time limit to set in milliseconds. Negative values are treated asInteger.MAX_VALUE
.- See Also:
-
toList
Description copied from class:SearchOptions
Returns the text representation of this options object as a list of "optionname:optionvalue" strings. Only those options are listed that have non-default values.- Overrides:
toList
in classSearchOptions
- Returns:
- a list containing the non-default options as "optionname:optionvalue" pairs
-