Package org.jmol.adapter.readers.xtal
Class JanaReader
java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
org.jmol.adapter.readers.xtal.JanaReader
- All Implemented Interfaces:
javajs.api.GenericLineReader
A reader for Jana M50+M40 file pairs.
TODO: rigid-body rotation TLS, local symmetry, and local axes
- Author:
- Bob Hanson hansonr@stolaf.edu 8/7/2013
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
(package private) static final int
private boolean
private float[]
private boolean
private boolean
(package private) static final int
private javajs.util.Lst<float[]>
private javajs.util.M3
private String
private javajs.util.Lst<javajs.util.P3>
private javajs.util.Lst<Atom>
private boolean
private String
private javajs.util.Lst<Integer>
(package private) static final int
(package private) static final int
private int
(package private) static final String
private javajs.util.P3
(package private) static final int
(package private) static final int
private int
(package private) static final int
static final String
private javajs.util.V3
private javajs.util.V3
(package private) static final int
private static String[]
Fields inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addedData, addedDataKey, addVibrations, allow_a_len_1, allowPDBFilter, ANGSTROMS_PER_BOHR, applySymmetryToBonds, asc, baseAtomIndex, baseBondIndex, binaryDoc, bsFilter, bsModels, calculationType, CELL_TYPE_CONVENTIONAL, CELL_TYPE_PRIMITIVE, centroidPacked, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCentroidUnitCell, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterAllHetero, filterCased, filterHetero, fixJavaFloat, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isTrajectory, latticeCells, latticeScaling, latticeType, line, lstNCS, matUnitCellOrientation, merging, modDim, modelNumber, ms, mustFinalizeModelSet, next, noPack, out, packingError, paramsCentroid, paramsLattice, prevline, primitiveToCrystal, ptLine, ptSupercell, reader, readerName, requiresBSFilter, reverseModels, rotateHexCell, sgName, slabXY, stateScriptVersionInt, strSupercell, symmetry, templateAtomCount, thisBiomolecule, trajectorySteps, ucItems, unitCellOffset, unitCellParams, useAltNames, useFileModelNumbers, validation, vibrationNumber, vibsFractional, vwr
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
Add x, y, and z modulations as [ csin, ccos, 0 ] or, possibly Legendre [ coef, order, 0 ]private void
M40 occupancies are divided by the site multiplicity; here we factor that back in.private void
cartesianProduct
(javajs.util.T3 vA, javajs.util.T3 vB) dual-purpose function for cross products, proper rotations, and improper rotationsprivate void
cell()
protected boolean
private double[]
combineModulation
(String key, float csin, float ccos) Retrieve cataloged displacement and add in this component, returning a new double[3].private void
copyModulations
(String label, String newLabel) Create a new catalog entry for an atom's modulation components.void
private void
ensureFourier
(int j) Make sure that F_n record is present.void
optional reader-specific method run first.protected void
finalizeSubclassSymmetry
(boolean haveSymmetry) private boolean
getFlag
(int i) safely get a one-character 0 or 1 as a booleanprivate int
getInt
(int col1, int col2) safe int parsing of line.substring(col1, col2);private String
getStr
(int col1, int col2) safe string parsing of line.substring(col1, col2);void
private void
ndim()
private void
private void
processPosition
(String posName, Atom pos, boolean isAxial) We process the Pos#n record here.private void
qi()
private float[][]
readAtomRecord
(Atom atom, javajs.util.P3 rm, javajs.util.P3 rp, boolean isPos) Read the atom or pos# record, including occupancy, various flags, and, especially, modulations.private void
readM40Data
(boolean haveReader) read the M40 file, possibly as the extension of M50+M40private float[][]
readM40FloatLines
(int nLines, int nFloats) private String
private void
private void
setMolecularModulation
(String key, float csin, float ccos) Add the modulation after applying rigid-body phase correctionprivate double[]
setRigidBodyPhase
(String key, double[] v) Adjust phases to match the difference between the atom's position and the rigid molecular fragment's reference point.private void
setRigidBodyRotations
(String label, float[][] params) Transform unphased Fourier x,y,z cos/sin coefficients in a rigid body system based on distance from center.private String
private void
symmetry()
Methods inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addSites, addSiteScript, appendLoadNote, appendUunitCellInfo, applySymmetryAndSetTrajectory, applySymTrajASCR, checkAndRemoveFilterKey, checkCurrentLineForScript, checkFilterKey, checkLastModel, checkLineForScript, clearUnitCell, cloneLastAtomSet, discardLinesUntilBlank, discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, discardLinesUntilStartsWith, discardPreviousAtoms, doGetModel, doGetVibration, fill3x3, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFilterWithCase, getFortranFormatLengths, getInterface, getNewSymmetry, getStrings, getSymmetry, getTokens, getTokensFloat, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, parseToken, parseTokenNext, parseTokenRange, parseTokenStr, processBinaryDocument, processDOM, rd, read3Vectors, readDataObject, readLines, readNextLine, rejectAtomName, RL, set2D, setAtomCoord, setAtomCoordScaled, setAtomCoordTokens, setAtomCoordXYZ, setChainID, setElementAndIsotope, setFilter, setFilterAtomTypeStr, setFractionalCoordinates, setIsPDB, setLoadNote, setModelPDB, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem, setup, setupASCR
-
Field Details
-
lattvecs
private javajs.util.Lst<float[]> lattvecs -
thisSub
private int thisSub -
modAxes
-
haveM40Data
private boolean haveM40Data -
records
- See Also:
-
TITLE
static final int TITLE- See Also:
-
CELL
static final int CELL- See Also:
-
NDIM
static final int NDIM- See Also:
-
QI
static final int QI- See Also:
-
LATT
static final int LATT- See Also:
-
SYM
static final int SYM- See Also:
-
SPG
static final int SPG- See Also:
-
END
static final int END- See Also:
-
WMATRIX
static final int WMATRIX- See Also:
-
qicount
private int qicount -
molName
-
molAtoms
-
molTtypes
-
modelMolecule
private javajs.util.Lst<javajs.util.P3> modelMolecule -
molHasTLS
private boolean molHasTLS -
matR
private javajs.util.M3 matR -
rho
private javajs.util.P3 rho -
firstPosition
private boolean firstPosition -
vR
private javajs.util.V3 vR -
v0Cart
private javajs.util.V3 v0Cart -
isLegendre
private boolean isLegendre -
U_LIST
- See Also:
-
XYZ
-
floats
private float[] floats
-
-
Constructor Details
-
JanaReader
public JanaReader()
-
-
Method Details
-
initializeReader
- Overrides:
initializeReader
in classAtomSetCollectionReader
- Throws:
Exception
-
checkLine
- Overrides:
checkLine
in classAtomSetCollectionReader
- Returns:
- true if need to read new line
- Throws:
Exception
-
doPreSymmetry
- Overrides:
doPreSymmetry
in classAtomSetCollectionReader
- Throws:
Exception
-
finalizeSubclassReader
Description copied from class:AtomSetCollectionReader
optional reader-specific method run first.- Overrides:
finalizeSubclassReader
in classAtomSetCollectionReader
- Throws:
Exception
-
finalizeSubclassSymmetry
- Overrides:
finalizeSubclassSymmetry
in classAtomSetCollectionReader
- Throws:
Exception
-
cell
- Throws:
Exception
-
ndim
- Throws:
Exception
-
qi
- Throws:
Exception
-
symmetry
- Throws:
Exception
-
readM40Data
read the M40 file, possibly as the extension of M50+M40- Parameters:
haveReader
-- Throws:
Exception
-
getInt
private int getInt(int col1, int col2) safe int parsing of line.substring(col1, col2);- Parameters:
col1
-col2
-- Returns:
- value or 0
-
getStr
safe string parsing of line.substring(col1, col2);- Parameters:
col1
-col2
-- Returns:
- value or ""
-
getFlag
private boolean getFlag(int i) safely get a one-character 0 or 1 as a boolean- Parameters:
i
-- Returns:
- true if it was a 1
-
skipToNextAtom
- Throws:
Exception
-
readM40WaveVectors
- Throws:
Exception
-
processPosition
We process the Pos#n record here. This involves cloning the free atoms, translating and rotating them to the proper locations, and copying the modulations. Jmol uses the alternative location PDB option (%1, %2,...) to specify the group, enabling the Jmol command DISPLAY configuration=1, for example. We also set a flag to prevent autobonding between alt-loc sets. This is not perfect, as in some cases "pos#2" would be better than "pos#1" in terms of bonding. At this point we only support systType=1 (basic coordinates)- Parameters:
posName
-pos
-isAxial
-- Throws:
Exception
-
cartesianProduct
private void cartesianProduct(javajs.util.T3 vA, javajs.util.T3 vB) dual-purpose function for cross products, proper rotations, and improper rotations- Parameters:
vA
-vB
-
-
readAtomRecord
private float[][] readAtomRecord(Atom atom, javajs.util.P3 rm, javajs.util.P3 rp, boolean isPos) throws Exception Read the atom or pos# record, including occupancy, various flags, and, especially, modulations. Not implemented: TLS, space groups, and local position rotation axes.- Parameters:
atom
-rm
- // rotation vector/point not implementedrp
- // rotation point not implementedisPos
-- Returns:
- pos# record's rotational displacement data
- Throws:
Exception
-
addSinCos
Add x, y, and z modulations as [ csin, ccos, 0 ] or, possibly Legendre [ coef, order, 0 ]- Parameters:
j
-key
-label
-isPos
-- Throws:
Exception
-
ensureFourier
private void ensureFourier(int j) Make sure that F_n record is present.- Parameters:
j
-
-
readM40Floats
- Throws:
Exception
-
parseM40Floats
private void parseM40Floats() -
readM40FloatLines
- Throws:
Exception
-
adjustM40Occupancies
private void adjustM40Occupancies()M40 occupancies are divided by the site multiplicity; here we factor that back in. -
copyModulations
Create a new catalog entry for an atom's modulation components. Just occupation and displacement here.- Parameters:
label
-newLabel
-
-
setRigidBodyPhase
Adjust phases to match the difference between the atom's position and the rigid molecular fragment's reference point. We have: a' = g + vR Here we want just the local rotational part, vR- Parameters:
key
-v
-- Returns:
- phase-adjusted parameters
-
setRigidBodyRotations
Transform unphased Fourier x,y,z cos/sin coefficients in a rigid body system based on distance from center. We have: a' = g + vR = g + R(v0) Here we need just the original atom offset from the reference point, v0, as a Cartesian vector.- Parameters:
label
- ";atomName"params
- block of [nDisp][6] rotational parameters
-
combineModulation
Retrieve cataloged displacement and add in this component, returning a new double[3].- Parameters:
key
-csin
-ccos
-- Returns:
- new array
-
setMolecularModulation
Add the modulation after applying rigid-body phase correction- Parameters:
key
-csin
-ccos
-
-