Class AtomSetCollectionReader

java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
All Implemented Interfaces:
GenericLineReader
Direct Known Subclasses:
AbinitReader, AimsReader, AlchemyReader, AmpacReader, BasisFunctionReader, BilbaoReader, BinaryDcdReader, CastepReader, CgdReader, CifReader, CmdfReader, 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 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:
    • CELL_TYPE_SUPER

      protected static final String CELL_TYPE_SUPER
      See Also:
    • isBinary

      public boolean isBinary
    • debugging

      public boolean debugging
    • requiresBSFilter

      protected boolean requiresBSFilter
    • primitiveToCrystal

      public M3 primitiveToCrystal
    • asc

      public AtomSetCollection asc
    • reader

      public BufferedReader reader
    • binaryDoc

      public GenericBinaryDocument binaryDoc
    • readerName

      protected String readerName
    • htParams

      public Map<String,Object> htParams
    • trajectorySteps

      public Lst<P3[]> trajectorySteps
    • validation

      public Object validation
    • dssr

      public Object dssr
    • isConcatenated

      protected boolean isConcatenated
    • addedData

      public String addedData
    • addedDataKey

      public String addedDataKey
    • thisBiomolecule

      public Map<String,Object> thisBiomolecule
    • lstNCS

      public Lst<M4> lstNCS
    • floatifyJavaDouble

      public boolean floatifyJavaDouble
    • line

      public String line
    • prevline

      public String prevline
    • next

      protected int[] next
    • ptLine

      protected int ptLine
    • checkNearAtoms

      public boolean checkNearAtoms
    • 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
    • optimize2D

      public boolean optimize2D
    • noHydrogens

      public boolean noHydrogens
    • noMinimize

      public boolean noMinimize
    • is2D

      public boolean is2D
    • isMolecular

      public boolean isMolecular
    • templateAtomCount

      protected int templateAtomCount
    • modelNumber

      public int modelNumber
    • vibrationNumber

      public int vibrationNumber
    • desiredVibrationNumber

      public int desiredVibrationNumber
    • bsModels

      protected 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 XtalSymmetry.FileSymmetry symmetry
    • out

      protected OC out
    • iHaveFractionalCoordinates

      protected boolean iHaveFractionalCoordinates
    • doPackUnitCell

      public boolean doPackUnitCell
    • ptSupercell

      protected P3 ptSupercell
    • mustFinalizeModelSet

      protected boolean mustFinalizeModelSet
    • forcePacked

      protected boolean forcePacked
    • cellSlop

      protected float cellSlop
    • rotateHexCell

      protected boolean rotateHexCell
    • isPrimitive

      protected boolean isPrimitive
    • modDim

      public int modDim
    • lowPrecision

      protected boolean lowPrecision
    • doConvertToFractional

      public boolean doConvertToFractional
    • merging

      protected boolean merging
    • desiredSpaceGroupIndex

      public int desiredSpaceGroupIndex
    • latticeScaling

      protected float latticeScaling
    • unitCellOffset

      protected P3 unitCellOffset
    • paramsLattice

      public T3 paramsLattice
    • paramsCentroid

      public boolean paramsCentroid
    • fileScaling

      protected P3 fileScaling
    • fileOffset

      protected P3 fileOffset
    • 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
    • isSUPERCELL

      public boolean isSUPERCELL
      actual SUPERCELL keyword, not just "cell="
    • precision

      protected int precision
      maximum of the decimal length of unit cell lengths and fractional coordinates
    • haveModel

      protected boolean haveModel
    • ucItems

      public float[] ucItems
    • matUnitCellOrientation

      protected M3 matUnitCellOrientation
    • bsFilter

      protected BS bsFilter
    • filter

      public String filter
    • filterCased

      public String filterCased
    • haveAtomFilter

      public boolean haveAtomFilter
    • filterHetero

      protected boolean filterHetero
    • filterAllHetero

      protected boolean filterAllHetero
    • 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
    • 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
    • filteredPrecision

      protected boolean filteredPrecision
    • ms

      public MSInterface ms
    • vibsFractional

      public boolean vibsFractional
  • Constructor Details

    • AtomSetCollectionReader

      public AtomSetCollectionReader()
  • Method Details

    • getPackingRangeValue

      public float getPackingRangeValue(float def)
    • setup

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

      protected void setupASCR(String fullPath, Map<String,Object> htParams, Object readerOrDocument)
    • 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)
    • parsePrecision

      protected float parsePrecision(String s)
      Track the precision (count of y digits in "xx.yyyy") for setting cellSlop. We assume that with the numbers 0.25 0.33333 that the precision is really 5, not 2.
      Parameters:
      s -
      Returns:
      parsed number
    • setPrecision

      protected void setPrecision()
      Called by PWMAT ALWAYS and CIFReader as well if a double-precision value for alpha is found.
    • 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, P3[] pts) throws Exception
      Throws:
      Exception
    • setSpaceGroupName

      public void setSpaceGroupName(String name)
    • setSymmetryOperator

      public int setSymmetryOperator(String xyz)
    • 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)
    • getSymmetry

      public XtalSymmetry.FileSymmetry getSymmetry()
    • fractionalizeCoordinates

      protected void fractionalizeCoordinates(boolean toFrac)
    • 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
    • rejectAtomName

      public boolean rejectAtomName(String name)
    • 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 XtalSymmetry.FileSymmetry 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 -
      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 -
      data -
      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 Lst<Integer> getFortranFormatLengths(String s)
      get all integers after letters negative entries are spaces (1Xn)
      Parameters:
      s -
      Returns:
      Vector of integers
    • read3Vectors

      protected 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 GenericLineReader
      Throws:
      Exception
    • appendUunitCellInfo

      public void appendUunitCellInfo(String info)
    • getInterface

      public Object getInterface(String className)
    • forceSymmetry

      public void forceSymmetry(boolean andPack)
    • fixFloatA

      public void fixFloatA(float[] pts)
    • fixDoubleA

      public void fixDoubleA(double[] pts)
    • fixFloatPt

      public void fixFloatPt(P3 pt, float prec)