Class MolfileV3Creator


  • public class MolfileV3Creator
    extends java.lang.Object
    This class generates an MDL molfile version 3.0 from a StereoMolecule as described by MDL in 'CTFile Formats June 2005'. Since the MDL enhanced stereo recognition concept doesn't include support for axial chirality as bond property, we added object type 'BONDS' to the internal collection types STEABS,STERAC and STEREL, in order to properly encode ESR assignments of axial stereo bonds, e.g. BINAP kind of stereo bonds.
    Author:
    sandert
    • Constructor Summary

      Constructors 
      Constructor Description
      MolfileV3Creator​(StereoMolecule mol)
      This creates a new molfile version 3 from the given molecule.
      MolfileV3Creator​(StereoMolecule mol, boolean allowScaling)
      This creates a new molfile version 3 from the given molecule.
      MolfileV3Creator​(StereoMolecule mol, boolean allowScaling, double scalingFactor, java.lang.StringBuilder builder)
      This creates a new molfile version 3 from the given molecule.
      MolfileV3Creator​(StereoMolecule mol, boolean allowScaling, java.lang.StringBuilder builder)
      This creates a new molfile version 3 from the given molecule.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getMolfile()
      If a pre-filled StringBuilder was passed to the constructor, then this returns the original content with the appended molfile.
      double getScalingFactor()  
      static java.lang.String writeCTAB​(StereoMolecule mol, double scalingFactor)  
      void writeMolfile​(java.io.Writer theWriter)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MolfileV3Creator

        public MolfileV3Creator​(StereoMolecule mol)
        This creates a new molfile version 3 from the given molecule. If the average bond length is smaller than 1.0 or larger than 3.0, then all coordinates are scaled to achieve an average bond length of 1.5.
        Parameters:
        mol -
      • MolfileV3Creator

        public MolfileV3Creator​(StereoMolecule mol,
                                boolean allowScaling)
        This creates a new molfile version 3 from the given molecule. If allowScaling==true and the average bond length is smaller than 1.0 or larger than 3.0, then all coordinates are scaled to achieve an average bond length of 1.5.
        Parameters:
        mol -
        allowScaling -
      • MolfileV3Creator

        public MolfileV3Creator​(StereoMolecule mol,
                                boolean allowScaling,
                                java.lang.StringBuilder builder)
        This creates a new molfile version 3 from the given molecule. If allowScaling==true and the average bond length is smaller than 1.0 or larger than 3.0, then all coordinates are scaled to achieve an average bond length of 1.5. If a StringBuilder is given, then the molfile will be appended to that.
        Parameters:
        mol -
        allowScaling -
        builder - null or StringBuilder to append to
      • MolfileV3Creator

        public MolfileV3Creator​(StereoMolecule mol,
                                boolean allowScaling,
                                double scalingFactor,
                                java.lang.StringBuilder builder)
        This creates a new molfile version 3 from the given molecule. If allowScaling==true and the average bond length is smaller than 1.0 or larger than 3.0, then all coordinates are scaled to achieve an average bond length of 1.5. If a StringBuilder is given, then the molfile will be appended to that.
        Parameters:
        mol -
        allowScaling -
        builder - null or StringBuilder to append to
    • Method Detail

      • writeCTAB

        public static java.lang.String writeCTAB​(StereoMolecule mol,
                                                 double scalingFactor)
        Parameters:
        mol -
        scalingFactor -
        Returns:
        a CTAB V3 with scaled atom coordinates
      • getMolfile

        public java.lang.String getMolfile()
        If a pre-filled StringBuilder was passed to the constructor, then this returns the original content with the appended molfile.
        Returns:
      • getScalingFactor

        public double getScalingFactor()
      • writeMolfile

        public void writeMolfile​(java.io.Writer theWriter)
                          throws java.io.IOException
        Throws:
        java.io.IOException