Class AtomSetCollectionReader

java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
All Implemented Interfaces:
javajs.api.GenericLineReader
Direct Known Subclasses:
AbinitReader, AimsReader, AlchemyReader, AmpacReader, BasisFunctionReader, BilbaoReader, BinaryDcdReader, CastepReader, CgdReader, CifReader, CrystalReader, CubeReader, DmolReader, EspressoReader, FAHReader, FoldingXyzReader, ForceFieldReader, GaussianWfnReader, GhemicalMMReader, GromacsReader, GulpReader, HyperChemReader, InputReader, JanaReader, JmeReader, JSONReader, MagresReader, MdCrdReader, MolReader, MopacReader, OptimadeReader, OrcaReader, PdbReader, PWmatReader, ShelxReader, SiestaReader, TlsDataOnlyReader, VaspOutcarReader, VaspPoscarReader, Wien2kReader, XcrysdenReader, XmlReader, XyzReader

public abstract class AtomSetCollectionReader extends Object implements javajs.api.GenericLineReader
  • Field Details

    • ANGSTROMS_PER_BOHR

      public static final float ANGSTROMS_PER_BOHR
      See Also:
    • CELL_TYPE_CONVENTIONAL

      protected static final String CELL_TYPE_CONVENTIONAL
      See Also:
    • CELL_TYPE_PRIMITIVE

      protected static final String CELL_TYPE_PRIMITIVE
      See Also:
    • isBinary

      public boolean isBinary
    • debugging

      public boolean debugging
    • requiresBSFilter

      protected boolean requiresBSFilter
    • primitiveToCrystal

      public javajs.util.M3 primitiveToCrystal
    • asc

      public AtomSetCollection asc
    • reader

      protected BufferedReader reader
    • binaryDoc

      protected javajs.api.GenericBinaryDocument binaryDoc
    • readerName

      protected String readerName
    • htParams

      public Map<String,Object> htParams
    • trajectorySteps

      public javajs.util.Lst<javajs.util.P3[]> trajectorySteps
    • domains

      private Object domains
    • validation

      public Object validation
    • dssr

      public Object dssr
    • isConcatenated

      protected boolean isConcatenated
    • addedData

      public String addedData
    • addedDataKey

      public String addedDataKey
    • fixJavaFloat

      public boolean fixJavaFloat
    • thisBiomolecule

      public Map<String,Object> thisBiomolecule
    • lstNCS

      public javajs.util.Lst<javajs.util.M4> lstNCS
    • line

      public String line
    • prevline

      public String prevline
    • next

      protected int[] next
    • ptLine

      protected int ptLine
    • latticeType

      protected String latticeType
    • latticeCells

      public int[] latticeCells
    • fillRange

      public Object fillRange
    • doProcessLines

      public boolean doProcessLines
    • iHaveUnitCell

      public boolean iHaveUnitCell
    • iHaveSymmetryOperators

      public boolean iHaveSymmetryOperators
    • continuing

      public boolean continuing
    • vwr

      public Viewer vwr
    • doApplySymmetry

      public boolean doApplySymmetry
    • ignoreFileSymmetryOperators

      protected boolean ignoreFileSymmetryOperators
    • isTrajectory

      protected boolean isTrajectory
    • applySymmetryToBonds

      public boolean applySymmetryToBonds
    • doCheckUnitCell

      protected boolean doCheckUnitCell
    • getHeader

      protected boolean getHeader
    • isSequential

      protected boolean isSequential
    • isMolecular

      public boolean isMolecular
    • templateAtomCount

      protected int templateAtomCount
    • modelNumber

      public int modelNumber
    • vibrationNumber

      public int vibrationNumber
    • desiredVibrationNumber

      public int desiredVibrationNumber
    • bsModels

      protected javajs.util.BS bsModels
    • useFileModelNumbers

      protected boolean useFileModelNumbers
    • havePartialChargeFilter

      protected boolean havePartialChargeFilter
    • calculationType

      public String calculationType
    • sgName

      protected String sgName
    • ignoreFileUnitCell

      protected boolean ignoreFileUnitCell
    • ignoreFileSpaceGroupName

      protected boolean ignoreFileSpaceGroupName
    • unitCellParams

      public float[] unitCellParams
    • desiredModelNumber

      protected int desiredModelNumber
    • symmetry

      public SymmetryInterface symmetry
    • out

      protected javajs.util.OC out
    • iHaveFractionalCoordinates

      protected boolean iHaveFractionalCoordinates
    • doPackUnitCell

      public boolean doPackUnitCell
    • ptSupercell

      protected javajs.util.P3 ptSupercell
    • mustFinalizeModelSet

      protected boolean mustFinalizeModelSet
    • forcePacked

      protected boolean forcePacked
    • packingError

      public float packingError
    • rotateHexCell

      protected boolean rotateHexCell
    • isPrimitive

      protected boolean isPrimitive
    • modDim

      public int modDim
    • loadNote

      private javajs.util.SB loadNote
    • doConvertToFractional

      public boolean doConvertToFractional
    • fileCoordinatesAreFractional

      boolean fileCoordinatesAreFractional
    • merging

      protected boolean merging
    • symmetryRange

      float symmetryRange
    • firstLastStep

      private int[] firstLastStep
    • lastModelNumber

      private int lastModelNumber
    • desiredSpaceGroupIndex

      public int desiredSpaceGroupIndex
    • fileScaling

      protected javajs.util.P3 fileScaling
    • latticeScaling

      protected float latticeScaling
    • fileOffset

      protected javajs.util.P3 fileOffset
    • fileOffsetFractional

      private javajs.util.P3 fileOffsetFractional
    • unitCellOffset

      protected javajs.util.P3 unitCellOffset
    • unitCellOffsetFractional

      private boolean unitCellOffsetFractional
    • moreUnitCellInfo

      private javajs.util.Lst<String> moreUnitCellInfo
    • paramsLattice

      public javajs.util.T3 paramsLattice
    • paramsCentroid

      public boolean paramsCentroid
    • paramsPacked

      private boolean paramsPacked
    • filePath

      protected String filePath
    • fileName

      protected String fileName
    • baseAtomIndex

      public int baseAtomIndex
      first atom index for this collection, current modelset.ac
    • baseBondIndex

      public int baseBondIndex
    • stateScriptVersionInt

      protected int stateScriptVersionInt
    • isFinalized

      protected boolean isFinalized
    • noPack

      protected boolean noPack
    • haveModel

      protected boolean haveModel
    • previousSpaceGroup

      private String previousSpaceGroup
    • previousUnitCell

      private float[] previousUnitCell
    • nMatrixElements

      private int nMatrixElements
    • ucItems

      public float[] ucItems
    • matUnitCellOrientation

      protected javajs.util.M3 matUnitCellOrientation
    • bsFilter

      protected javajs.util.BS bsFilter
    • filter

      public String filter
    • filterCased

      public String filterCased
    • haveAtomFilter

      public boolean haveAtomFilter
    • filterAltLoc

      private boolean filterAltLoc
    • filterGroup3

      private boolean filterGroup3
    • filterChain

      private boolean filterChain
    • filterAtomName

      private boolean filterAtomName
    • filterAtomType

      private boolean filterAtomType
    • filterAtomTypeStr

      private String filterAtomTypeStr
    • filterAtomNameTerminator

      private String filterAtomNameTerminator
    • filterElement

      private boolean filterElement
    • filterHetero

      protected boolean filterHetero
    • filterAllHetero

      protected boolean filterAllHetero
    • filterEveryNth

      private boolean filterEveryNth
    • filterSymop

      String filterSymop
    • filterN

      private int filterN
    • nFiltered

      private int nFiltered
    • doSetOrientation

      private boolean doSetOrientation
    • doCentralize

      protected boolean doCentralize
    • addVibrations

      protected boolean addVibrations
    • useAltNames

      protected boolean useAltNames
    • ignoreStructure

      protected boolean ignoreStructure
    • isDSSP1

      protected boolean isDSSP1
    • allowPDBFilter

      protected boolean allowPDBFilter
    • doReadMolecularOrbitals

      public boolean doReadMolecularOrbitals
    • reverseModels

      protected boolean reverseModels
    • nameRequired

      private String nameRequired
    • doCentroidUnitCell

      public boolean doCentroidUnitCell
    • centroidPacked

      public boolean centroidPacked
    • strSupercell

      public String strSupercell
    • allow_a_len_1

      public boolean allow_a_len_1
    • slabXY

      public boolean slabXY
    • polymerX

      private boolean polymerX
    • filter1

      private String filter1
    • filter2

      private String filter2
    • filter1Cased

      private String filter1Cased
    • filter2Cased

      private String filter2Cased
    • matRot

      private javajs.util.M3 matRot
    • ms

      public MSInterface ms
    • vibsFractional

      public boolean vibsFractional
    • previousScript

      private String previousScript
    • siteScript

      private String siteScript
  • Constructor Details

    • AtomSetCollectionReader

      public AtomSetCollectionReader()
  • Method Details

    • setup

      protected void setup(String fullPath, Map<String,Object> htParams, Object readerOrDocument)
    • setupASCR

      protected void setupASCR(String fullPath, Map<String,Object> htParams, Object readerOrDocument)
    • readData

      Object readData() throws Exception
      Throws:
      Exception
    • fixBaseIndices

      private void fixBaseIndices()
    • readDataObject

      protected Object readDataObject(Object node) throws Exception
      Throws:
      Exception
    • processDOM

      protected void processDOM(Object DOMNode)
      Parameters:
      DOMNode -
    • processBinaryDocument

      protected void processBinaryDocument() throws Exception
      Throws:
      Exception
    • initializeReader

      protected void initializeReader() throws Exception
      Throws:
      Exception
    • checkLine

      protected boolean checkLine() throws Exception
      Returns:
      true if need to read new line
      Throws:
      Exception
    • checkLastModel

      public boolean checkLastModel()
      sets continuing and doProcessLines
      Returns:
      TRUE if continuing, FALSE if not
    • isLastModel

      public boolean isLastModel(int modelNumber)
      after reading a model, Q: Is this the last model?
      Parameters:
      modelNumber -
      Returns:
      Yes/No
    • appendLoadNote

      public void appendLoadNote(String info)
    • initializeTrajectoryFile

      protected void initializeTrajectoryFile()
    • finalizeSubclassReader

      protected void finalizeSubclassReader() throws Exception
      optional reader-specific method run first.
      Throws:
      Exception
    • finalizeReaderASCR

      protected void finalizeReaderASCR() throws Exception
      Throws:
      Exception
    • setLoadNote

      protected String setLoadNote()
    • setIsPDB

      public void setIsPDB()
    • setModelPDB

      protected void setModelPDB(boolean isPDB)
    • finish

      private Object finish()
    • setError

      private void setError(Throwable e)
      Parameters:
      e -
    • initialize

      private void initialize()
    • initializeSymmetryOptions

      protected void initializeSymmetryOptions()
    • doGetModel

      public boolean doGetModel(int modelNumber, String title)
    • discardPreviousAtoms

      protected void discardPreviousAtoms()
    • initializeSymmetry

      protected final void initializeSymmetry()
    • newAtomSet

      protected void newAtomSet(String name)
    • cloneLastAtomSet

      protected int cloneLastAtomSet(int ac, javajs.util.P3[] pts) throws Exception
      Throws:
      Exception
    • setSpaceGroupName

      public void setSpaceGroupName(String name)
    • setSymmetryOperator

      public int setSymmetryOperator(String xyz)
    • initializeCartesianToFractional

      private void initializeCartesianToFractional()
    • clearUnitCell

      public void clearUnitCell()
    • setUnitCellItem

      public void setUnitCellItem(int i, float x)
    • setUnitCell

      public void setUnitCell(float a, float b, float c, float alpha, float beta, float gamma)
    • addExplicitLatticeVector

      public void addExplicitLatticeVector(int i, float[] xyz, int i0)
    • checkUnitCell

      private boolean checkUnitCell(int n)
    • getSymmetry

      public SymmetryInterface getSymmetry()
    • checkUnitCellOffset

      private void checkUnitCellOffset()
    • fractionalizeCoordinates

      protected void fractionalizeCoordinates(boolean toFrac)
    • getNewSymmetry

      protected SymmetryInterface getNewSymmetry()
    • setFractionalCoordinates

      public void setFractionalCoordinates(boolean TF)
    • setFilterAtomTypeStr

      protected void setFilterAtomTypeStr(String s)
    • setFilter

      protected void setFilter(String filter0)
    • getFilterWithCase

      public String getFilterWithCase(String key)
    • getFilter

      public String getFilter(String key)
    • checkFilterKey

      public boolean checkFilterKey(String key)
    • checkAndRemoveFilterKey

      public boolean checkAndRemoveFilterKey(String key)
      Parameters:
      key -
      Returns:
      true if the key existed; filter is set null if this is the only key
    • filterAtom

      protected boolean filterAtom(Atom atom, int iAtom)
      Parameters:
      atom -
      iAtom -
      Returns:
      true if we want this atom
    • checkFilter

      private boolean checkFilter(Atom atom, String f, String fCased)
      Parameters:
      atom -
      f -
      fCased -
      Returns:
      true if a filter is found
    • rejectAtomName

      public boolean rejectAtomName(String name)
    • allowAtomName

      private boolean allowAtomName(String atomName, String f)
    • filterReject

      protected boolean filterReject(String f, String code, String atomCode)
    • set2D

      protected void set2D()
    • doGetVibration

      public boolean doGetVibration(int vibrationNumber)
    • setTransform

      public void setTransform(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3)
    • setAtomCoordXYZ

      public void setAtomCoordXYZ(Atom atom, float x, float y, float z)
    • setAtomCoordScaled

      public Atom setAtomCoordScaled(Atom atom, String[] tokens, int i, float f)
    • setAtomCoordTokens

      protected void setAtomCoordTokens(Atom atom, String[] tokens, int i)
    • addAtomXYZSymName

      public Atom addAtomXYZSymName(String[] tokens, int i, String sym, String name)
    • setAtomCoord

      public void setAtomCoord(Atom atom)
    • addSites

      public void addSites(Map<String,Map<String,Object>> htSites)
    • applySymmetryAndSetTrajectory

      public void applySymmetryAndSetTrajectory() throws Exception
      Throws:
      Exception
    • applySymTrajASCR

      public SymmetryInterface applySymTrajASCR() throws Exception
      Throws:
      Exception
    • finalizeSubclassSymmetry

      protected void finalizeSubclassSymmetry(boolean haveSymmetry) throws Exception
      Parameters:
      haveSymmetry -
      Throws:
      Exception
    • doPreSymmetry

      protected void doPreSymmetry() throws Exception
      Throws:
      Exception
    • finalizeMOData

      public void finalizeMOData(Map<String,Object> moData)
    • getElementSymbol

      public static String getElementSymbol(int elementNumber)
    • fillDataBlock

      protected void fillDataBlock(String[][] data, int minLineLen) throws Exception
      fills an array with a pre-defined number of lines of token data, skipping blank lines in the process
      Parameters:
      data -
      minLineLen - TODO
      Throws:
      Exception
    • fill3x3

      protected double[][] fill3x3(String[] tokens, int pt) throws Exception
      fills a double[3][3]
      Parameters:
      tokens - or null if to read each line for three values (as last 3 on line)
      pt - initial index; if tokens == null, then negative index is from end of each line
      Returns:
      double[3][3]
      Throws:
      Exception
    • fillFloatArray

      protected float[] fillFloatArray(String s, int width, float[] data) throws Exception
      fills a float array with string data from a file
      Parameters:
      s - string data containing floats
      width - column width or 0 to read tokens
      data - result data to be filled
      Returns:
      data
      Throws:
      Exception
    • fillFrequencyData

      protected void fillFrequencyData(int iAtom0, int ac, int modelAtomCount, boolean[] ignore, boolean isWide, int col0, int colWidth, int[] atomIndexes, int minLineLen, String[][] data) throws Exception
      Extracts a block of frequency data from a file. This block may be of two types -- either X Y Z across a row or each of X Y Z on a separate line. Data is presumed to be in fixed FORTRAN-like column format, not space-separated columns.
      Parameters:
      iAtom0 - the first atom to be assigned a frequency
      ac - the number of atoms to be assigned
      modelAtomCount - the number of atoms in each model
      ignore - the frequencies to ignore because the user has selected only certain vibrations to be read or for whatever reason; length serves to set the number of frequencies to be read
      isWide - when TRUE, this is a table that has X Y Z for each mode within the same row; when FALSE, this is a table that has X Y Z for each mode on a separate line.
      col0 - the column in which data starts
      colWidth - the width of the data columns
      atomIndexes - an array either null or indicating exactly which atoms get the frequencies (used by CrystalReader)
      minLineLen - TODO
      data - TODO
      Throws:
      Exception
    • fillDataBlockFixed

      protected void fillDataBlockFixed(String[][] data, int col0, int colWidth, int minLineLen) throws Exception
      Fills an array with a predefined number of lines of data that is arranged in fixed FORTRAN-like column format. Used exclusively for frequency data
      Parameters:
      data -
      col0 -
      colWidth -
      minLineLen - or -ptNonblank
      Throws:
      Exception
    • readLines

      protected String readLines(int nLines) throws Exception
      Throws:
      Exception
    • discardLinesUntilStartsWith

      public String discardLinesUntilStartsWith(String startsWith) throws Exception
      Throws:
      Exception
    • discardLinesUntilContains

      public String discardLinesUntilContains(String containsMatch) throws Exception
      Throws:
      Exception
    • discardLinesUntilContains2

      public String discardLinesUntilContains2(String s1, String s2) throws Exception
      Throws:
      Exception
    • discardLinesUntilBlank

      public String discardLinesUntilBlank() throws Exception
      Throws:
      Exception
    • discardLinesUntilNonBlank

      public String discardLinesUntilNonBlank() throws Exception
      Throws:
      Exception
    • checkLineForScript

      protected void checkLineForScript(String line)
    • checkCurrentLineForScript

      public void checkCurrentLineForScript()
    • addJmolScript

      public void addJmolScript(String script)
    • addSiteScript

      protected void addSiteScript(String script)
    • rd

      public String rd() throws Exception
      Throws:
      Exception
    • RL

      public String RL() throws Exception
      Throws:
      Exception
    • getStrings

      protected static final String[] getStrings(String sinfo, int nFields, int width)
    • getTokens

      public String[] getTokens()
    • getTokensFloat

      public static float[] getTokensFloat(String s, float[] f, int n)
    • parseFloat

      protected float parseFloat()
    • parseFloatStr

      public float parseFloatStr(String s)
    • parseFloatRange

      protected float parseFloatRange(String s, int iStart, int iEnd)
    • parseInt

      protected int parseInt()
    • parseIntStr

      public int parseIntStr(String s)
    • parseIntAt

      public int parseIntAt(String s, int iStart)
    • parseIntRange

      protected int parseIntRange(String s, int iStart, int iEnd)
    • parseToken

      protected String parseToken()
    • parseTokenStr

      protected String parseTokenStr(String s)
    • parseTokenNext

      protected String parseTokenNext(String s)
    • parseTokenRange

      protected String parseTokenRange(String s, int iStart, int iEnd)
    • getFortranFormatLengths

      protected static javajs.util.Lst<Integer> getFortranFormatLengths(String s)
      get all integers after letters negative entries are spaces (1Xn)
      Parameters:
      s -
      Returns:
      Vector of integers
    • read3Vectors

      protected javajs.util.V3[] read3Vectors(boolean isBohr) throws Exception
      read three vectors, as for unit cube definitions allows for non-numeric data preceding the number block
      Parameters:
      isBohr -
      Returns:
      three vectors
      Throws:
      Exception
    • setElementAndIsotope

      protected void setElementAndIsotope(Atom atom, String str)
      allow 13C, 15N, 2H, etc. for isotopes
      Parameters:
      atom -
      str -
    • finalizeModelSet

      public void finalizeModelSet()
    • setChainID

      public void setChainID(Atom atom, String label)
    • readNextLine

      public String readNextLine() throws Exception
      Specified by:
      readNextLine in interface javajs.api.GenericLineReader
      Throws:
      Exception
    • appendUunitCellInfo

      public void appendUunitCellInfo(String info)
    • getInterface

      public Object getInterface(String className)
    • forceSymmetry

      public void forceSymmetry(boolean andPack)