Package org.jmol.adapter.smarter
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
boolean
protected boolean
static final float
boolean
int
first atom index for this collection, current modelset.acint
protected BS
protected BS
protected static final String
protected static final String
protected static final String
protected float
boolean
boolean
boolean
boolean
protected int
int
int
boolean
protected boolean
boolean
protected boolean
boolean
boolean
boolean
boolean
protected String
protected P3
protected String
protected P3
protected boolean
protected boolean
protected boolean
boolean
protected boolean
protected boolean
boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
boolean
boolean
boolean
boolean
protected boolean
protected boolean
protected boolean
boolean
protected boolean
protected boolean
boolean
actual SUPERCELL keyword, not just "cell="protected boolean
int[]
protected float
protected String
protected boolean
protected M3
protected boolean
int
int
protected boolean
protected int[]
boolean
boolean
protected boolean
boolean
protected OC
boolean
protected int
maximum of the decimal length of unit cell lengths and fractional coordinatesprotected int
protected P3
protected String
protected boolean
protected boolean
protected boolean
protected String
boolean
protected int
protected int
float[]
protected P3
float[]
protected boolean
protected boolean
int
boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAtomXYZSymName
(String[] tokens, int i, String sym, String name) void
addExplicitLatticeVector
(int i, float[] xyz, int i0) void
addJmolScript
(String script) void
protected void
addSiteScript
(String script) void
appendLoadNote
(String info) void
appendUunitCellInfo
(String info) void
boolean
void
boolean
checkFilterKey
(String key) boolean
sets continuing and doProcessLinesprotected boolean
protected void
checkLineForScript
(String line) void
protected int
cloneLastAtomSet
(int ac, P3[] pts) discardLinesUntilContains
(String containsMatch) discardLinesUntilContains2
(String s1, String s2) discardLinesUntilStartsWith
(String startsWith) protected void
boolean
doGetModel
(int modelNumber, String title) boolean
doGetVibration
(int vibrationNumber) protected void
protected double[][]
fills a double[3][3]protected void
fillDataBlock
(String[][] data, int minLineLen) fills an array with a pre-defined number of lines of token data, skipping blank lines in the processprotected void
fillDataBlockFixed
(String[][] data, int col0, int colWidth, int minLineLen) Fills an array with a predefined number of lines of data that is arranged in fixed FORTRAN-like column format.protected float[]
fillFloatArray
(String s, int width, float[] data) fills a float array with string data from a fileprotected void
fillFrequencyData
(int iAtom0, int ac, int modelAtomCount, boolean[] ignore, boolean isWide, int col0, int colWidth, int[] atomIndexes, int minLineLen, String[][] data) Extracts a block of frequency data from a file.protected boolean
filterAtom
(Atom atom, int iAtom) protected boolean
filterReject
(String f, String code, String atomCode) void
finalizeMOData
(Map<String, Object> moData) void
protected void
protected void
optional reader-specific method run first.protected void
finalizeSubclassSymmetry
(boolean haveSymmetry) void
fixDoubleA
(double[] pts) void
fixFloatA
(float[] pts) void
fixFloatPt
(P3 pt, float prec) void
forceSymmetry
(boolean andPack) protected void
fractionalizeCoordinates
(boolean toFrac) static String
getElementSymbol
(int elementNumber) getFilterWithCase
(String key) get all integers after letters negative entries are spaces (1Xn)getInterface
(String className) float
getPackingRangeValue
(float def) protected static final String[]
getStrings
(String sinfo, int nFields, int width) String[]
static float[]
getTokensFloat
(String s, float[] f, int n) protected void
protected final void
protected void
protected void
boolean
isLastModel
(int modelNumber) after reading a model, Q: Is this the last model?protected void
newAtomSet
(String name) protected float
protected float
parseFloatRange
(String s, int iStart, int iEnd) float
protected int
parseInt()
int
parseIntAt
(String s, int iStart) protected int
parseIntRange
(String s, int iStart, int iEnd) int
protected float
Track the precision (count of y digits in "xx.yyyy") for setting cellSlop.protected String
protected String
protected String
parseTokenRange
(String s, int iStart, int iEnd) protected String
protected void
protected void
processDOM
(Object DOMNode) rd()
protected V3[]
read3Vectors
(boolean isBohr) read three vectors, as for unit cube definitions allows for non-numeric data preceding the number blockprotected Object
readDataObject
(Object node) protected String
readLines
(int nLines) boolean
rejectAtomName
(String name) RL()
protected void
set2D()
void
setAtomCoord
(Atom atom) setAtomCoordScaled
(Atom atom, String[] tokens, int i, float f) protected void
setAtomCoordTokens
(Atom atom, String[] tokens, int i) void
setAtomCoordXYZ
(Atom atom, float x, float y, float z) void
setChainID
(Atom atom, String label) protected void
setElementAndIsotope
(Atom atom, String str) allow 13C, 15N, 2H, etc.protected void
protected void
void
setFractionalCoordinates
(boolean TF) void
setIsPDB()
protected String
protected void
setModelPDB
(boolean isPDB) protected void
Called by PWMAT ALWAYS and CIFReader as well if a double-precision value for alpha is found.void
setSpaceGroupName
(String name) int
void
setTransform
(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) void
setUnitCell
(float a, float b, float c, float alpha, float beta, float gamma) void
setUnitCellItem
(int i, float x) protected void
protected void
-
Field Details
-
ANGSTROMS_PER_BOHR
public static final float ANGSTROMS_PER_BOHR- See Also:
-
CELL_TYPE_CONVENTIONAL
- See Also:
-
CELL_TYPE_PRIMITIVE
- See Also:
-
CELL_TYPE_SUPER
- See Also:
-
isBinary
public boolean isBinary -
debugging
public boolean debugging -
requiresBSFilter
protected boolean requiresBSFilter -
primitiveToCrystal
-
asc
-
reader
-
binaryDoc
-
readerName
-
htParams
-
trajectorySteps
-
validation
-
dssr
-
isConcatenated
protected boolean isConcatenated -
addedData
-
addedDataKey
-
thisBiomolecule
-
lstNCS
-
floatifyJavaDouble
public boolean floatifyJavaDouble -
line
-
prevline
-
next
protected int[] next -
ptLine
protected int ptLine -
checkNearAtoms
public boolean checkNearAtoms -
latticeType
-
latticeCells
public int[] latticeCells -
fillRange
-
doProcessLines
public boolean doProcessLines -
iHaveUnitCell
public boolean iHaveUnitCell -
iHaveSymmetryOperators
public boolean iHaveSymmetryOperators -
continuing
public boolean continuing -
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
-
useFileModelNumbers
protected boolean useFileModelNumbers -
havePartialChargeFilter
protected boolean havePartialChargeFilter -
calculationType
-
sgName
-
ignoreFileUnitCell
protected boolean ignoreFileUnitCell -
ignoreFileSpaceGroupName
protected boolean ignoreFileSpaceGroupName -
unitCellParams
public float[] unitCellParams -
desiredModelNumber
protected int desiredModelNumber -
symmetry
-
out
-
iHaveFractionalCoordinates
protected boolean iHaveFractionalCoordinates -
doPackUnitCell
public boolean doPackUnitCell -
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
-
paramsLattice
-
paramsCentroid
public boolean paramsCentroid -
fileScaling
-
fileOffset
-
filePath
-
fileName
-
baseAtomIndex
public int baseAtomIndexfirst 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 isSUPERCELLactual SUPERCELL keyword, not just "cell=" -
precision
protected int precisionmaximum of the decimal length of unit cell lengths and fractional coordinates -
haveModel
protected boolean haveModel -
ucItems
public float[] ucItems -
matUnitCellOrientation
-
bsFilter
-
filter
-
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
-
allow_a_len_1
public boolean allow_a_len_1 -
slabXY
public boolean slabXY -
filteredPrecision
protected boolean filteredPrecision -
ms
-
vibsFractional
public boolean vibsFractional
-
-
Constructor Details
-
AtomSetCollectionReader
public AtomSetCollectionReader()
-
-
Method Details
-
getPackingRangeValue
public float getPackingRangeValue(float def) -
setup
-
setupASCR
-
readDataObject
- Throws:
Exception
-
processDOM
- Parameters:
DOMNode
-
-
processBinaryDocument
- Throws:
Exception
-
initializeReader
- Throws:
Exception
-
checkLine
- 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
-
initializeTrajectoryFile
protected void initializeTrajectoryFile() -
finalizeSubclassReader
optional reader-specific method run first.- Throws:
Exception
-
finalizeReaderASCR
- Throws:
Exception
-
setLoadNote
-
setIsPDB
public void setIsPDB() -
setModelPDB
protected void setModelPDB(boolean isPDB) -
parsePrecision
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
-
discardPreviousAtoms
protected void discardPreviousAtoms() -
initializeSymmetry
protected final void initializeSymmetry() -
newAtomSet
-
cloneLastAtomSet
- Throws:
Exception
-
setSpaceGroupName
-
setSymmetryOperator
-
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
-
fractionalizeCoordinates
protected void fractionalizeCoordinates(boolean toFrac) -
setFractionalCoordinates
public void setFractionalCoordinates(boolean TF) -
setFilterAtomTypeStr
-
setFilter
-
getFilterWithCase
-
getFilter
-
checkFilterKey
-
checkAndRemoveFilterKey
- Parameters:
key
-- Returns:
- true if the key existed; filter is set null if this is the only key
-
filterAtom
- Parameters:
atom
-iAtom
-- Returns:
- true if we want this atom
-
rejectAtomName
-
filterReject
-
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
-
setAtomCoordScaled
-
setAtomCoordTokens
-
addAtomXYZSymName
-
setAtomCoord
-
addSites
-
applySymmetryAndSetTrajectory
- Throws:
Exception
-
applySymTrajASCR
- Throws:
Exception
-
finalizeSubclassSymmetry
- Parameters:
haveSymmetry
-- Throws:
Exception
-
doPreSymmetry
- Throws:
Exception
-
finalizeMOData
-
getElementSymbol
-
fillDataBlock
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
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
fills a float array with string data from a file- Parameters:
s
- string data containing floatswidth
- column width or 0 to read tokensdata
- 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 frequencyac
- the number of atoms to be assignedmodelAtomCount
- the number of atoms in each modelignore
- 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 readisWide
- 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 startscolWidth
- the width of the data columnsatomIndexes
- 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
- Throws:
Exception
-
discardLinesUntilStartsWith
- Throws:
Exception
-
discardLinesUntilContains
- Throws:
Exception
-
discardLinesUntilContains2
- Throws:
Exception
-
discardLinesUntilBlank
- Throws:
Exception
-
discardLinesUntilNonBlank
- Throws:
Exception
-
checkLineForScript
-
checkCurrentLineForScript
public void checkCurrentLineForScript() -
addJmolScript
-
addSiteScript
-
rd
- Throws:
Exception
-
RL
- Throws:
Exception
-
getStrings
-
getTokens
-
getTokensFloat
-
parseFloat
protected float parseFloat() -
parseFloatStr
-
parseFloatRange
-
parseInt
protected int parseInt() -
parseIntStr
-
parseIntAt
-
parseIntRange
-
parseToken
-
parseTokenStr
-
parseTokenNext
-
parseTokenRange
-
getFortranFormatLengths
get all integers after letters negative entries are spaces (1Xn)- Parameters:
s
-- Returns:
- Vector of integers
-
read3Vectors
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
allow 13C, 15N, 2H, etc. for isotopes- Parameters:
atom
-str
-
-
finalizeModelSet
public void finalizeModelSet() -
setChainID
-
readNextLine
- Specified by:
readNextLine
in interfaceGenericLineReader
- Throws:
Exception
-
appendUunitCellInfo
-
getInterface
-
forceSymmetry
public void forceSymmetry(boolean andPack) -
fixFloatA
public void fixFloatA(float[] pts) -
fixDoubleA
public void fixDoubleA(double[] pts) -
fixFloatPt
-