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 SummaryConstructorsConstructorDescriptionRgDecompResults(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 SummaryModifier and TypeMethodDescriptionReturns theDecompositionobjects 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.intReturns 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.booleanvoidrun()Generates the results if no valid results are available (seehasResults())voidsetAttachmentType(int attachmentType) voidsetOriginalIds(int[] originalIds) voidvoidsetSearchOptions(SearchOptions options) voidsetTargets(Molecule[] targets) 
- 
Constructor Details- 
RgDecompResultspublic 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 structure
- skippedIds- Indexes of those targets that are not matched by query.
 
- 
RgDecompResultspublic 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 structure
- skippedIds- Indexes of those targets that are not matched by query.
- originalIds- Target identifiers to be returned by- getSkippedIds()and- getIncludedIds()instead of indexes of targets.
 
- 
RgDecompResultspublic 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:
 
- 
RgDecompResultspublic 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 by- getSkippedIds()and- getIncludedIds()instead of indexes of targets.
- See Also:
 
 
- 
- 
Method Details- 
getScaffoldReturns scaffold of the query (r-groups are added automatically if needed).- Returns:
- Scaffold if valid results are available
 otherwise null.
 
- 
getLigandsNumberpublic 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.
 
- 
getHitsAsRgDecompReturns All ligands of all targets. When a target does not contain the query structure the array containsnullinstead 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.
 
- 
getDecompositionsReturns theDecompositionobjects corresponding to the targets.- Returns:
- the Decompositionobjects corresponding to the targets if valid results are available, otherwisenull.
- Since:
- JChem 5.10
 
- 
getHitsAsTableReturns 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 
 
- 
getHitsAsMarkushReturns 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.
 
- 
getSkippedIdspublic 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.
 
- 
getIncludedIdspublic 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.
 
- 
runGenerates 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
 
- 
setAttachmentTypepublic void setAttachmentType(int attachmentType) - Parameters:
- attachmentType- The attachment type to set
 
- 
setOriginalIdspublic void setOriginalIds(int[] originalIds) - Parameters:
- originalIds- Original identifiers of targets to set
 
- 
hasResultspublic boolean hasResults()- Returns:
- true, if valid results are available
 
 
-