Class AtomSignature
- java.lang.Object
-
- signature.AbstractVertexSignature
-
- org.openscience.cdk.signature.AtomSignature
-
public class AtomSignature extends signature.AbstractVertexSignature
The signature [Faulon, J. L., Visco, D. P., and Pophale, R. S.. Journal of Chemical Information and Computer Sciences. 2003. 43, Faulon, J. L., Collins, M. J., and Carr, R. D.. Journal of Chemical Information and Computer Sciences. 2004. 44] for a molecule rooted at a particular atom.
A signature is a description of the connectivity of a molecule, in the form of a tree-like structure called a directed acyclic graph (DAG). This DAG can be written out as a string, for example ethane:
[C]([C]([H][H][H])[H][H][H])
where each atom is represented by an atom symbol in square brackets. The branching of the tree is indicated by round brackets. When the molecule has a cycle, the signature string will have numbers after the atom symbol, like:
[C]([C]([C,0])[C]([C,0]))
these are known as 'colors' and indicate ring closures, in a roughly similar way to SMILES notation. Note that the colors start from 0 in this implementation, in contrast to the examples in [Faulon, J. L., Collins, M. J., and Carr, R. D.. Journal of Chemical Information and Computer Sciences. 2004. 44].
Multiple bonds are represented by symbols in front of the opening square bracket of an atom. Double bonds are '=', triple are '#'. Since there is a defined direction for the signature tree, only the child node will have the bond symbol, and the relevant bond is to the parent.
- Author:
- maclean
- Source code:
- main
- Belongs to CDK module:
- signature
-
-
Constructor Summary
Constructors Constructor Description AtomSignature(int atomIndex, int height, IAtomContainer molecule)
Create an atom signature starting atatomIndex
and with a maximum height ofheight
.AtomSignature(int atomIndex, int height, signature.AbstractVertexSignature.InvariantType invariantType, IAtomContainer molecule)
Create an atom signature starting atatomIndex
, with maximum height ofheight
, and using a particular invariant type.AtomSignature(int atomIndex, IAtomContainer molecule)
Create an atom signature starting atatomIndex
.AtomSignature(IAtom atom, int height, IAtomContainer molecule)
Create an atom signature for the atomatom
and with a maximum height ofheight
.AtomSignature(IAtom atom, int height, signature.AbstractVertexSignature.InvariantType invariantType, IAtomContainer molecule)
Create an atom signature for the atomatom
, with maximum height ofheight
, and using a particular invariant type.AtomSignature(IAtom atom, IAtomContainer molecule)
Create an atom signature for the atomatom
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
convertEdgeLabelToColor(String edgeLabel)
protected int[]
getConnected(int vertexIndex)
protected String
getEdgeLabel(int vertexIndex, int otherVertexIndex)
protected int
getIntLabel(int vertexIndex)
protected String
getVertexSymbol(int vertexIndex)
-
-
-
Constructor Detail
-
AtomSignature
public AtomSignature(int atomIndex, IAtomContainer molecule)
Create an atom signature starting atatomIndex
.- Parameters:
atomIndex
- the index of the atom that roots this signaturemolecule
- the molecule to create the signature from
-
AtomSignature
public AtomSignature(IAtom atom, IAtomContainer molecule)
Create an atom signature for the atomatom
.- Parameters:
atom
- the atom to make the signature formolecule
- the molecule to create the signature from
-
AtomSignature
public AtomSignature(int atomIndex, int height, IAtomContainer molecule)
Create an atom signature starting atatomIndex
and with a maximum height ofheight
.- Parameters:
atomIndex
- the index of the atom that roots this signatureheight
- the maximum height of the signaturemolecule
- the molecule to create the signature from
-
AtomSignature
public AtomSignature(IAtom atom, int height, IAtomContainer molecule)
Create an atom signature for the atomatom
and with a maximum height ofheight
.- Parameters:
atom
- the index of the atom that roots this signatureheight
- the maximum height of the signaturemolecule
- the molecule to create the signature from
-
AtomSignature
public AtomSignature(int atomIndex, int height, signature.AbstractVertexSignature.InvariantType invariantType, IAtomContainer molecule)
Create an atom signature starting atatomIndex
, with maximum height ofheight
, and using a particular invariant type.- Parameters:
atomIndex
- the index of the atom that roots this signatureheight
- the maximum height of the signatureinvariantType
- the type of invariant (int, string, ...)molecule
- the molecule to create the signature from
-
AtomSignature
public AtomSignature(IAtom atom, int height, signature.AbstractVertexSignature.InvariantType invariantType, IAtomContainer molecule)
Create an atom signature for the atomatom
, with maximum height ofheight
, and using a particular invariant type.- Parameters:
atom
- the index of the atom that roots this signatureheight
- the maximum height of the signatureinvariantType
- the type of invariant (int, string, ...)molecule
- the molecule to create the signature from
-
-
Method Detail
-
getIntLabel
protected int getIntLabel(int vertexIndex)
- Specified by:
getIntLabel
in classsignature.AbstractVertexSignature
-
getConnected
protected int[] getConnected(int vertexIndex)
- Specified by:
getConnected
in classsignature.AbstractVertexSignature
-
getEdgeLabel
protected String getEdgeLabel(int vertexIndex, int otherVertexIndex)
- Specified by:
getEdgeLabel
in classsignature.AbstractVertexSignature
-
getVertexSymbol
protected String getVertexSymbol(int vertexIndex)
- Specified by:
getVertexSymbol
in classsignature.AbstractVertexSignature
-
convertEdgeLabelToColor
protected int convertEdgeLabelToColor(String edgeLabel)
- Specified by:
convertEdgeLabelToColor
in classsignature.AbstractVertexSignature
-
-