MolReader
Date: 2019-10-22

org.jmol.adapter.readers.molxyz

## Class MolReader

- java.lang.Object
- - org.jmol.adapter.smarter.AtomSetCollectionReader
  - - org.jmol.adapter.readers.molxyz.MolReader

- All Implemented Interfaces:
    javajs.api.GenericLineReader
  Direct Known Subclasses:
    JcampdxReader, Mol3DReader

      public class MolReader
      extends AtomSetCollectionReader

  A reader for MDLI mol and sdf files.

  http://www.mdli.com/downloads/public/ctfile/ctfile.jsp

  also: http://www.mdl.com/downloads/public/ctfile/ctfile.pdf simple symmetry extension via load command: 9/2006 hansonr@stolaf.edu setAtomCoord(atom, x, y, z) applySymmetryAndSetTrajectory() simple 2D-->3D conversion using load "xxx.mol" FILTER "2D" Jmol 14.8.2 adds bond type 15 (quintuple) and 16 (sextuple)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `allow2D`
    `private int` | `atomCount`
    `private java.lang.String[]` | `atomData`
    `private boolean` | `haveAtomSerials`
    `private int` | `iatom0`
    `private boolean` | `is2D`
    `private boolean` | `optimize2D`
    `private V3000Rdr` | `vr`

    - ### Fields inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader

      `addedData, addedDataKey, addVibrations, allowPDBFilter, ANGSTROMS_PER_BOHR, applySymmetryToBonds, asc, baseAtomIndex, binaryDoc, bsFilter, bsModels, calculationType, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterHetero, fixJavaFloat, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isTrajectory, latticeCells, latticeScaling, latticeType, line, lstNCS, matUnitCellOrientation, modDim, modelNumber, ms, mustFinalizeModelSet, next, out, packingError, prevline, primitiveToCrystal, ptLine, ptSupercell, reader, readerName, requiresBSFilter, reverseModels, rotateHexCell, sgName, stateScriptVersionInt, strSupercell, symmetry, templateAtomCount, thisBiomolecule, trajectorySteps, unitCellOffset, unitCellParams, useAltNames, useFileModelNumbers, validation, vibrationNumber, vibsFractional, vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MolReader()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addMolAtom(int iAtom, int isotope, java.lang.String elementSymbol, int charge, float x, float y, float z)`
    `void` | `addMolBond(java.lang.String iAtom1, java.lang.String iAtom2, int order, int stereo)`
    `protected boolean` | `checkLine()`
    `protected void` | `finalizeReaderMR()`
    `void` | `finalizeSubclassReader()` optional reader-specific method run first.
    `(package private) int` | `fixOrder(int order, int stereo)`
    `void` | `initializeReader()`
    `private void` | `processCtab(boolean isMDL)`
    `private void` | `processMolSdHeader()`
    `private void` | `readAtomsAndBonds(int ac, int bc)`
    `private void` | `readAtomValues()` Read all V nnn lines as string data; user can adapt as needed.
    `private void` | `readIsotopes()` Read all M ISO lines.
    `private void` | `readMolData(java.util.Map<java.lang.String,java.lang.Object> molData, javajs.util.Lst<java.lang.String> _keyList)` Read the SDF data with name in lower case
    `private void` | `set2D(boolean b)`

    - ### Methods inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader

      `addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addSites, addSiteScript, appendLoadNote, appendUunitCellInfo, applySymmetryAndSetTrajectory, applySymTrajASCR, checkCurrentLineForScript, checkFilterKey, checkLastModel, checkLineForScript, clearUnitCell, cloneLastAtomSet, discardLinesUntilBlank, discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, discardLinesUntilStartsWith, discardPreviousAtoms, doGetModel, doGetVibration, doPreSymmetry, fill3x3, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, finalizeSubclassSymmetry, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFortranFormatLengths, getInterface, getNewSymmetry, getStrings, getSymmetry, getTokens, getTokensFloat, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, parseToken, parseTokenNext, parseTokenRange, parseTokenStr, processBinaryDocument, processDOM, rd, read3Vectors, readDataObject, readLines, readNextLine, rejectAtomName, RL, set2D, setAtomCoord, setAtomCoordScaled, setAtomCoordTokens, setAtomCoordXYZ, setChainID, setElementAndIsotope, setFilter, setFilterAtomTypeStr, setFractionalCoordinates, setIsPDB, setLoadNote, setModelPDB, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem, setup, setupASCR`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### optimize2D

          private boolean optimize2D

    - #### haveAtomSerials

          private boolean haveAtomSerials

    - #### allow2D

          protected boolean allow2D

    - #### iatom0

          private int iatom0

    - #### vr

          private V3000Rdr vr

    - #### atomCount

          private int atomCount

    - #### atomData

          private java.lang.String[] atomData

    - #### is2D

          private boolean is2D

  - ### Constructor Detail

    - #### MolReader

          public MolReader()

  - ### Method Detail

    - #### initializeReader

          public void initializeReader()
                                throws java.lang.Exception

      Overrides:
        `initializeReader` in class `AtomSetCollectionReader`
      Throws:
        `java.lang.Exception`

    - #### checkLine

          protected boolean checkLine()
                               throws java.lang.Exception

      Overrides:
        `checkLine` in class `AtomSetCollectionReader`
      Returns:
        true if need to read new line
      Throws:
        `java.lang.Exception`

    - #### finalizeSubclassReader

          public void finalizeSubclassReader()
                                      throws java.lang.Exception

      Description copied from class: `AtomSetCollectionReader`
      optional reader-specific method run first.
      Overrides:
        `finalizeSubclassReader` in class `AtomSetCollectionReader`
      Throws:
        `java.lang.Exception`

    - #### finalizeReaderMR

          protected void finalizeReaderMR()
                                   throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### processMolSdHeader

          private void processMolSdHeader()
                                   throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### processCtab

          private void processCtab(boolean isMDL)
                            throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### readAtomsAndBonds

          private void readAtomsAndBonds(int ac,
                                         int bc)
                                  throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### set2D

          private void set2D(boolean b)

    - #### readAtomValues

          private void readAtomValues()
                               throws java.lang.Exception

      Read all V nnn lines as string data; user can adapt as needed.
      Throws:
        `java.lang.Exception`

    - #### readIsotopes

          private void readIsotopes()
                             throws java.lang.Exception

      Read all M ISO lines. These are absolute isotope numbers.
      Throws:
        `java.lang.Exception`

    - #### readMolData

          private void readMolData(java.util.Map<java.lang.String,java.lang.Object> molData,
                                   javajs.util.Lst<java.lang.String> _keyList)
                            throws java.lang.Exception

      Read the SDF data with name in lower case
      Parameters:
        `molData` -
        `_keyList` -
      Throws:
        `java.lang.Exception`

    - #### addMolAtom

          public void addMolAtom(int iAtom,
                                 int isotope,
                                 java.lang.String elementSymbol,
                                 int charge,
                                 float x,
                                 float y,
                                 float z)

    - #### fixOrder

          int fixOrder(int order,
                       int stereo)

    - #### addMolBond

          public void addMolBond(java.lang.String iAtom1,
                                 java.lang.String iAtom2,
                                 int order,
                                 int stereo)