@TestClass(value="org.openscience.cdk.signature.MoleculeSignatureTest") public class MoleculeSignature extends signature.AbstractGraphSignature
A molecule signature is a way to produce AtomSignature
s and to get
the canonical signature string for a molecule. There are
several possible uses for a molecule signature.
Firstly, a signature with a height greater than the diameter of a molecule can be used to reconstruct the molecule. In this sense, the signature string is like a SMILES string. It is more verbose, but it will work for all molecules.
Secondly, the set of signatures for a molecule partition the atoms into
equivalence classes (or 'orbits' - see the Orbit
class). This is
similar to partitioning atoms by Morgan number except that
it works for 3-regular graphs like fullerenes.
Thirdly, signatures can be calculated at different heights to give descriptions of the connectivity around atoms. 'Height' is the same as the idea of a 'sphere' in HOSE codes, and signatures are also path descriptors in this sense.
So, for example, to get the canonical signature for a molecule:IMolecule diamantane = MoleculeFactory.makeBenzene(); MoleculeSignature moleculeSignature = new MoleculeSignature(diamantane); String canonicalSignature = moleculeSignature.toCanonicalString();to get the orbits of this molecule:
List<Orbit> orbits = moleculeSignature.calculateOrbits();and to get the height-2 signature string of just atom 5:
String hSignatureForAtom5 = moleculeSignature.signatureStringForVertex(5, 2);it is also possible to get AtomSignatures using the signatureForVertex method - which is just a convenience method equivalent to calling the constructor of an AtomSignature class.
Constructor and Description |
---|
MoleculeSignature(IAtomContainer molecule)
Creates a signature that represents this molecule.
|
MoleculeSignature(IMolecule molecule,
int height)
Creates a signature with a maximum height of
height
for molecule molecule . |
Modifier and Type | Method and Description |
---|---|
List<Orbit> |
calculateOrbits()
Calculates the orbits of the atoms of the molecule.
|
static IAtomContainer |
fromSignatureString(String signatureString,
IChemObjectBuilder coBuilder)
Builder for molecules (rather, for atom containers) from signature
strings.
|
signature.AbstractVertexSignature |
signatureForVertex(int vertexIndex) |
String |
signatureStringForVertex(int vertexIndex) |
String |
signatureStringForVertex(int vertexIndex,
int height) |
String |
toCanonicalSignatureString(int height)
Make a canonical signature string of a given height.
|
getCanonicalLabels, getGraphSignature, getHeight, getMaximalSignature, getMinimalSignature, getSortedSignatures, getSymmetryClasses, getSymmetryClasses, getVertexSignatures, getVertexSignatureStrings, isCanonicallyLabelled, reconstructCanonicalEdgeString, reconstructCanonicalGraph, toCanonicalString, toFullString
public MoleculeSignature(IAtomContainer molecule)
molecule
- the molecule to convert to a signaturepublic MoleculeSignature(IMolecule molecule, int height)
height
for molecule molecule
.molecule
- the molecule to convert to a signatureheight
- the maximum height of the signature@TestMethod(value="getSignatureStringForVertexTest") public String signatureStringForVertex(int vertexIndex)
signatureStringForVertex
in class signature.AbstractGraphSignature
@TestMethod(value="getSignatureStringForVertexTest_height") public String signatureStringForVertex(int vertexIndex, int height)
signatureStringForVertex
in class signature.AbstractGraphSignature
@TestMethod(value="getSignatureForVertexTest") public signature.AbstractVertexSignature signatureForVertex(int vertexIndex)
signatureForVertex
in class signature.AbstractGraphSignature
@TestMethod(value="calculateOrbitsTest") public List<Orbit> calculateOrbits()
@TestMethod(value="fromSignatureStringTest") public static IAtomContainer fromSignatureString(String signatureString, IChemObjectBuilder coBuilder)
signatureString
- the signature string to usecoBuilder
- IChemObjectBuilder
to build the returned atom container from@TestMethod(value="toCanonicalSignatureStringTest") public String toCanonicalSignatureString(int height)
height
- the maximum height to make signatures