Package chemaxon.sss.search
Class RgDecompResults
java.lang.Object
chemaxon.sss.search.RgDecompResults
Convenience class for generating, storing and returning results of a search
in different forms: as r-group decomposition or Markush molecule.
When RgDecompResults is used only for storing results
use the constructor designed for that purpose. When generating the results,
set the parameters (query, targets (and optionally their original
identifiers), search options, attachment type) using
the appropriate constructor or setters then call run() method.
Available setters:
If a query does not contain undefined r-atoms (r-atom without corresponding r-group definition) then implicit Hydrogens are exchanged to undefined r-atoms and results are obtained using this new query.
For more sophisticated usages (e.g. all hits of query in a specific target) see our
Available setters:
-
setQuery(Molecule)
-
setTargets(Molecule[])
-
setSearchOptions(SearchOptions)
-
setAttachmentType(int)
-
setOriginalIds(int[])
If a query does not contain undefined r-atoms (r-atom without corresponding r-group definition) then implicit Hydrogens are exchanged to undefined r-atoms and results are obtained using this new query.
hasResults()
shows whether the class can actually provide valid results.
Results can be achieved by calling different methods:
- scaffold of query (
getScaffold()
) - number of ligands (
getLigandsNumber()
) - matched target indexes (
getIncludedIds()
) - non-matched target indexes (
getSkippedIds()
) - hits in a Markush molecule (
getHitsAsMarkush()
) - r-group decomposed hits (
getHitsAsRgDecomp()
) - r-group decomposed hits in colored table format (
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.3
As an example see decomposition table
For more sophisticated usages (e.g. all hits of query in a specific target) see our
RGroupDecomposition API
documentation.- Since:
- JChem 5.3 Date 1-Oct-2009
-
Constructor Summary
ConstructorDescriptionRgDecompResults
(Molecule scaffold, int noLigands, Molecule[][] rgDecomps, RgMolecule markush, int[] skippedIds) This constructor is used only for storing results.RgDecompResults
(Molecule scaffold, int noLigands, Molecule[][] rgDecomps, RgMolecule markush, int[] skippedIds, int[] originalIds) This constructor is used only for storing results.RgDecompResults
(Molecule query, Molecule[] targets, SearchOptions options, int attachmentType) Constructor used for generating results.RgDecompResults
(Molecule query, Molecule[] targets, SearchOptions options, int attachmentType, int[] originalIds) Constructor used for generating results. -
Method Summary
Modifier and TypeMethodDescriptionReturns theDecomposition
objects corresponding to the targets.Returns a single RgMolecule that consists of the scaffold and all the possible ligands as rgroup-definitions.Molecule[][]
Returns All ligands of all targets.Molecule[][]
Returns the table elements in Molecule[][] format.int[]
Returns indexes of those targets that are matched by query.int
Returns the number of ligands in one target structure.Returns scaffold of the query (r-groups are added automatically if needed).int[]
Returns indexes of those targets that are not matched by query.boolean
void
run()
Generates the results if no valid results are available (seehasResults()
)void
setAttachmentType
(int attachmentType) void
setOriginalIds
(int[] originalIds) void
void
setSearchOptions
(SearchOptions options) void
setTargets
(Molecule[] targets)
-
Constructor Details
-
RgDecompResults
public RgDecompResults(Molecule scaffold, int noLigands, Molecule[][] rgDecomps, RgMolecule markush, int[] skippedIds) This constructor is used only for storing results. For retrieving stored results seegetScaffold()
,getLigandsNumber()
,getHitsAsRgDecomp()
,getHitsAsMarkush()
,getHitsAsTable()
,getIncludedIds()
andgetSkippedIds()
.- Parameters:
scaffold
- Scaffold of the query with added rgroups.noLigands
- Number of ligands in a decomposition.rgDecomps
- Ligands of decomposition for all targets.markush
- Scaffold and ligands collected in one Markush structureskippedIds
- Indexes of those targets that are not matched by query.
-
RgDecompResults
public RgDecompResults(Molecule scaffold, int noLigands, Molecule[][] rgDecomps, RgMolecule markush, int[] skippedIds, int[] originalIds) This constructor is used only for storing results. For retrieving stored results seegetScaffold()
,getLigandsNumber()
,getHitsAsRgDecomp()
,getHitsAsMarkush()
,getHitsAsTable()
,getIncludedIds()
andgetSkippedIds()
.- Parameters:
scaffold
- Scaffold of the query with added r-groups.noLigands
- Number of ligands in a decomposition.rgDecomps
- Ligands of decomposition for all targets.markush
- Scaffold and ligands collected in one Markush structureskippedIds
- Indexes of those targets that are not matched by query.originalIds
- Target identifiers to be returned bygetSkippedIds()
andgetIncludedIds()
instead of indexes of targets.
-
RgDecompResults
public RgDecompResults(Molecule query, Molecule[] targets, SearchOptions options, int attachmentType) Constructor used for generating results.- Parameters:
query
- The query structure that is looked for in targets.targets
- The target structures.options
- Search options used in search.attachmentType
- Type of attachment point representation in ligands. When creating Markush structure from results, this parameter is ignored and Decomposition#ATTACHMENT_POINT (default) is used instead.- See Also:
-
RgDecompResults
public RgDecompResults(Molecule query, Molecule[] targets, SearchOptions options, int attachmentType, int[] originalIds) Constructor used for generating results.- Parameters:
query
- The query structure that is looked for in targets.targets
- The target structures.options
- Search options used in search.attachmentType
- Type of attachment point representation in ligands. When creating Markush structure from results, this parameter is ignored and Decomposition#ATTACHMENT_POINT (default) is used instead.originalIds
- Target identifiers to be returned bygetSkippedIds()
andgetIncludedIds()
instead of indexes of targets.- See Also:
-
-
Method Details
-
getScaffold
Returns scaffold of the query (r-groups are added automatically if needed).- Returns:
- Scaffold if valid results are available
otherwise
null
.
-
getLigandsNumber
public int getLigandsNumber()Returns the number of ligands in one target structure.- Returns:
- Number of ligands in a target structure if valid results
are available, otherwise
Integer.MIN_VALUE
.
-
getHitsAsRgDecomp
Returns All ligands of all targets. When a target does not contain the query structure the array containsnull
instead of array of ligands.- Returns:
- Array of array of ligands for all target structures if valid results are available, otherwise null. The returned array contains ligands for all query atoms. If a query atom is not an r-atom the ligand is null.
-
getDecompositions
Returns theDecomposition
objects corresponding to the targets.- Returns:
- the
Decomposition
objects corresponding to the targets if valid results are available, otherwisenull
. - Since:
- JChem 5.10
-
getHitsAsTable
Returns the table elements in Molecule[][] format. As an example see decomposition table- Returns:
- A colored molecule table if valid results are available
and there were matching targets for the query, otherwise null.
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.3
-
getHitsAsMarkush
Returns a single RgMolecule that consists of the scaffold and all the possible ligands as rgroup-definitions.- Returns:
- An RgMolecule if valid results are available, otherwise null.
-
getSkippedIds
public int[] getSkippedIds()Returns indexes of those targets that are not matched by query.- Returns:
- Array of skipped indexes if valid results are available, otherwise null. If original identifiers of targets are set then those are returned instead of array indexes.
-
getIncludedIds
public int[] getIncludedIds()Returns indexes of those targets that are matched by query.- Returns:
- Array of included indexes if valid results are available, otherwise null. If original identifiers of targets are set then those are returned instead of array indexes.
-
run
Generates the results if no valid results are available (seehasResults()
)- Throws:
SearchException
-
setQuery
- Parameters:
query
- The query to set
-
setTargets
- Parameters:
targets
- The targets to set
-
setSearchOptions
- Parameters:
options
- The search options to set
-
setAttachmentType
public void setAttachmentType(int attachmentType) - Parameters:
attachmentType
- The attachment type to set
-
setOriginalIds
public void setOriginalIds(int[] originalIds) - Parameters:
originalIds
- Original identifiers of targets to set
-
hasResults
public boolean hasResults()- Returns:
true
, if valid results are available
-