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 booleanbooleanprotected booleanstatic final floatbooleanintfirst atom index for this collection, current modelset.acintjavajs.api.GenericBinaryDocumentprotected javajs.util.BSprotected javajs.util.BSprotected static final Stringprotected static final Stringbooleanbooleanbooleanprotected intintintbooleanprotected booleanbooleanprotected booleanbooleanprivate Objectbooleanbooleanbooleanprivate boolean(package private) booleanprotected Stringprotected javajs.util.P3private javajs.util.P3protected Stringprotected javajs.util.P3private Stringprivate Stringprivate Stringprivate Stringprotected booleanprivate booleanprivate booleanprivate Stringprivate booleanprivate Stringprivate booleanprivate booleanprivate booleanprivate booleanprotected booleanprivate int(package private) Stringprivate int[]booleanprotected booleanprotected booleanbooleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanbooleanbooleanbooleanbooleanprotected booleanprotected booleanprotected booleanbooleanprotected booleanprotected booleanprotected booleanprivate intint[]protected floatprotected Stringprivate javajs.util.SBjavajs.util.Lst<javajs.util.M4>private javajs.util.M3protected javajs.util.M3protected booleanintintprivate javajs.util.Lst<String>protected booleanprivate Stringprotected int[]private intprivate intbooleanprotected booleanbooleanprotected javajs.util.OCfloatbooleanjavajs.util.T3private booleanprivate booleanprivate Stringprivate Stringprivate float[]javajs.util.M3protected intprotected javajs.util.P3protected Stringprotected booleanprotected booleanprotected booleanprotected Stringprivate Stringbooleanprotected int(package private) floatprotected intjavajs.util.Lst<javajs.util.P3[]>float[]protected javajs.util.P3private booleanfloat[]protected booleanprotected booleanintboolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAtomXYZSymName(String[] tokens, int i, String sym, String name) voidaddExplicitLatticeVector(int i, float[] xyz, int i0) voidaddJmolScript(String script) voidprotected voidaddSiteScript(String script) private booleanallowAtomName(String atomName, String f) voidappendLoadNote(String info) voidappendUunitCellInfo(String info) voidbooleanvoidprivate booleancheckFilter(Atom atom, String f, String fCased) booleancheckFilterKey(String key) booleansets continuing and doProcessLinesprotected booleanprotected voidcheckLineForScript(String line) private booleancheckUnitCell(int n) private voidvoidprotected intcloneLastAtomSet(int ac, javajs.util.P3[] pts) discardLinesUntilContains(String containsMatch) discardLinesUntilContains2(String s1, String s2) discardLinesUntilStartsWith(String startsWith) protected voidbooleandoGetModel(int modelNumber, String title) booleandoGetVibration(int vibrationNumber) protected voidprotected double[][]fills a double[3][3]protected voidfillDataBlock(String[][] data, int minLineLen) fills an array with a pre-defined number of lines of token data, skipping blank lines in the processprotected voidfillDataBlockFixed(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 voidfillFrequencyData(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 booleanfilterAtom(Atom atom, int iAtom) protected booleanfilterReject(String f, String code, String atomCode) voidfinalizeMOData(Map<String, Object> moData) voidprotected voidprotected voidoptional reader-specific method run first.protected voidfinalizeSubclassSymmetry(boolean haveSymmetry) private Objectfinish()private voidvoidforceSymmetry(boolean andPack) protected voidfractionalizeCoordinates(boolean toFrac) static StringgetElementSymbol(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 SymmetryInterfaceprotected static final String[]getStrings(String sinfo, int nFields, int width) String[]static float[]getTokensFloat(String s, float[] f, int n) private voidprivate voidprotected voidprotected final voidprotected voidprotected voidbooleanisLastModel(int modelNumber) after reading a model, Q: Is this the last model?protected voidnewAtomSet(String name) protected floatprotected floatparseFloatRange(String s, int iStart, int iEnd) floatprotected intparseInt()intparseIntAt(String s, int iStart) protected intparseIntRange(String s, int iStart, int iEnd) intprotected Stringprotected Stringprotected StringparseTokenRange(String s, int iStart, int iEnd) protected Stringprotected voidprotected voidprocessDOM(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) ObjectreadData()protected ObjectreadDataObject(Object node) protected StringreadLines(int nLines) booleanrejectAtomName(String name) RL()protected voidset2D()voidsetAtomCoord(Atom atom) setAtomCoordScaled(Atom atom, String[] tokens, int i, float f) protected voidsetAtomCoordTokens(Atom atom, String[] tokens, int i) voidsetAtomCoordXYZ(Atom atom, float x, float y, float z) voidsetChainID(Atom atom, String label) protected voidsetElementAndIsotope(Atom atom, String str) allow 13C, 15N, 2H, etc.private voidprotected voidprotected voidvoidsetFractionalCoordinates(boolean TF) voidsetIsPDB()protected Stringprotected voidsetModelPDB(boolean isPDB) voidsetSpaceGroupName(String name) intvoidsetTransform(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) voidsetUnitCell(float a, float b, float c, float alpha, float beta, float gamma) voidsetUnitCellItem(int i, float x) protected voidprotected 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
public 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 -
optimize2D
public boolean optimize2D -
noHydrogens
public boolean noHydrogens -
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 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:
readNextLinein interfacejavajs.api.GenericLineReader- Throws:
Exception
-
appendUunitCellInfo
-
getInterface
-
forceSymmetry
public void forceSymmetry(boolean andPack)
-