@TestClass(value="AtomGroupTests,AtomPermutationTests,AtomDiscretePartitionRefinerTest") public class AtomDiscretePartitionRefiner extends AbstractDiscretePartitionRefiner
There are a couple of ways to use it - firstly, get the automorphisms.
IAtomContainer ac = ... // get an atom container somehow AtomDiscretePartitionRefiner refiner = new AtomDiscretePartitionRefiner(); PermutationGroup autG = refiner.getAutomorphismGroup(ac); for (Permutation automorphism : autG.all()) { ... // do something with the permutation }
Another is to check an atom container to see if it is canonical:
IAtomContainer ac = ... // get an atom container somehow AtomDiscretePartitionRefiner refiner = new AtomDiscretePartitionRefiner(); if (refiner.isCanonical(ac)) { ... // do something with the atom container }Note that it is not necessary to call
refine(IAtomContainer)
before
either of these methods. However if both the group and the canonical check
are required, then the code should be:
AtomDiscretePartitionRefiner refiner = new AtomDiscretePartitionRefiner(); refiner.refine(ac); boolean isCanon = refiner.isCanonical(); PermutationGroup autG = refiner.getAutomorphismGroup();This way, the refinement is not carried out multiple times. Finally, remember to call
reset()
if the refiner is re-used on multiple structures.AbstractDiscretePartitionRefiner.Result
Constructor and Description |
---|
AtomDiscretePartitionRefiner()
Default constructor - does not ignore elements or bond orders
or bond orders.
|
AtomDiscretePartitionRefiner(boolean ignoreElements,
boolean ignoreBondOrders)
Make a refiner with various advanced options.
|
Modifier and Type | Method and Description |
---|---|
PermutationGroup |
getAutomorphismGroup(IAtomContainer atomContainer)
Gets the automorphism group of the atom container.
|
PermutationGroup |
getAutomorphismGroup(IAtomContainer atomContainer,
Partition initialPartition)
Get the automorphism group of the molecule given an initial partition.
|
PermutationGroup |
getAutomorphismGroup(IAtomContainer atomContainer,
PermutationGroup group)
Speed up the search for the automorphism group using the automorphisms in
the supplied group.
|
Partition |
getAutomorphismPartition(IAtomContainer atomContainer)
Get the automorphism partition (equivalence classes) of the atoms.
|
int[] |
getConnectedIndices(int atomIndex)
Used by the equitable refiner to get the indices of atoms connected to
the atom at
atomIndex . |
int |
getConnectivity(int i,
int j)
Get the connectivity between two vertices as an integer, to allow
for multigraphs : so a single edge is 1, a double edge 2, etc.
|
Partition |
getElementPartition(IAtomContainer atomContainer)
Get the element partition from an atom container, which is simply a list
of sets of atom indices where all atoms in one set have the same element
symbol.
|
int |
getVertexCount()
Get the number of vertices in the graph to be refined.
|
boolean |
isCanonical(IAtomContainer atomContainer)
Checks if the atom container is canonical.
|
void |
refine(IAtomContainer atomContainer)
Refine an atom container, which has the side effect of calculating
the automorphism group.
|
void |
refine(IAtomContainer atomContainer,
Partition partition)
Refine an atom partition based on the connectivity in the atom container.
|
void |
reset()
Reset the connection table.
|
firstIsIdentity, getAutomorphismGroup, getAutomorphismPartition, getBest, getBestHalfMatrixString, getFirst, getFirstHalfMatrixString, getHalfMatrixString, getHalfMatrixString, isCanonical, refine, setup
@TestMethod(value="defaultConstructorTest") public AtomDiscretePartitionRefiner()
@TestMethod(value="advancedConstructorTest") public AtomDiscretePartitionRefiner(boolean ignoreElements, boolean ignoreBondOrders)
ignoreElements
- ignore element symbols when making automorphismsignoreBondOrders
- ignore bond order when making automorphisms@TestMethod(value="getVertexCountTest") public int getVertexCount()
AbstractDiscretePartitionRefiner
getVertexCount
in class AbstractDiscretePartitionRefiner
@TestMethod(value="getConnectivityTest") public int getConnectivity(int i, int j)
AbstractDiscretePartitionRefiner
getConnectivity
in class AbstractDiscretePartitionRefiner
i
- a vertex of the graphj
- a vertex of the graph@TestMethod(value="getConnectedIndicesTest") public int[] getConnectedIndices(int atomIndex)
atomIndex
.atomIndex
- the index of the incident atom@TestMethod(value="getElementPartitionTest") public Partition getElementPartition(IAtomContainer atomContainer)
atomContainer
- the atom container to get element symbols from@TestMethod(value="resetTest") public void reset()
@TestMethod(value="refine_IgnoreElementsTest,refineTest") public void refine(IAtomContainer atomContainer)
AbstractDiscretePartitionRefiner.getAutomorphismGroup()
instead of getAutomorphismGroup(IAtomContainer)
otherwise the
refine method will be called twice.atomContainer
- the atomContainer to refine@TestMethod(value="refine_StartingPartitionTest") public void refine(IAtomContainer atomContainer, Partition partition)
atomContainer
- the atom container to usepartition
- the initial partition of the atoms@TestMethod(value="isCanonical_TrueTest,isCanonical_FalseTest") public boolean isCanonical(IAtomContainer atomContainer)
refine(org.openscience.cdk.interfaces.IAtomContainer)
first.atomContainer
- the atom container to check@TestMethod(value="getAutomorphismGroupTest") public PermutationGroup getAutomorphismGroup(IAtomContainer atomContainer)
ignoreElements
flag in the constructor.atomContainer
- the atom container to use@TestMethod(value="getAutomorphismGroup_StartingGroupTest") public PermutationGroup getAutomorphismGroup(IAtomContainer atomContainer, PermutationGroup group)
atomContainer
- the atom container to usegroup
- the group of known automorphisms@TestMethod(value="getAutomorphismGroup_StartingPartitionTest") public PermutationGroup getAutomorphismGroup(IAtomContainer atomContainer, Partition initialPartition)
atomContainer
- the atom container to useinitialPartition
- an initial partition of the atoms@TestMethod(value="getAutomorphismPartitionTest") public Partition getAutomorphismPartition(IAtomContainer atomContainer)
atomContainer
- the molecule to calculate equivalence classes forCopyright © 2014. All Rights Reserved.