Package chemaxon.util
Class HitDisplayTool
- java.lang.Object
-
- chemaxon.util.HitDisplayTool
-
- All Implemented Interfaces:
chemaxon.license.Licensable
,SearchConstants
@PublicAPI public class HitDisplayTool extends Object implements SearchConstants, chemaxon.license.Licensable
Class for displaying hit results with hit coloring, alignment, partial clean, etc. E.g.HitColoringAndAlignmentOptions displayOpts = new HitColoringAndAlignmentOptions(); displayOpts.setColoringEnabled(true); displayOpts.setAlignmentMode(align); // ... MolSearchOptions searchOpts = ... // set search options Molecule query = ... // set your query HitDisplayTool hdt = new HitDisplayTool(displayOpts, searchOpts, query); // Retrieve all hits Molecule[] hits = hdt.getHits(m, (Molecule) null, 0); // Or retrieve the hits one-by-one HitDisplayTool hdt2 = new HitDisplayTool(displayOpts, searchOpts, query); hdt2.setTarget(m); List<Molecule> hitList = new ArrayList<Molecule>(); Molecule hit = hdt2.getNextHit(); while (hit != null) { hitList.add(hit); hit = hdt2.getNextHit(); }
- Since:
- JChem 5.0
-
-
Field Summary
Fields Modifier and Type Field Description static int
HIT_ATOM_SET
Set identifier for hit atomsstatic int
HIT_BOND_SET
Set identifier for hit bondsstatic int
NON_HIT_ATOM_SET
Set identifier for non-hit atomsstatic int
NON_HIT_BOND_SET
Set identifier for non hit bonds-
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
Constructors Constructor Description HitDisplayTool(HitColoringAndAlignmentOptions options, MolSearchOptions searchOptions, Molecule query)
Creates a new instance with the specified parameters, with using a default standardization method which applies only aromatization during the search process.HitDisplayTool(HitColoringAndAlignmentOptions options, MolSearchOptions searchOptions, Molecule query, Standardizer standardizer)
Constructor.HitDisplayTool(HitColoringAndAlignmentOptions hco, chemaxon.sss.search.pipeline.SearchSettings settings, Molecule query, Standardizer standardizer)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Molecule
getHit(Molecule targetMol)
Processes the next target structure.ArrayList<int[]>
getHitIndexes()
Returns the hit indexes for the last target.Molecule[]
getHits(int maxHitCountIn)
Processes the next target structure.Molecule[]
getHits(Molecule targetMol, Molecule markush, int maxHitCount)
Processes the next target structure.Molecule
getNextHit()
Gets the next hit.boolean
isLicensed()
void
setLicenseEnvironment(String env)
void
setMoleculeAndMarkushTarget(Molecule targetMol, Molecule markushInnerRepresentation)
Sets the target structure.void
setTarget(Molecule targetMol)
Sets the target structure.
-
-
-
Field Detail
-
HIT_ATOM_SET
public static final int HIT_ATOM_SET
Set identifier for hit atoms- See Also:
- Constant Field Values
-
NON_HIT_ATOM_SET
public static final int NON_HIT_ATOM_SET
Set identifier for non-hit atoms- See Also:
- Constant Field Values
-
HIT_BOND_SET
public static final int HIT_BOND_SET
Set identifier for hit bonds- See Also:
- Constant Field Values
-
NON_HIT_BOND_SET
public static final int NON_HIT_BOND_SET
Set identifier for non hit bonds- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HitDisplayTool
public HitDisplayTool(HitColoringAndAlignmentOptions options, MolSearchOptions searchOptions, Molecule query, Standardizer standardizer)
Constructor.- Parameters:
options
- options for coloring and alignmentsearchOptions
- search optionsquery
- the query structurestandardizer
- theStandardizer
which will be used during the search process, ornull
for only aromatization.
-
HitDisplayTool
public HitDisplayTool(HitColoringAndAlignmentOptions options, MolSearchOptions searchOptions, Molecule query)
Creates a new instance with the specified parameters, with using a default standardization method which applies only aromatization during the search process.- Parameters:
options
- options for coloring and alignmentsearchOptions
- search optionsquery
- the query structure
-
HitDisplayTool
@Beta public HitDisplayTool(HitColoringAndAlignmentOptions hco, chemaxon.sss.search.pipeline.SearchSettings settings, Molecule query, Standardizer standardizer)
Constructor. For internal use only!- Parameters:
hco
- options for coloring and alignmentsettings
- search settings containing search options among othersquery
- the query structurestandardizer
- theStandardizer
which will be used during the search process, ornull
for only aromatization.
-
-
Method Detail
-
getHit
public Molecule getHit(Molecule targetMol) throws SearchException, chemaxon.enumeration.supergraph.SupergraphException
Processes the next target structure.- Parameters:
targetMol
- the target- Returns:
- the structure to be displayed, or
null
if there was no hit - Throws:
SearchException
- error during searchingchemaxon.enumeration.supergraph.SupergraphException
- if target is a markush structure but is erroneous
-
getHits
public Molecule[] getHits(Molecule targetMol, Molecule markush, int maxHitCount) throws chemaxon.enumeration.supergraph.SupergraphException, SearchException
Processes the next target structure.- Parameters:
targetMol
- the targetmarkush
- a markush structure can be specified here, ornull
maxHitCount
- specify0
to get back all the hits found, or an arbitrary limit.
Specify-1
to get back only a single hit, the best fitting is returned in case of alignment (default).- Returns:
- the structures to be displayed, or a zero sized array if there were no hits
- Throws:
chemaxon.enumeration.supergraph.SupergraphException
- in case of search failureSearchException
- in case of search failure
-
setTarget
public void setTarget(Molecule targetMol)
Sets the target structure.- Parameters:
targetMol
- the target
-
setMoleculeAndMarkushTarget
@Beta public void setMoleculeAndMarkushTarget(Molecule targetMol, Molecule markushInnerRepresentation) throws chemaxon.enumeration.supergraph.SupergraphException
Sets the target structure.- Parameters:
targetMol
- the targetmarkushInnerRepresentation
- if the target molecule is a markush molecule and its inner representation is known it can be specified here, otherwise this parameter should be set to null.- Throws:
chemaxon.enumeration.supergraph.SupergraphException
- in case of search failure
-
getHits
public Molecule[] getHits(int maxHitCountIn) throws SearchException, chemaxon.enumeration.supergraph.SupergraphException
Processes the next target structure. Before calling this function the target has to be set.- Parameters:
maxHitCountIn
- specify0
to get back all the hits found, or an arbitrary limit.
Specify-1
to get back only a single hit, the best fitting is returned in case of alignment (default).- Returns:
- the structures to be displayed, or a zero sized array if there were no hits
- Throws:
chemaxon.enumeration.supergraph.SupergraphException
- in case of search failureSearchException
- in case of search failure- See Also:
setTarget(Molecule)
,setMoleculeAndMarkushTarget(Molecule, Molecule)
-
getNextHit
public Molecule getNextHit() throws SearchException, chemaxon.enumeration.supergraph.SupergraphException
Gets the next hit. Before calling this method the target has to be set.- Returns:
- the next colored hit or null if no more hits are present
- Throws:
chemaxon.enumeration.supergraph.SupergraphException
- in case of search failureSearchException
- in case of search failure- See Also:
setTarget(Molecule)
,setMoleculeAndMarkushTarget(Molecule, Molecule)
-
getHitIndexes
public ArrayList<int[]> getHitIndexes()
Returns the hit indexes for the last target. Can be called aftergetHit(Molecule)
,getHits(int)
orgetNextHit()
- Returns:
- the hit indexes in an ArrayList, containing
int[]
elements.
-
isLicensed
public boolean isLicensed()
- Specified by:
isLicensed
in interfacechemaxon.license.Licensable
-
setLicenseEnvironment
public void setLicenseEnvironment(String env)
- Specified by:
setLicenseEnvironment
in interfacechemaxon.license.Licensable
-
-