|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.util.ErrorHandler
chemaxon.jchem.db.JChemSearch
public class JChemSearch
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();
| 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 |
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 |
| 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 |
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 getSearchOptions()SearchOptionsJChemSearchOptions |
int |
getOrder()
Getter for property order. |
java.lang.String |
getProgressMessage()
Getter for property progressMessage. |
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 |
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 |
isExactQueryAtomMatching()
Deprecated. since JChem 5.0. use SearchOptions.isExactQueryAtomMatching() 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()
Deprecated. since JChem 5.2 use run() |
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 |
setConnectionHandler(ConnectionHandler connectionHandler)
Sets the database connection. |
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 |
setExactQueryAtomMatching(boolean exactQueryAtomMatching)
Deprecated. since JChem 5.0. use SearchOptions.setExactQueryAtomMatching(boolean) 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 |
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 typically an integration environment. |
void |
setMatchCountBetween(int hitLimitLow,
boolean isLowerLimitIncluded,
int hitLimitHigh,
boolean isHigherLimitIncluded)
Deprecated. since JChem 5.0 use JChemSearchOptions.setMatchCountOptions(MatchCountOptions) instead |
void |
setMatchCountInRelation(java.lang.String relation,
int hitLimit)
Deprecated. since JChem 5.0 use JChemSearchOptions.setMatchCountOptions(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 getSearchOptions()SearchOptionsJChemSearchOptions |
void |
setOrder(int order)
Setter for property order. |
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 |
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()
Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE. |
| 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 |
|---|
public static final int NO_RESULT_TABLE
public static final int CREATE_OR_REPLACE_RESULT_TABLE
public static final int APPEND_TO_RESULT_TABLE
public static final int NO_ORDERING
public static final int ORDERING_BY_ID
cd_id values (Value=1)
public static final int ORDERING_BY_ID_OR_SIMILARITY
cd_id values otherwise (Value=2)
public static final int ORDERING_BY_FILTER_ID_LIST
filterIDList
public static int RUN_MODE_SYNCH_COMPLETE
run() or setRunning(boolean)
return only after all hits has been found. (Corresponds to calling
setWaitingForResult(boolean) with true.)
public static int RUN_MODE_ASYNCH_COMPLETE
run() or
setRunning(boolean) return immediately. (Corresponds to calling
setWaitingForResult(boolean) with false)
public static int RUN_MODE_ASYNCH_PROGRESSIVE
run() or
setRunning(boolean) return immediately. The methods
hasMoreHits(), getNextHit() and
getAvailableNewHits(int) can be used retrieve hits as soon as
they become available. setSearchType(int)),
setReturnsNonHits(boolean))
NO_ORDERING (setOrder(int)).
| Constructor Detail |
|---|
public JChemSearch()
public JChemSearch(java.lang.String indexedTable,
java.lang.String indexedColumn)
| Method Detail |
|---|
public java.lang.String getQueryStructure()
public void setQueryStructure(java.lang.String queryStructure)
null or
empty string, then the search returns all molecules.NOTE for Daylight formats:
If search type is SearchConstants.DUPLICATE, SearchConstants.SUPERSTRUCTURE or
SearchConstants.SIMILARITY, treats SMILES/SMARTS input strings as
SMILES, otherwise as SMARTS.
queryStructure - New value of property queryStructure.public void setQueryStructure(Molecule queryMol)
null, then the search returns
all molecules.
queryMol - the query structure.public java.lang.String getStructureTable()
public void setStructureTable(java.lang.String structureTable)
structureTable - New value of property structureTable.public int getSearchType()
SearchOptions.getSearchType() instead
public void setSearchType(int searchType)
SearchOptions.setSearchType(int) instead
SearchConstants.NO_SCREEN,
SearchConstants.NO_ABAS,
SearchConstants.SUBSTRUCTURE
(default),
SearchConstants.SUPERSTRUCTURE
(no query fetures allowed),
SearchConstants.SIMILARITY,
SearchConstants.FULL,
SearchConstants.FULL_FRAGMENT and
SearchConstants.DUPLICATE.
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:
SearchOptions.setChargeMatching(int)SearchOptions.setIsotopeMatching(int)setExactQueryAtomMatching(boolean) SearchOptions.setRadicalMatching(int) setExactStereoMatching(boolean) setStereoSearch(boolean)
searchType - New value of property searchType.
public void setOption(int option,
int value)
getSearchOptions()SearchOptionsJChemSearchOptions
option - Option identifier to be set.value - Value of option to be set.
SearchConstants.OPTION_KEEP_QUERY_ORDERSearchConstants.OPTION_EXACT_FRAGMENTSearchConstants.OPTION_TAUTOMER_SEARCHSearchConstants.OPTION_ISOTOPE_MATCHINGSearchConstants.OPTION_CHARGE_MATCHINGSearchConstants.OPTION_VALENCE_MATCHINGSearchConstants.OPTION_RADICAL_MATCHINGSearchConstants.OPTION_VAGUE_BONDSearchConstants.OPTION_MIX_SGROUP_MATCHINGSearchConstants.OPTION_STEREO_MODELpublic int getOption(int option)
getSearchOptions()SearchOptionsJChemSearchOptions
option - Option identifier.
SearchConstants.OPTION_KEEP_QUERY_ORDERSearchConstants.OPTION_EXACT_FRAGMENTSearchConstants.OPTION_TAUTOMER_SEARCHSearchConstants.OPTION_ISOTOPE_MATCHINGSearchConstants.OPTION_CHARGE_MATCHINGSearchConstants.OPTION_VALENCE_MATCHINGSearchConstants.OPTION_RADICAL_MATCHINGSearchConstants.OPTION_VAGUE_BONDSearchConstants.OPTION_MIX_SGROUP_MATCHINGSearchConstants.OPTION_STEREO_MODELpublic java.lang.Throwable getException()
getException in class ErrorHandlerpublic java.lang.String getCacheError()
null in case of normal execution.public java.util.Hashtable getCachedTables()
public long getMaxTime()
JChemSearchOptions.getMaxTime() instead
public void setMaxTime(long maxTime)
JChemSearchOptions.setMaxTime(long) instead
maxTime is 0, then there is no limit.
(Default: 0)
maxTime - New value of property maxTime.public int getMaxResultCount()
JChemSearchOptions.getMaxResultCount() instead
public void setMaxResultCount(int maxResultCount)
JChemSearchOptions.setMaxResultCount(int) instead
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.
maxResultCount - New value of property maxResultCount.public java.lang.String getFilterQuery()
JChemSearchOptions.getFilterQuery() instead
public void setFilterQuery(java.lang.String filterQuery)
JChemSearchOptions.setFilterQuery(String)
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.
filterQuery - New value of property filterQuery.public void setFilterIDList(int[] ids)
ids - the cd_id values in an arraypublic void setFilterIDNotList(int[] ids)
ids - the cd_id values in an arraypublic float getDissimilarityThreshold()
JChemSearchOptions.getDissimilarityThreshold() instead
public void setDissimilarityThreshold(float dissimilarityThreshold)
JChemSearchOptions.setDissimilarityThreshold(float) instead
dissimilarityThreshold - New value of property dissimilarityThreshold.public void setDissimilarityMetric(java.lang.String dissimilarityMetric)
JChemSearchOptions.setDissimilarityMetric(String) instead
dissimilarityMetric - the name of the metric to be used.
Specify null for the default metric.getDissimilarityMetrics(chemaxon.util.ConnectionHandler, String)
public static JChemSearch.DissimilarityMetrics getDissimilarityMetrics(ConnectionHandler ch,
java.lang.String tableName)
throws java.sql.SQLException
ch - ConnaectionHandler with live connectiontableName - the name of the JChem structure table
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)public void setDescriptorName(java.lang.String descriptorName)
JChemSearchOptions.setDescriptorName(String) instead
descriptorName - the descriptor identifier used for similatiry
search. If not specified or null, structural fingerprint
similarity search performed by default.public void setDescriptorConfig(java.lang.String descriptorConfig)
JChemSearchOptions.setDescriptorConfig(String) instead
descriptorConfig - the configuration used for dissimilarity search
calculation. Default value: null (means default configuration)public boolean isStructureCaching()
public boolean isInfoToStdError()
public void setInfoToStdError(boolean infoToStdError)
false)
infoToStdError - New value of property infoToStdError.public ConnectionHandler getConnectionHandler()
public void setConnectionHandler(ConnectionHandler connectionHandler)
connectionHandler - a ConnectionHandler object conaining a live connection
to the databasepublic java.sql.Connection getConnection()
public boolean isWaitingForResult()
getRunMode().
public void setWaitingForResult(boolean waitingForResult)
setRunMode(int).
run() (or its alternative)
returns immediately.
(Default: false)
waitingForResult - New value of property waitingForResult.public int getRunMode()
setRunMode(int)public void setRunMode(int runMode)
RUN_MODE_SYNCH_COMPLETE (corresponds to calling
setWaitingForResult(boolean) with true),
RUN_MODE_ASYNCH_COMPLETE (corresponds to calling
setWaitingForResult(boolean) with false),
RUN_MODE_ASYNCH_PROGRESSIVE
RUN_MODE_SYNCH_COMPLETE
runMode - public void setReturnsNonHits(boolean value)
JChemSearchOptions.setReturnsNonHits(boolean) instead
value - set to true to get non-hit structures. Default
is false.public void setSearchOptions(JChemSearchOptions options)
options - search options. Will be copied, modification of the
original object does not affect future searches unless
this method is called again.getSearchOptions()public JChemSearchOptions getSearchOptions()
setSearchOptions(JChemSearchOptions)public int getAbsoluteStereo()
JChemSearchOptions.getAbsoluteStereo() instead
setAbsoluteStereo(int)public void setAbsoluteStereo(int absoluteStereo)
JChemSearchOptions.setAbsoluteStereo(int) instead
absoluteStereo - the matching mode, one of the following constants:
SearchConstants.ABS_STEREO_TABLE_OPTION,
SearchConstants.ABS_STEREO_CHIRAL_FLAG,
SearchConstants.ABS_STEREO_ALWAYS_ON,public int getOrder()
public void setOrder(int order)
order - New value of property order.
Acceptable values:
NO_ORDERING,
ORDERING_BY_ID, and
ORDERING_BY_ID_OR_SIMILARITY
(default).
If an "ORDER BY" clause is used in
filter query, and no
inverse hit list is requested,
this setting is ignored, and the "ORDER BY" clause takes precedence.
public java.lang.String getResultTable()
public void setResultTable(java.lang.String resultTable)
cd_id
of hits. In the case of searching similar structures, the similarity
value is also stored in column similarity.
resultTable - New value of property resultTable.setResultTableMode,
getResultpublic int getResultTableMode()
public void setResultTableMode(int resultTableMode)
NO_RESULT_TABLE
Don't store the results in a table. (Value=0)
CREATE_OR_REPLACE_RESULT_TABLE
Create a result table. If a table with the same name exists,
replace it with the new one. (Value=1)
APPEND_TO_RESULT_TABLE
Append to an existing result table. Create a new one if it
doesn't exist (Value=2)
NO_RESULT_TABLE)
resultTableMode - New value of property resultTableMode.setResultTablepublic void setExactStereoMatching(boolean exactStereoMatching)
SearchOptions.setExactStereoMatching(boolean) instead
exactStereoMatching - if set to true,
stereo information must match
exactly. For example "cis or unspecified" matches only
"cis or unspecified", but matches neither "cis", "trans" or
"unspecified". The same is true for chirality.
Default value is falsepublic boolean isExactStereoMatching()
SearchOptions.isExactStereoMatching() instead
falsepublic void setExactQueryAtomMatching(boolean exactQueryAtomMatching)
SearchOptions.setExactQueryAtomMatching(boolean) instead
isExactQueryAtomMatching()public void setStereoSearch(boolean stereoSearch)
SearchOptions.setStereoSearch(boolean) instead
stereoSearch - If set to false,
no stereo information is
considered during searching.(Default: true)public boolean isStereoSearch()
SearchOptions.isStereoSearch() instead
true, is stereo features are considered during
the search.public boolean isExactQueryAtomMatching()
SearchOptions.isExactQueryAtomMatching() instead
public void setHCountMatching(int HCountMatching)
SearchOptions.setHCountMatching(int) instead
HCountMatching - possible values:SearchConstants.HCOUNT_MATCHING_AUTO,
SearchConstants.HCOUNT_MATCHING_EQUAL,
SearchConstants.HCOUNT_MATCHING_GREATER_OR_EQUALpublic int getHCountMatching()
SearchOptions.getHCountMatching() instead
setHCountMatching(int)public void setDoubleBondStereoMatchingMode(int mode)
SearchOptions.setDoubleBondStereoMatchingMode(int) instead
mode - The following options can be used:
chemaxon.struc.StereoConstants.DBS_NONE:
No double bond cis/trans is considered.
chemaxon.struc.StereoConstants.DBS_MARKED:
(Default) Double bond cis/trans stereo is checked for double bonds designated by the
stereo search flag only.
chemaxon.struc.StereoConstants.DBS_ALL: All
double bonds are checked for cis/trans stereo matching.
public int getDoubleBondStereoMatchingMode()
SearchOptions.getDoubleBondStereoMatchingMode() instead
setDoubleBondStereoMatchingMode(int)public void setFilter(java.lang.String filterExpression)
SearchOptions.setChemTermsFilter(String) instead.
filterExpression - the filtering expressionMolSearch.setFilter(java.lang.String)public java.lang.String getFilter()
SearchOptions.getChemTermsFilter() instead.
MolSearch.setFilter(java.lang.String)public void setFilterConfigFileName(java.lang.String fileName)
SearchOptions.setChemTermsFilterConfig(String) instead,
using the content of the file as parameter.
fileName - the name of the configuration file. Set to
null for default configuration.setFilter(String),
MolSearch.setFilterConfig(java.io.File)public java.lang.String getFilterConfigFileName()
SearchOptions.getChemTermsFilterConfig() instead.
MolSearch.setFilterConfig(java.io.File)
public void setMatchCountInRelation(java.lang.String relation,
int hitLimit)
JChemSearchOptions.setMatchCountOptions(MatchCountOptions) instead
relation - The relational operation of the question. This
operation will be used to compare the number of hits to
hitLimit. Available values:
hitLimit.
hitLimit.
null disables match count rules.hitLimit - The limit for the number of hits.Search.isMatchCountInRelation(String, int),
setMatchCountBetween(int, boolean, int, boolean)
public void setMatchCountBetween(int hitLimitLow,
boolean isLowerLimitIncluded,
int hitLimitHigh,
boolean isHigherLimitIncluded)
JChemSearchOptions.setMatchCountOptions(MatchCountOptions) instead
Example:
isMatchCountBetween(2, true, 4, true) - true if the query can be found in the target exactly 2, 3 or 4 times.
isMatchCountBetween(2, false, 4, false) - true if the query can be found in the target exactly 3 times.
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.
If you pass Integer.MAX_VALUE, it will be treated as infinity.
(I.e. only the lower limit is applied.)isHigherLimitIncluded - If true, equality is allowed with hitLimitHigh.Search.isMatchCountBetween(int, boolean, int, boolean),
setMatchCountInRelation(String, int)public void setTautomerSearch(boolean value)
SearchOptions.setTautomerSearch(boolean) instead
value - set to true to enable enumeration of
the tautomers of the query for search.
The default is false.public boolean getTautomerSearch()
SearchOptions.isTautomerSearch() instead
setTautomerSearch(boolean)public void setVagueBondLevel(int level)
SearchOptions.setVagueBondLevel(int)
instead
level - the desired level. See
SearchConstants.OPTION_VAGUE_BONDpublic int getVagueBondLevel()
SearchOptions.getVagueBondLevel()
instead
setVagueBondLevel(int)public void setMaxCacheSize(int maxCacheSizeMB)
minFreeMem is not set to 0,
the program tries to determine the maximum amount of memory available
for allocation by calling the garbage collector and determinig the
available memory.
maxCacheSizeMB - the maximum amount of memory the cache allowed to
utitlize in megabytes.
Set -1 for auto-detection (default):
maxCacheSize = available_memory - minFreeMemsetMinNonCachedMemory(int)public void setMinNonCachedMemory(int minNonCachedMemoryMB)
maxCacheSize is set
to -1 (auto-detect),
the program tries to determine the maximum amount of memory available
for allocation by calling the garbage collector and determinig the
available memory.
minNonCachedMemoryMB - the minimum amount of memory that
should be left free for future non-cache allocations in megabytes.
setMaxCacheSize(int)public void setCacheExpirationTime(double hours)
hours - the time in hours. The default value is 96.
Set to 0 for no expiration.setMaxCacheSize(int),
setMinNonCachedMemory(int)public void setNumberOfProcessingThreads(int threads)
threads - the number of threads.public void setThreadPriority(int priority)
setRunMode(int) is set to
either RUN_MODE_ASYNCH_COMPLETE or
RUN_MODE_ASYNCH_PROGRESSIVE.
priority - the priority ranging 1 (Thread.MIN_PRIORITY)
to 10 (Thread.MAX_PRIORITY).Thread.MIN_PRIORITY).public int getResult(int index)
cd_id value of the found compound specified by
index.
If result table is generated,
getResult throws NullPointerException.
index - Index of the property.
index.setResultTablepublic int[] getResults()
int array containing the
cd_id values of found compounds.
If a result table is generated in the database,
it returns null.
public void cleanResults()
public float getDissimilarity(int index)
index and the query structure.
If searching has not been finished yet or if a result table is generated,
getDissimilarity throws NullPointerException.
index - Index of the property.
index.setResultTablepublic float[] getDissimilarity()
getDissimilarity throws NullPointerException.
setResultTablepublic java.lang.String getProgressMessage()
public int getCurrentId()
public boolean isMaxResultCountReached()
public boolean isMaxTimeReached()
public int getResultCount()
public void setTimeout(int seconds)
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.
seconds - the timeout in seconds. Set to 0 to disable (default).setRunMode(int)public int getTimeout()
setTimeout(int)public boolean isRunning()
public void setRunning(boolean run)
throws java.sql.SQLException,
MolFormatException,
java.io.IOException,
DatabaseSearchException,
PropertyNotSetException
true and the search has not been started yet,
then searching is unleashed.
If it is set to false and a search is running, the
the process will be stopped.
(Default: false)
run - New value of property run.
java.sql.SQLException
MolFormatException
java.io.IOException
DatabaseSearchException
PropertyNotSetException
public void run()
throws java.sql.SQLException,
MolFormatException,
java.io.IOException,
DatabaseSearchException,
PropertyNotSetException
setRunning(true)
java.sql.SQLException
MolFormatException
java.io.IOException
DatabaseSearchException
PropertyNotSetExceptionpublic void run_NE()
run()
setRunning(true), but
Exceptions are caught and stored.
public static void clearCache()
public int getScreenedCount()
public long getScreeningTime()
public long getSearchTime()
public Molecule[] getHitsAsMolecules(int[] idList,
HitColoringAndAlignmentOptions options,
java.util.ArrayList dataFieldNames,
java.util.ArrayList dataFieldValues)
throws java.sql.SQLException,
java.io.IOException,
chemaxon.sss.search.SearchException,
chemaxon.enumeration.supergraph.SupergraphException,
PropertyNotSetException,
DatabaseSearchException
idList - the cd_id list of hits to be retrieved.options - the options for coloring and alignment.
If null the structures will be displayed in their original
form.dataFieldNames - fields of the jchem table that should be fetched
together with the structure or null.dataFieldValues - an empty ArrayList required or can be
null.
The fetched values will be stored in this object as Object[] elements.
- Returns:
- the hits as Molecules, colored and aligned if needed.
If coloring is specified in case of
SearchConstants.SUPERSTRUCTURE
search mode, always the query structure is returned, the target subgraph
is colored.
- Throws:
java.sql.SQLException
java.io.IOException
chemaxon.sss.search.SearchException
chemaxon.enumeration.supergraph.SupergraphException
PropertyNotSetException
DatabaseSearchException- Since:
- JChem 5.0
public void setRegCode(long code)
code - the code. If not 0, overrides the value
found in the property table.public boolean isLicensed()
chemaxon.license.Licensable
return LicenseHandler.isLicensed( LicenseHandler.MY_IDENTIFIER, licenseEnvironment );
isLicensed in interface chemaxon.license.Licensablepublic void setLicenseEnvironment(java.lang.String env)
chemaxon.license.Licensable
private String licenseEnvironment = "";
public void setLicenseEnvironment(String env) {
licenseEnvironment = env;
}
setLicenseEnvironment in interface chemaxon.license.Licensableenv - environment String to be stored and passed to the LicenseHandler in the isLicensed method
public boolean hasMoreHits()
throws java.lang.InterruptedException
RUN_MODE_ASYNCH_PROGRESSIVE. true if there are more hits to retrieve with
getNextHit() or getAvailableNewHits(int),
false otherwise.
true if there are more hits to retrieve with
getNextHit() or getAvailableNewHits(int),
false otherwise.
java.lang.InterruptedException
public int getNextHit()
throws java.lang.InterruptedException
RUN_MODE_ASYNCH_PROGRESSIVE.
java.lang.InterruptedException - if the calling thread was interrupted while waiting for the
next available hit.
public int[] getAvailableNewHits(int arraySize)
throws java.lang.InterruptedException,
DatabaseSearchException
RUN_MODE_ASYNCH_PROGRESSIVE. arraySize new hits.
arraySize -
arraySize new hits.
java.lang.InterruptedException - if the calling thread was interrupted while waiting.
DatabaseSearchException
public void waitUntilSearchComplete()
throws java.lang.InterruptedException
RUN_MODE_ASYNCH_PROGRESSIVE.
java.lang.InterruptedException - if the calling thread was interrupted while waiting.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||