public final class TemplateHandler extends Object
Constructor and Description |
---|
TemplateHandler()
Creates a new TemplateHandler without any default templates.
|
TemplateHandler(IChemObjectBuilder builder)
Creates a new TemplateHandler with default templates loaded.
|
Modifier and Type | Method and Description |
---|---|
void |
addMolecule(IAtomContainer molecule)
Adds a Molecule to the list of templates use by this TemplateHandler.
|
static TemplateHandler |
createFromSubstructure(Pattern ptrn,
IAtomContainer mol)
Create a template from a substructure pattern.
|
static TemplateHandler |
createFromSubstructure(Pattern ptrn,
Iterable<IAtomContainer> mols)
Create a template from a substructure pattern.
|
static TemplateHandler |
createSingleton(IAtomContainer template)
Singleton template instance, mainly useful for aligning molecules.
|
IAtomContainerSet |
getMappedSubstructures(IAtomContainer molecule)
Checks if one of the loaded templates is a substructure in the given
Molecule and returns all matched substructures in a IAtomContainerSet.
|
IAtomContainer |
getTemplateAt(int position)
Gets the templateAt attribute of the TemplateHandler object
|
int |
getTemplateCount()
Gets the templateCount attribute of the TemplateHandler object
|
void |
loadTemplates(IChemObjectBuilder builder)
Loads all existing templates into memory.
|
boolean |
mapTemplateExact(IAtomContainer molecule)
Checks if one of the loaded templates is isomorph to the given
Molecule.
|
boolean |
mapTemplates(IAtomContainer molecule)
Checks if one of the loaded templates is a substructure in the given
Molecule.
|
IAtomContainer |
removeMolecule(IAtomContainer molecule) |
public TemplateHandler(IChemObjectBuilder builder)
public TemplateHandler()
public void loadTemplates(IChemObjectBuilder builder)
public void addMolecule(IAtomContainer molecule)
molecule
- The molecule to be added to the TemplateHandlerpublic IAtomContainer removeMolecule(IAtomContainer molecule) throws CDKException
CDKException
public boolean mapTemplateExact(IAtomContainer molecule) throws CDKException
molecule
- The molecule to be check for potential templatesCDKException
public boolean mapTemplates(IAtomContainer molecule) throws CDKException
molecule
- The molecule to be check for potential templatesCDKException
public int getTemplateCount()
public IAtomContainer getTemplateAt(int position)
position
- Description of the Parameterpublic IAtomContainerSet getMappedSubstructures(IAtomContainer molecule) throws CDKException
molecule
- The molecule to be check for potential templatesCDKException
- if an error occurspublic static TemplateHandler createSingleton(IAtomContainer template)
template
- the moleculepublic static TemplateHandler createFromSubstructure(Pattern ptrn, Iterable<IAtomContainer> mols)
ptrn
- the structure pattern to matchmols
- list of moleculespublic static TemplateHandler createFromSubstructure(Pattern ptrn, IAtomContainer mol)
ptrn
- the structure pattern to matchmol
- moleculeCopyright © 2022. All rights reserved.