@TestClass(value="org.openscience.cdk.tools.HOSECodeGeneratorTest") public class HOSECodeGenerator extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
org.openscience.cdk.tools.HOSECodeGenerator.TreeNode |
rootNode |
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(IMolecule 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) |
@TestMethod(value="test1Sphere") public HOSECodeGenerator()
public List<IAtom>[] getSpheres(IMolecule ac, IAtom root, int noOfSpheres, boolean ringsize) throws CDKException
ac
- The IMolecule
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
@TestMethod(value="test4,test4Sphere,testBug655169") 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 wrong@TestMethod(value="testMakeBremserCompliant") public String makeBremserCompliant(String code)