public class HOSECodeGenerator extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected IAtomContainer |
atomContainer
The molecular structure on which we work
|
protected String[] |
bondSymbols
The bond symbols used for bond orders "single", "double", "triple" and
"aromatic"
|
protected String |
centerCode |
protected StringBuffer |
HOSECode
The HOSECode string that we assemble
|
protected int |
maxSphere
How many spheres are we supposed inspect.
|
protected List<org.openscience.cdk.tools.HOSECodeGenerator.TreeNode> |
nextSphereNodes
Container for the node in the next sphere Assembled in a recursive method
and then passed to the next recursion to become "sphereNodes".
|
org.openscience.cdk.tools.HOSECodeGenerator.TreeNode |
rootNode |
protected int |
sphere
Counter for the sphere in which we currently work.
|
protected String[] |
sphereDelimiters
Delimiters used to separate spheres in the output string.
|
protected List<org.openscience.cdk.tools.HOSECodeGenerator.TreeNode> |
sphereNodes
Container for the nodes in a sphere.
|
protected List<IAtom> |
sphereNodesWithAtoms |
protected List<org.openscience.cdk.tools.HOSECodeGenerator.TreeNode>[] |
spheres
Here we store the spheres that we assemble, in order to parse them into a
code later.
|
protected List<IAtom>[] |
spheresWithAtoms |
Constructor and Description |
---|
HOSECodeGenerator()
Constructor for the HOSECodeGenerator.
|
Modifier and Type | Method and Description |
---|---|
String |
getHOSECode(IAtomContainer ac,
IAtom root,
int noOfSpheres)
|
String |
getHOSECode(IAtomContainer ac,
IAtom root,
int noOfSpheres,
boolean ringsize)
|
List<IAtom> |
getNodesInSphere(int sphereNumber) |
List<IAtom>[] |
getSpheres(IAtomContainer ac,
IAtom root,
int noOfSpheres,
boolean ringsize)
This method is intended to be used to get the atoms around an atom in spheres.
|
String |
makeBremserCompliant(String code) |
protected List<org.openscience.cdk.tools.HOSECodeGenerator.TreeNode> sphereNodes
protected List<org.openscience.cdk.tools.HOSECodeGenerator.TreeNode> nextSphereNodes
protected int sphere
protected int maxSphere
protected List<org.openscience.cdk.tools.HOSECodeGenerator.TreeNode>[] spheres
protected StringBuffer HOSECode
protected IAtomContainer atomContainer
protected String[] sphereDelimiters
protected String[] bondSymbols
protected String centerCode
public org.openscience.cdk.tools.HOSECodeGenerator.TreeNode rootNode
public HOSECodeGenerator()
public List<IAtom>[] getSpheres(IAtomContainer ac, IAtom root, int noOfSpheres, boolean ringsize) throws CDKException
ac
- The IAtomContainer
with the molecular skeleton in which the root atom resides.root
- The root atom for which to produce the spheres.noOfSpheres
- The number of spheres to look at.ringsize
- Shall the center code have the ring size in it? Only use if you want to have the hose code later, else say false.List
. The list at i-1 contains the atoms at sphere i as TreeNodes.CDKException
public String getHOSECode(IAtomContainer ac, IAtom root, int noOfSpheres) throws CDKException
root
in the IAtomContainer
ac
. The HOSE
code is produced for the number of spheres given by noOfSpheres
.
IMPORTANT: if you want aromaticity to be included in the code, you need
to run the IAtomContainer ac
to the CDKHueckelAromaticityDetector
prior to
using getHOSECode()
. This method only gives proper results if the molecule is
fully saturated (if not, the order of the HOSE code might depend on atoms in higher spheres).
This method is known to fail for protons sometimes.
IMPORTANT: Your molecule must contain implicit or explicit hydrogens
for this method to work properly.ac
- The IAtomContainer
with the molecular skeleton in which the root atom residesroot
- The root atom for which to produce the HOSE codenoOfSpheres
- The number of spheres to look atCDKException
- Thrown if something is wrongpublic String getHOSECode(IAtomContainer ac, IAtom root, int noOfSpheres, boolean ringsize) throws CDKException
root
in the IAtomContainer
ac
. The HOSE
code is produced for the number of spheres given by noOfSpheres
.
IMPORTANT: if you want aromaticity to be included in the code, you need
to run the IAtomContainer ac
to the CDKHueckelAromaticityDetector
prior to
using getHOSECode()
. This method only gives proper results if the molecule is
fully saturated (if not, the order of the HOSE code might depend on atoms in higher spheres).
This method is known to fail for protons sometimes.
IMPORTANT: Your molecule must contain implicit or explicit hydrogens
for this method to work properly.ac
- The IAtomContainer with the molecular skeleton in which the root atom residesroot
- The root atom for which to produce the HOSE codenoOfSpheres
- The number of spheres to look atringsize
- The size of the ring(s) it is in is included in center atom codeCDKException
- Thrown if something is wrongCopyright © 2018. All Rights Reserved.