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
  • Nested Class Summary

    Nested classes/interfaces inherited from class signature.AbstractVertexSignature

    signature.AbstractVertexSignature.InvariantType
  • Field Summary

    Fields inherited from class signature.AbstractVertexSignature

    END_BRANCH_SYMBOL, END_NODE_SYMBOL, START_BRANCH_SYMBOL, START_NODE_SYMBOL, TMP_COLORING_COUNT
  • Constructor Summary

    Constructors
    Constructor
    Description
    AtomSignature(int atomIndex, int height, IAtomContainer molecule)
    Create an atom signature starting at atomIndex and with a maximum height of height.
    AtomSignature(int atomIndex, int height, signature.AbstractVertexSignature.InvariantType invariantType, IAtomContainer molecule)
    Create an atom signature starting at atomIndex, with maximum height of height, and using a particular invariant type.
    AtomSignature(int atomIndex, IAtomContainer molecule)
    Create an atom signature starting at atomIndex.
    AtomSignature(IAtom atom, int height, IAtomContainer molecule)
    Create an atom signature for the atom atom and with a maximum height of height.
    AtomSignature(IAtom atom, int height, signature.AbstractVertexSignature.InvariantType invariantType, IAtomContainer molecule)
    Create an atom signature for the atom atom, with maximum height of height, and using a particular invariant type.
    Create an atom signature for the atom atom.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
     
    protected int[]
    getConnected(int vertexIndex)
     
    protected String
    getEdgeLabel(int vertexIndex, int otherVertexIndex)
     
    protected int
    getIntLabel(int vertexIndex)
     
    protected String
    getVertexSymbol(int vertexIndex)
     

    Methods inherited from class signature.AbstractVertexSignature

    accept, canonize, create, createMaximumHeight, getCanonicalLabelling, getHeight, getOriginalVertexIndex, getVertexCount, parse, toCanonicalString, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AtomSignature

      public AtomSignature(int atomIndex, IAtomContainer molecule)
      Create an atom signature starting at atomIndex.
      Parameters:
      atomIndex - the index of the atom that roots this signature
      molecule - the molecule to create the signature from
    • AtomSignature

      public AtomSignature(IAtom atom, IAtomContainer molecule)
      Create an atom signature for the atom atom.
      Parameters:
      atom - the atom to make the signature for
      molecule - the molecule to create the signature from
    • AtomSignature

      public AtomSignature(int atomIndex, int height, IAtomContainer molecule)
      Create an atom signature starting at atomIndex and with a maximum height of height.
      Parameters:
      atomIndex - the index of the atom that roots this signature
      height - the maximum height of the signature
      molecule - the molecule to create the signature from
    • AtomSignature

      public AtomSignature(IAtom atom, int height, IAtomContainer molecule)
      Create an atom signature for the atom atom and with a maximum height of height.
      Parameters:
      atom - the index of the atom that roots this signature
      height - the maximum height of the signature
      molecule - 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 at atomIndex, with maximum height of height, and using a particular invariant type.
      Parameters:
      atomIndex - the index of the atom that roots this signature
      height - the maximum height of the signature
      invariantType - 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 atom atom, with maximum height of height, and using a particular invariant type.
      Parameters:
      atom - the index of the atom that roots this signature
      height - the maximum height of the signature
      invariantType - the type of invariant (int, string, ...)
      molecule - the molecule to create the signature from
  • Method Details

    • getIntLabel

      protected int getIntLabel(int vertexIndex)
      Specified by:
      getIntLabel in class signature.AbstractVertexSignature
    • getConnected

      protected int[] getConnected(int vertexIndex)
      Specified by:
      getConnected in class signature.AbstractVertexSignature
    • getEdgeLabel

      protected String getEdgeLabel(int vertexIndex, int otherVertexIndex)
      Specified by:
      getEdgeLabel in class signature.AbstractVertexSignature
    • getVertexSymbol

      protected String getVertexSymbol(int vertexIndex)
      Specified by:
      getVertexSymbol in class signature.AbstractVertexSignature
    • convertEdgeLabelToColor

      protected int convertEdgeLabelToColor(String edgeLabel)
      Specified by:
      convertEdgeLabelToColor in class signature.AbstractVertexSignature