Class JcampdxReader

All Implemented Interfaces:
javajs.api.GenericLineReader, JmolJDXMOLReader

public class JcampdxReader extends MolReader implements JmolJDXMOLReader
A preliminary reader for JCAMP-DX files having ##$MODELS= and ##$PEAKS= records Designed by Robert Lancashire and Bob Hanson specifications (by example here): ##$MODELS= acetophenone DSViewer 3D 0 17 17 0 0 0 0 0 0 0 0999 V2000 ... 17 14 1 0 0 0 M END 17 1 Energy: -1454.38826 Freq: 3199.35852 C -1.693100 0.007800 0.000000 -0.000980 0.000120 0.000000 ... -- All XML data should be line-oriented in the above fashion. Leading spaces will be ignored. -- Any number of segments can be present -- The first model is referred to as the "base" model -- The base model: -- will generally be of type MOL, but any known type is acceptable -- will be used to generate bonding for later models that have no bonding information -- will be the only model for NMR -- Additional models can represent vibrations (XYZ format) or MS fragmentation (MOL format, probably) ##$PEAKS= ... -- peak record must be a single line of information because Jmol will use line.trim() as a key to pass information to JSpecView.

  • Field Details

    • selectedModel

      private int selectedModel
    • mpr

      private JmolJDXMOLParser mpr
    • acdMolFile

      private String acdMolFile
    • nPeaks

      private int nPeaks
    • acdAssignments

      private javajs.util.Lst<String[]> acdAssignments
    • title

      private String title
    • nucleus

      private String nucleus
    • type

      private String type
    • peakData

      private javajs.util.Lst<String> peakData
    • allTypes

      private String allTypes
  • Constructor Details

    • JcampdxReader

      public JcampdxReader()
  • Method Details

    • initializeReader

      public void initializeReader() throws Exception
      Overrides:
      initializeReader in class MolReader
      Throws:
      Exception
    • checkLine

      public boolean checkLine() throws Exception
      Overrides:
      checkLine in class MolReader
      Returns:
      true if need to read new line
      Throws:
      Exception
    • finalizeSubclassReader

      public void finalizeSubclassReader() throws Exception
      Description copied from class: AtomSetCollectionReader
      optional reader-specific method run first.
      Overrides:
      finalizeSubclassReader in class MolReader
      Throws:
      Exception
    • processModelData

      public void processModelData(String data, String id, String type, String base, String last, float modelScale, float vibScale, boolean isFirst) throws Exception
      Specified by:
      processModelData in interface JmolJDXMOLReader
      Throws:
      Exception
    • setBonding

      private void setBonding(AtomSetCollection a, int ibase)
      add bonding to a set of ModelData based on a MOL file only if the this set has no bonding already
      Parameters:
      a -
      ibase -
    • updateModelIDs

      private void updateModelIDs(String id, int model0, boolean isFirst)
      The first model set is allowed to be a single model and given no extension. All other model sets are given .1 .2 .3 ... extensions to their IDs.
      Parameters:
      id -
      model0 -
      isFirst -
    • addPeakData

      public void addPeakData(String info)
      Specified by:
      addPeakData in interface JmolJDXMOLReader
    • processPeakData

      private void processPeakData()
      integrate the records into the associated models, and delete unreferenced n.m models
    • findModelById

      private int findModelById(String modelID)
    • addType

      private void addType(int imodel, String type)
      sets an auxiliaryInfo string to "HNMR 13CNMR" or "IR" or "MS"
      Parameters:
      imodel -
      type -
    • addTypeStr

      private String addTypeStr(String types, String type)
    • processPeakSelectAtom

      private void processPeakSelectAtom(int i, String key, String data)
    • processPeakSelectModel

      private boolean processPeakSelectModel(int i, String title)
    • setSpectrumPeaks

      public void setSpectrumPeaks(int nH, String piUnitsX, String piUnitsY)
      Specified by:
      setSpectrumPeaks in interface JmolJDXMOLReader