Class MoleculeSignature


  • public class MoleculeSignature
    extends signature.AbstractGraphSignature

    A molecule signature is a way to produce AtomSignatures and to get the canonical [Faulon, J. L., Collins, M. J., and Carr, R. D.. Journal of Chemical Information and Computer Sciences. 2004. 44] 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 [Weininger, David. Journal of Chemical Information and Computer Sciences. 1988. 28, Weininger, David et. al.. Journal of Chemical Information and Computer Sciences. 1989. 29] 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 [Morgan, H.L.. J.Chem.Doc.. 1965. 5] 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:
     IAtomContainer 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.
    Author:
    maclean
    Source code:
    main
    Belongs to CDK module:
    signature
    • Constructor Detail

      • MoleculeSignature

        public MoleculeSignature​(IAtomContainer molecule)
        Creates a signature that represents this molecule.
        Parameters:
        molecule - the molecule to convert to a signature
      • MoleculeSignature

        public MoleculeSignature​(IAtomContainer molecule,
                                 int height)
        Creates a signature with a maximum height of height for molecule molecule.
        Parameters:
        molecule - the molecule to convert to a signature
        height - the maximum height of the signature
    • Method Detail

      • getVertexCount

        protected int getVertexCount()
        Specified by:
        getVertexCount in class signature.AbstractGraphSignature
      • signatureStringForVertex

        public String signatureStringForVertex​(int vertexIndex)
        Specified by:
        signatureStringForVertex in class signature.AbstractGraphSignature
      • signatureStringForVertex

        public String signatureStringForVertex​(int vertexIndex,
                                               int height)
        Specified by:
        signatureStringForVertex in class signature.AbstractGraphSignature
      • signatureForVertex

        public signature.AbstractVertexSignature signatureForVertex​(int vertexIndex)
        Specified by:
        signatureForVertex in class signature.AbstractGraphSignature
      • calculateOrbits

        public List<Orbit> calculateOrbits()
        Calculates the orbits of the atoms of the molecule.
        Returns:
        a list of orbits
      • fromSignatureString

        public static IAtomContainer fromSignatureString​(String signatureString,
                                                         IChemObjectBuilder coBuilder)
        Builder for molecules (rather, for atom containers) from signature strings.
        Parameters:
        signatureString - the signature string to use
        coBuilder - IChemObjectBuilder to build the returned atom container from
        Returns:
        an atom container
      • toCanonicalSignatureString

        public String toCanonicalSignatureString​(int height)
        Make a canonical signature string of a given height.
        Parameters:
        height - the maximum height to make signatures
        Returns:
        the canonical signature string