@PublicAPI public class JChemSearch extends ErrorHandler implements SearchConstants, TableTypeConstants, chemaxon.license.Licensable
Example for using the class:
searcher = new JChemSearch(); searcher.setQueryStructure("c1cnccc1Cl"); searcher.setConnectionHandler(conHandler); searcher.setStructureTable("cduser.structures"); searchOptions = new JChemSearchOptions(JChemSearch.SIMILARITY); searchOptions.setDissimilarityThreshold(0.8F); searchOptions.setMaxResultCount(100); searcher.setSearchOptions(searchOptions); searcher.setRunMode(JChemSearch.RUN_MODE_SYNCH_COMPLETE); searcher.run();
Modifier and Type | Class and Description |
---|---|
static class |
JChemSearch.DissimilarityMetrics
Class for presenting the available dissimilarity metrics for similarity
search.
|
Modifier and Type | Field and Description |
---|---|
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 |
MAXIMAL_ACCEPTEDSEARCHTIME_MINUTES
Deprecated.
|
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. |
protected JChemSearchOptions |
searchOptions
Object to store all search parameters.
|
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, SQL_ERROR, UNIDENTIFIED_ERROR
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
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 and Description |
---|
JChemSearch()
Creates new JChemSearch class
|
JChemSearch(chemaxon.jchem.db.distributed.DistributedNodes distributedNodes)
Creates a new JChemSearch class for distributed search.
|
JChemSearch(chemaxon.jchem.db.distributed.DistributedNodes distributedNodes,
java.lang.String indexedTable,
java.lang.String indexedColumn)
For internal use only.
|
JChemSearch(java.lang.String indexedTable,
java.lang.String indexedColumn)
For internal use only.
|
Modifier and Type | Method and Description |
---|---|
void |
checkException()
Throws the exception stored in the object.
|
void |
cleanResults()
Cleans stored search results.
|
java.util.List<byte[]> |
getAvailableExtraInformation(int minimumHitSize)
For internal use only.
|
int[] |
getAvailableNewHits(int minimumHitSize)
Used with run mode =
RUN_MODE_ASYNCH_PROGRESSIVE . |
java.lang.String |
getCacheError()
For checking for cache errors.
|
long |
getCacheLoadTime()
Gets the time spent with cache loading for the target structure table.
|
double |
getCacheSize()
Returns the size of the cache for the target structure table.
|
double |
getCacheSizeEstimate()
Returns an estimate of the cache size for the target structure table.
|
java.sql.Connection |
getConnection()
Getter for property connection.
|
ConnectionHandler |
getConnectionHandler()
Getter for property connectionHandler.
|
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.
|
static JChemSearch.DissimilarityMetrics |
getDissimilarityMetrics(ConnectionHandler ch,
java.lang.String tableName,
java.lang.String indexedTable,
java.lang.String indexedColumn) |
int |
getEnumerationCount()
Gets the number of enumerates used while screening the database
|
java.util.List<byte[]> |
getExtraInformation()
For internal use only.
|
long |
getFirstHitTime()
Gets the first hit's retrieving time (measured from start of screening).
|
HitDisplayTool |
getHitsAsHitDisplayTool(int[] idList,
HitColoringAndAlignmentOptions options,
java.util.List<java.lang.String> dataFieldNames,
java.util.List<java.lang.Object[]> dataFieldValues,
java.util.List<? super Molecule> molecules,
java.util.List<byte[]> sources)
Gets a HitDisplayTool object from which the results can be retrieved.
|
Molecule[] |
getHitsAsMolecules(int[] idList,
HitColoringAndAlignmentOptions options,
java.util.List<java.lang.String> dataFieldNames,
java.util.List<java.lang.Object[]> dataFieldValues)
Returns hits ready for display.
|
RgDecompResults |
getHitsAsRgDecomp(int[] hits,
int attachmentType)
Returns hits as result of r-group decomposition according to the original
query.
|
int |
getNextHit()
Used with run mode =
RUN_MODE_ASYNCH_PROGRESSIVE . |
int |
getNumberOfProcessingThreads()
Gets the number of processing threads.
|
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.
|
chemaxon.jchem.db.SearchCoreReturnedValue |
getResultContext()
For internal use only.
|
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 total screened structures.
|
int |
getScreenedCountTotal()
Gets the number of total screened structures.
|
int |
getScreenedCountUnique()
Gets the number of unique screened structures.
|
int[] |
getScreenedResults()
Gets the screened unique structures' ids.
|
long |
getScreeningTime()
Gets the screening time.
|
JChemSearchOptions |
getSearchOptions()
Returns the SearchOptions object associated with this Search object.
|
long |
getSearchTime()
Gets the total search time.
|
java.lang.String |
getStructureTable()
Getter for property structureTable.
|
boolean |
hasMoreHits()
Used with run mode =
RUN_MODE_ASYNCH_PROGRESSIVE . |
boolean |
isInfoToStdError()
Getter for property infoToStdError.
|
boolean |
isLicensed() |
boolean |
isMaxResultCountReached()
Getter for property maxResultCountReached.
|
boolean |
isMaxTimeReached()
Getter for property maxTimeReached.
|
boolean |
isRunning()
Getter for property running.
|
boolean |
isTargetMarkush()
Gets whether target structure table is a Markush table
|
void |
run()
Starts searching.
|
void |
setConnectionHandler(ConnectionHandler connectionHandler)
Sets the database connection.
|
void |
setFilterIDList(int[] ids)
Specifies a list of cd_id values that are allowed to be included in the result set.
|
void |
setFilterIDNotList(int[] ids)
Specifies a list of cd_id values that should not be included in the result set.
|
void |
setInfoToStdError(boolean infoToStdError)
Setter for property infoToStdError.
|
void |
setLicenseEnvironment(java.lang.String env) |
void |
setNumberOfProcessingThreads(int threads)
Sets the number of processing threads.
|
void |
setOrder(int order)
Setter for property order.
|
void |
setProgressMessage(java.lang.String message) |
void |
setQueryFingerprint(int[] queryFp)
Currently internal use only.
|
void |
setQueryStructure(Molecule queryMol)
Sets the query structure.
|
void |
setQueryStructure(java.lang.String queryStructure)
Setter for property queryStructure.
|
void |
setResultTable(java.lang.String resultTable)
Setter for property resultTable.
|
void |
setResultTableMode(int resultTableMode)
Setter for property resultTableMode.
|
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 |
setStructureTable(java.lang.String structureTable)
Setter for property structureTable.
|
void |
setTargetCollection(chemaxon.jchem.base.storage.search.CurrentTargetCollection targetCollection)
For internal use only.
|
void |
setThreadPriority(int priority)
Sets the priority of the processing threads.
|
java.lang.String |
toString() |
void |
waitUntilSearchComplete()
Used with run mode =
RUN_MODE_ASYNCH_PROGRESSIVE . |
checkError, getError, getErrorMessage, getException, getStackTrace
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 final int RUN_MODE_SYNCH_COMPLETE
run()
or setRunning(boolean)
return only after all hits has been found.public static final int RUN_MODE_ASYNCH_COMPLETE
run()
or
setRunning(boolean)
return immediately.
Exceptions are not thrown by the run()
method
they should be checked by the checkException()
or ErrorHandler.checkError()
methods.public static final 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. Exceptions are not thrown by the run()
method
they should be checked by the checkException()
or ErrorHandler.checkError()
methods.SearchOptions.SearchOptions(int)
),
JChemSearchOptions.setReturnsNonHits(boolean)
)
NO_ORDERING
(setOrder(int)
).
protected final JChemSearchOptions searchOptions
@Deprecated public static final int MAXIMAL_ACCEPTEDSEARCHTIME_MINUTES
public JChemSearch()
public JChemSearch(java.lang.String indexedTable, java.lang.String indexedColumn)
indexedTable
- the name of the tableindexedColumn
- the name of the columnpublic JChemSearch(chemaxon.jchem.db.distributed.DistributedNodes distributedNodes, java.lang.String indexedTable, java.lang.String indexedColumn)
distributedNodes
- the distributed nodesindexedTable
- the name of the tableindexedColumn
- the name of the columnpublic JChemSearch(chemaxon.jchem.db.distributed.DistributedNodes distributedNodes)
distributedNodes
- the distributed nodespublic void checkException() throws java.lang.Exception
ErrorHandler
Throwable
that are not
inheritors of Exception
.checkException
in class ErrorHandler
java.lang.Exception
- the exception stored, boxed as Exceptionpublic ConnectionHandler getConnectionHandler()
public void setConnectionHandler(ConnectionHandler connectionHandler)
connectionHandler
- a ConnectionHandler object containing a live connection to the
databasepublic java.sql.Connection getConnection()
public static JChemSearch.DissimilarityMetrics getDissimilarityMetrics(ConnectionHandler ch, java.lang.String tableName) throws java.sql.SQLException
ch
- ConnectionHandler with live connectiontableName
- the name of the JChem structure tablenull
if no metrics are availablejava.sql.SQLException
- in case it encounters an sql problem.JChemSearchOptions.setDissimilarityMetric(String)
,
MolecularDescriptor.getDefaultDissimilarityMetricThresholds()
,
MolecularDescriptor.getDissimilarityMetrics()
,
MolecularDescriptor.getDefaultMetricIndex()
,
MolecularDescriptor.getMetricName(int)
public static JChemSearch.DissimilarityMetrics getDissimilarityMetrics(ConnectionHandler ch, java.lang.String tableName, java.lang.String indexedTable, java.lang.String indexedColumn) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getCacheError()
null
in case of normal execution.public java.lang.String getQueryStructure()
public void setQueryStructure(java.lang.String queryStructure)
null
or empty string, then it is interpreted as an
empty query structure. (For more information, see the user's guide.)
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 it is interpreted as an empty query structure. (For more
information, see the user's guide.)queryMol
- the query structure.public void setQueryFingerprint(int[] queryFp)
queryFp
- the query fingerprint.public java.lang.String getStructureTable()
public void setStructureTable(java.lang.String structureTable)
structureTable
- New value of property structureTable.public void setFilterIDList(int[] ids)
If the given array is empty, no hits will be returned. Resetting the list is possible by calling the method with
null
parameter.
ids
- the cd_id values in an arraypublic void setFilterIDNotList(int[] ids)
ids
- the cd_id values in an arraypublic boolean isInfoToStdError()
public void setInfoToStdError(boolean infoToStdError)
false
)infoToStdError
- New value of property infoToStdError.public int getRunMode()
setRunMode(int)
public void setRunMode(int runMode)
RUN_MODE_SYNCH_COMPLETE
runMode
- Accepted
values:
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. The timeout limit of the new options will be applied to further searches.getSearchOptions()
public JChemSearchOptions getSearchOptions()
setSearchOptions(JChemSearchOptions)
public int getOrder()
public void setOrder(int order)
order
- New value of property order. Acceptable values:
NO_ORDERING
, ORDERING_BY_ID
,
ORDERING_BY_ID_OR_SIMILARITY
(default), and
ORDERING_BY_FILTER_ID_LIST
.
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 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
,
getResult
public 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.setResultTable
public java.lang.String getResultTable()
public void setNumberOfProcessingThreads(int threads)
threads
- the number of threads.public int getNumberOfProcessingThreads()
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
.setResultTable
public chemaxon.jchem.db.SearchCoreReturnedValue getResultContext()
public int[] getResults()
int
array containing the cd_id
values of found compounds. If a result table is generated in the
database, it returns null
.cd_id
spublic java.util.List<byte[]> getExtraInformation()
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
.setResultTable
public float[] getDissimilarity()
getDissimilarity
throws NullPointerException
.setResultTable
public java.lang.String getProgressMessage()
public boolean isMaxResultCountReached()
public boolean isMaxTimeReached()
public int getResultCount()
public boolean isRunning()
public void setRunning(boolean run) throws java.sql.SQLException, java.io.IOException, DatabaseSearchException
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.io.IOException
- if an io error is encounteredDatabaseSearchException
- if a search error occursjava.sql.SQLException
- if an sql exception is encounteredpublic void run() throws java.io.IOException, DatabaseSearchException, java.sql.SQLException
setRunning
(true)java.io.IOException
- if an io error is encounteredDatabaseSearchException
- if a search error occursjava.sql.SQLException
- if an sql exception is encounteredpublic 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
- if the thread is interrupted during waitingpublic 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 minimumHitSize) throws java.lang.InterruptedException, DatabaseSearchException
RUN_MODE_ASYNCH_PROGRESSIVE
. minimumHitSize
new hits.minimumHitSize
- the minimum number of hits to return, which will be waited if not yet available.minimumHitSize
new hits.java.lang.InterruptedException
- if the calling thread was interrupted while waiting.DatabaseSearchException
- if there was an error during searching.public java.util.List<byte[]> getAvailableExtraInformation(int minimumHitSize) throws java.lang.InterruptedException, DatabaseSearchException
minimumHitSize
- minmum size of hits to collectjava.lang.InterruptedException
- if the thread is interrupted during waitingDatabaseSearchException
- if the search ecountered a problempublic void waitUntilSearchComplete() throws java.lang.InterruptedException
RUN_MODE_ASYNCH_PROGRESSIVE
. java.lang.InterruptedException
- if the calling thread was interrupted while waiting.public int getScreenedCount()
public int getScreenedCountUnique()
public int getScreenedCountTotal()
public int[] getScreenedResults()
public long getScreeningTime()
public long getFirstHitTime()
public long getSearchTime()
public boolean isTargetMarkush()
true
if target table is a Markush table,
false
if notpublic int getEnumerationCount()
public boolean isLicensed()
isLicensed
in interface chemaxon.license.Licensable
public void setLicenseEnvironment(java.lang.String env)
setLicenseEnvironment
in interface chemaxon.license.Licensable
public void setProgressMessage(java.lang.String message)
public long getCacheLoadTime() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if no cache is loaded yetpublic double getCacheSizeEstimate() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if no cache is loaded yetpublic double getCacheSize() throws java.lang.IllegalStateException
Warning: the calculation performed by this function may be slow and may consume a large amount of memory.
Consider to use getCacheSizeEstimate()
to obtain an estimation of the cache size much faster.
java.lang.IllegalStateException
- if no cache is loaded yetpublic RgDecompResults getHitsAsRgDecomp(int[] hits, int attachmentType) throws SearchException, MolFormatException, java.sql.SQLException
RgDecompResults.getScaffold()
)
RgDecompResults.getLigandsNumber()
)
RgDecompResults.getIncludedIds()
)
RgDecompResults.getSkippedIds()
)
RgDecompResults.getHitsAsMarkush()
)
RgDecompResults.getHitsAsRgDecomp()
)
RgDecompResults.getHitsAsTable()
) Format of the table (first row
is header row, following rows contain targets, 1 hit/target):
[query]: molecule R1 R2 R3 ... --------------------------------------------------------- [target1]: molecule1 ligand1.1 ligand1.2 ligand1.3 [target2]: molecule2 ligand2.1 ligand2.2 ligand2.3As an example see decomposition table.
RGroupDecomposition
API documentation.
hits
- cd_ids of target structuresattachmentType
- Type of visualization of attachment of ligands.java.sql.SQLException
- if an sql exception is encounteredSearchException
- Search failureMolFormatException
- if the molecule can't be readRgDecompResults
public Molecule[] getHitsAsMolecules(int[] idList, HitColoringAndAlignmentOptions options, java.util.List<java.lang.String> dataFieldNames, java.util.List<java.lang.Object[]> dataFieldValues) throws java.sql.SQLException, java.io.IOException, SearchException, chemaxon.enumeration.supergraph.SupergraphException, 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 List required or it can be null
. The
fetched values will be stored in this object as Object[]
elements.SearchConstants.SUPERSTRUCTURE
search mode,
always the query structure is returned, the target subgraph is
colored. If there is no hit for a target then the appropriate
element of the result array is null
.java.sql.SQLException
- if the fetched row is deletedjava.io.IOException
- if an io error is encounteredSearchException
- Search failure during getting colored atomschemaxon.enumeration.supergraph.SupergraphException
- Search failure during getting colored atomsDatabaseSearchException
- Search failure during getting colored atomspublic HitDisplayTool getHitsAsHitDisplayTool(int[] idList, HitColoringAndAlignmentOptions options, java.util.List<java.lang.String> dataFieldNames, java.util.List<java.lang.Object[]> dataFieldValues, java.util.List<? super Molecule> molecules, java.util.List<byte[]> sources) throws java.sql.SQLException, java.io.IOException, SearchException, chemaxon.enumeration.supergraph.SupergraphException, DatabaseSearchException
getHitsAsMolecules(int[], HitColoringAndAlignmentOptions, List, List)
Additional parameters: molecules, sources Example usage:
List<Molecule> molecules = new ArrayList<Molecule>(); List<byte[]> sources = new ArrayList<byte[]>(); HitDisplayTool colorUtil = getHitsAsHitDisplayTool(idList, options, dataFieldNames, dataFieldValues, molecules, sources); for (int x = 0, n = molecules.size(); x < n; x++) { if (molecules.get(x) == null) { // not found continue; } colorUtil.setMoleculeMarkushSourceTarget(molecules.get(x), sources.get(x)); // fetch the hits using colorUtil.getNextHit() or colorUtil.getHits(int) // ... }
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 List required or it can be null
. The
fetched values will be stored in this object as Object[]
elements.molecules
- An empty list that will contain the molecules to be set on the
hitdisplaytool object. For not found IDs (e.g. deleted) null
is set.sources
- An empty list that will contain the byte array sources to be
set on the hitdisplaytool object.java.sql.SQLException
- if an sql error encounteredjava.io.IOException
- if an io exception is encounteredSearchException
- if there was an error during searching.chemaxon.enumeration.supergraph.SupergraphException
- if there was an error during searching.DatabaseSearchException
- if there was an error during searching.@Beta public void setTargetCollection(chemaxon.jchem.base.storage.search.CurrentTargetCollection targetCollection)
targetCollection
- the targetcollection to usepublic java.lang.String toString()
toString
in class java.lang.Object