Package org.jmol.adapter.smarter
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 Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
boolean
protected boolean
static final float
boolean
int
first atom index for this collection, current modelset.acint
protected javajs.api.GenericBinaryDocument
protected javajs.util.BS
protected javajs.util.BS
protected static final String
protected static final String
boolean
boolean
boolean
protected int
int
int
boolean
protected boolean
boolean
protected boolean
boolean
private Object
boolean
boolean
boolean
private boolean
(package private) boolean
protected String
protected javajs.util.P3
private javajs.util.P3
protected String
protected javajs.util.P3
private String
private String
private String
private String
protected boolean
private boolean
private boolean
private String
private boolean
private String
private boolean
private boolean
private boolean
private boolean
protected boolean
private int
(package private) String
private int[]
boolean
protected boolean
protected boolean
boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
boolean
boolean
boolean
protected boolean
protected boolean
protected boolean
boolean
protected boolean
protected boolean
protected boolean
private int
int[]
protected float
protected String
private javajs.util.SB
javajs.util.Lst<javajs.util.M4>
private javajs.util.M3
protected javajs.util.M3
protected boolean
int
int
private javajs.util.Lst<String>
protected boolean
private String
protected int[]
private int
private int
protected boolean
protected javajs.util.OC
float
boolean
javajs.util.T3
private boolean
private boolean
private String
private String
private float[]
javajs.util.M3
protected int
protected javajs.util.P3
protected BufferedReader
protected String
protected boolean
protected boolean
protected boolean
protected String
private String
boolean
protected int
(package private) float
protected int
javajs.util.Lst<javajs.util.P3[]>
float[]
protected javajs.util.P3
private boolean
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) private boolean
allowAtomName
(String atomName, String f) void
appendLoadNote
(String info) void
appendUunitCellInfo
(String info) void
boolean
void
private boolean
checkFilter
(Atom atom, String f, String fCased) boolean
checkFilterKey
(String key) boolean
sets continuing and doProcessLinesprotected boolean
protected void
checkLineForScript
(String line) private boolean
checkUnitCell
(int n) private void
void
protected int
cloneLastAtomSet
(int ac, javajs.util.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) private Object
finish()
private void
void
forceSymmetry
(boolean andPack) protected void
fractionalizeCoordinates
(boolean toFrac) static String
getElementSymbol
(int elementNumber) getFilterWithCase
(String key) protected static javajs.util.Lst<Integer>
get all integers after letters negative entries are spaces (1Xn)getInterface
(String className) protected SymmetryInterface
protected static final String[]
getStrings
(String sinfo, int nFields, int width) String[]
static float[]
getTokensFloat
(String s, float[] f, int n) private void
private void
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 String
protected String
protected String
parseTokenRange
(String s, int iStart, int iEnd) protected String
protected void
protected void
processDOM
(Object DOMNode) rd()
protected javajs.util.V3[]
read3Vectors
(boolean isBohr) read three vectors, as for unit cube definitions allows for non-numeric data preceding the number block(package private) Object
readData()
protected 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.private void
protected void
protected void
void
setFractionalCoordinates
(boolean TF) void
setIsPDB()
protected String
protected void
setModelPDB
(boolean isPDB) 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:
-
isBinary
public boolean isBinary -
debugging
public boolean debugging -
requiresBSFilter
protected boolean requiresBSFilter -
primitiveToCrystal
public javajs.util.M3 primitiveToCrystal -
asc
-
reader
-
binaryDoc
protected javajs.api.GenericBinaryDocument binaryDoc -
readerName
-
htParams
-
trajectorySteps
public javajs.util.Lst<javajs.util.P3[]> trajectorySteps -
domains
-
validation
-
dssr
-
isConcatenated
protected boolean isConcatenated -
addedData
-
addedDataKey
-
fixJavaFloat
public boolean fixJavaFloat -
thisBiomolecule
-
lstNCS
public javajs.util.Lst<javajs.util.M4> lstNCS -
line
-
prevline
-
next
protected int[] next -
ptLine
protected int ptLine -
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 -
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
-
sgName
-
ignoreFileUnitCell
protected boolean ignoreFileUnitCell -
ignoreFileSpaceGroupName
protected boolean ignoreFileSpaceGroupName -
unitCellParams
public float[] unitCellParams -
desiredModelNumber
protected int desiredModelNumber -
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
-
paramsLattice
public javajs.util.T3 paramsLattice -
paramsCentroid
public boolean paramsCentroid -
paramsPacked
private boolean paramsPacked -
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 -
haveModel
protected boolean haveModel -
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
-
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
-
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
-
doCentroidUnitCell
public boolean doCentroidUnitCell -
centroidPacked
public boolean centroidPacked -
strSupercell
-
allow_a_len_1
public boolean allow_a_len_1 -
slabXY
public boolean slabXY -
polymerX
private boolean polymerX -
filter1
-
filter2
-
filter1Cased
-
filter2Cased
-
matRot
private javajs.util.M3 matRot -
ms
-
vibsFractional
public boolean vibsFractional -
previousScript
-
siteScript
-
-
Constructor Details
-
AtomSetCollectionReader
public AtomSetCollectionReader()
-
-
Method Details
-
setup
-
setupASCR
-
readData
- Throws:
Exception
-
fixBaseIndices
private void fixBaseIndices() -
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) -
finish
-
setError
- Parameters:
e
-
-
initialize
private void initialize() -
initializeSymmetryOptions
protected void initializeSymmetryOptions() -
doGetModel
-
discardPreviousAtoms
protected void discardPreviousAtoms() -
initializeSymmetry
protected final void initializeSymmetry() -
newAtomSet
-
cloneLastAtomSet
- Throws:
Exception
-
setSpaceGroupName
-
setSymmetryOperator
-
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
-
checkUnitCellOffset
private void checkUnitCellOffset() -
fractionalizeCoordinates
protected void fractionalizeCoordinates(boolean toFrac) -
getNewSymmetry
-
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
-
checkFilter
- Parameters:
atom
-f
-fCased
-- Returns:
- true if a filter is found
-
rejectAtomName
-
allowAtomName
-
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
- TODO- 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
- TODOdata
- 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
- 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 interfacejavajs.api.GenericLineReader
- Throws:
Exception
-
appendUunitCellInfo
-
getInterface
-
forceSymmetry
public void forceSymmetry(boolean andPack)
-