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
FieldsModifier and TypeFieldDescriptionstatic final intSet identifier for hit atomsstatic final intSet identifier for hit bondsstatic final intSet identifier for non-hit atomsstatic final intSet identifier for non hit bondsFields 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
ConstructorsConstructorDescriptionHitDisplayTool(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
Modifier and TypeMethodDescriptionProcesses the next target structure.ArrayList<int[]> Returns the hit indexes for the last target.Molecule[]getHits(int maxHitCountIn) Processes the next target structure.Molecule[]Processes the next target structure.Gets the next hit.booleanvoidvoidsetMoleculeAndMarkushTarget(Molecule targetMol, Molecule markushInnerRepresentation) Sets the target structure.voidSets the target structure.
-
Field Details
-
HIT_ATOM_SET
public static final int HIT_ATOM_SETSet identifier for hit atoms- See Also:
-
NON_HIT_ATOM_SET
public static final int NON_HIT_ATOM_SETSet identifier for non-hit atoms- See Also:
-
HIT_BOND_SET
public static final int HIT_BOND_SETSet identifier for hit bonds- See Also:
-
NON_HIT_BOND_SET
public static final int NON_HIT_BOND_SETSet identifier for non hit bonds- See Also:
-
-
Constructor Details
-
HitDisplayTool
public HitDisplayTool(HitColoringAndAlignmentOptions options, MolSearchOptions searchOptions, Molecule query, Standardizer standardizer) Constructor.- Parameters:
options- options for coloring and alignmentsearchOptions- search optionsquery- the query structurestandardizer- theStandardizerwhich will be used during the search process, ornullfor 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- theStandardizerwhich will be used during the search process, ornullfor only aromatization.
-
-
Method Details
-
getHit
Processes the next target structure.- Parameters:
targetMol- the target- Returns:
- the structure to be displayed, or
nullif there was no hit - Throws:
SearchException- if an error occurred during search
-
getHits
public Molecule[] getHits(Molecule targetMol, Molecule markush, int maxHitCount) throws SearchException Processes the next target structure.- Parameters:
targetMol- the targetmarkush- a markush structure can be specified here, ornullmaxHitCount- specify0to get back all the hits found, or an arbitrary limit.
Specify-1to 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:
SearchException- if an error occurred during search
-
setTarget
Sets the target structure.- Parameters:
targetMol- the target
-
setMoleculeAndMarkushTarget
@Beta public void setMoleculeAndMarkushTarget(Molecule targetMol, Molecule markushInnerRepresentation) throws SearchException 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:
SearchException- if an error occurred during search
-
getHits
Processes the next target structure. Before calling this function the target has to be set.- Parameters:
maxHitCountIn- specify0to get back all the hits found, or an arbitrary limit.
Specify-1to 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:
SearchException- if an error occurred during search- See Also:
-
getNextHit
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:
SearchException- if an error occurred during search- See Also:
-
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:
isLicensedin interfacechemaxon.license.Licensable
-
setLicenseEnvironment
- Specified by:
setLicenseEnvironmentin interfacechemaxon.license.Licensable
-