Package org.jmol.adapter.readers.pdb
Class PdbReader
java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
org.jmol.adapter.readers.pdb.PdbReader
- All Implemented Interfaces:
javajs.api.GenericLineReader
- Direct Known Subclasses:
JmolDataReader,P2nReader,PqrReader,PyMOLReader
PDB file reader.
- Author:
- Miguel, Egon, and Bob (hansonr@stolaf.edu) pqr and gromacs pdb_wide_format added by Bob see http://repo.or.cz/w/gromacs.git/blob/HEAD:/src/gmxlib/pdbio.c line 244 see http://repo.or.cz/w/gromacs.git/blob/HEAD:/src/gmxlib/pdbio.c line 323 TLS Motion Determination: J Painter & E A Merritt (2006) Acta Cryst. D62, 439-450 http://skuld.bmsc.washington.edu/~tlsmd symmetry added by Bob Hanson: setFractionalCoordinates() setSpaceGroupName() setUnitCell() initializeCartesianToFractional(); setUnitCellItem() setAtomCoord() applySymmetryAndSetTrajectory()
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final floatprivate intprivate booleanprivate intprivate intprotected int[]private Stringprivate intprivate intprivate int[]private intprivate intprivate floatprivate Stringprivate Stringprivate intprivate final float[]protected intprivate Stringprivate booleanprotected booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate charprivate intprivate charprivate intprivate intprivate intprivate static final Stringprivate intprivate intprivate static final intprivate static final intprivate static final intprivate intprivate intprivate javajs.util.SBprivate Stringprivate static final floatprivate booleanprivate javajs.util.SBprivate javajs.util.SBprivate javajs.util.SBprivate javajs.util.SBprivate javajs.util.SBprivate intprivate intprivate intprivate intprivate javajs.util.Lst<int[]>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, is2D, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isTrajectory, latticeCells, latticeScaling, latticeType, line, lstNCS, matUnitCellOrientation, merging, modDim, modelNumber, ms, mustFinalizeModelSet, next, noHydrogens, noPack, optimize2D, 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 voidaddConnection(int[] is) private voidanisou()private voidatom()private voidcheckForResidualBFactors(SymmetryInterface symmetry) protected booleanprivate voidprotected voidprivate voidprivate voidcompnd(boolean isSource) private voidconect()private voidconnectAll(int maxSerial, boolean isConnectStateBug) private voidconnectAllBad(int maxSerial) private voidcryst1()protected StringdeduceElementSymbol(boolean isHetero) The problem here stems from the fact that developers have not fully understood the PDB specifications -- and that those have changed.private voidexpdta()protected booleanfilterPDBAtom(Atom atom, int iAtom) protected voidprotected voidoptional reader-specific method run first.private intfindAtom(int atom1, int atom2, int chain, int resno, boolean isTrue) private intfindAtomForRange(int atom1, int atom2, int chain, int resno, boolean isLast) protected static floatfixRadius(float r) private voidformul()private floatgetFloat(int ich, int cch) private StringA Jmol add-on -- allows for model name on MODEL line starting in column 15 (0-based)private intprivate intgetSeqNo(int i, int j) private intgetSerial(int i, int j) private voidfor now, we just ignore TLS details if user has selected a specific modelprivate voidheader()private voidhet()private voidhetnam()protected voidprotected voidprotected AtomprocessAtom(Atom atom, String name, char altID, String group3, int chainID, int seqNo, char insCode, boolean isHetero, String sym) protected voidprocessAtom2(Atom atom, int serial, float x, float y, float z, int charge) private StringreadHeader(boolean getLine) private booleanprivate booleanprivate booleanprivate booleanprivate voidscale(int n) private voidseqAdv()protected voidadaptable via subclassingprivate voidprivate voidsetTlsGroups(int iGroup, int iModel, SymmetryInterface symmetry) Sets the atom property property_tlsGroup based on TLS group ranges and adds "TLS" key to model's auxiliaryInfo.private voidsetTlsTensor(Atom atom, Map<String, Object> group, SymmetryInterface symmetry) private voidsite()private voidprivate voidtitle()private voidtlsAddError(String error) 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, doPreSymmetry, fill3x3, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, finalizeSubclassSymmetry, 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
-
MODE_PDB
private static final int MODE_PDB- See Also:
-
MODE_HEX
private static final int MODE_HEX- See Also:
-
MODE_HYBRID36
private static final int MODE_HYBRID36- See Also:
-
serMode
private int serMode -
seqMode
private int seqMode -
serial
private int serial -
lineLength
private int lineLength -
pdbHeader
private javajs.util.SB pdbHeader -
applySymmetry
private boolean applySymmetry -
getTlsGroups
private boolean getTlsGroups -
isMultiModel
private boolean isMultiModel -
haveMappedSerials
private boolean haveMappedSerials -
isConnectStateBug
private boolean isConnectStateBug -
isLegacyModelType
private boolean isLegacyModelType -
gromacsWideFormat
protected boolean gromacsWideFormat -
htFormul
-
htHetero
-
htSites
-
htElementsInCurrentGroup
-
htMolIds
-
vCompnds
-
vBiomolecules
-
vTlsModels
-
sbTlsErrors
private javajs.util.SB sbTlsErrors -
biomtChainAtomCounts
protected int[] biomtChainAtomCounts -
sbIgnored
private javajs.util.SB sbIgnored -
sbSelected
private javajs.util.SB sbSelected -
sbConect
private javajs.util.SB sbConect -
sb
private javajs.util.SB sb -
ac
private int ac -
maxSerial
private int maxSerial -
nUNK
private int nUNK -
nRes
private int nRes -
currentCompnd
-
currentGroup3
-
currentKey
-
currentResno
private int currentResno -
configurationPtr
private int configurationPtr -
resetKey
private boolean resetKey -
compnd
-
conformationIndex
private int conformationIndex -
fileAtomIndex
protected int fileAtomIndex -
lastAltLoc
private char lastAltLoc -
lastGroup
private int lastGroup -
lastInsertion
private char lastInsertion -
lastSourceSerial
private int lastSourceSerial -
lastTargetSerial
private int lastTargetSerial -
tlsGroupID
private int tlsGroupID -
atomTypePt0
private int atomTypePt0 -
atomTypeLen
private int atomTypeLen -
isCourseGrained
private boolean isCourseGrained -
isbiomol
private boolean isbiomol -
lineOptions
- See Also:
-
htGroup1
-
maxLength
private int maxLength -
pdbID
-
haveDoubleBonds
private boolean haveDoubleBonds -
cryst1
private float cryst1 -
fileSgName
-
dataT
private final float[] dataT -
RAD_PER_DEG
private static final float RAD_PER_DEG- See Also:
-
_8PI2_
private static final float _8PI2_- See Also:
-
tlsU
-
vConnect
private javajs.util.Lst<int[]> vConnect -
connectNextAtomIndex
private int connectNextAtomIndex -
connectNextAtomSet
private int connectNextAtomSet -
connectLast
private int[] connectLast
-
-
Constructor Details
-
PdbReader
public PdbReader()
-
-
Method Details
-
initializeReader
- Overrides:
initializeReaderin classAtomSetCollectionReader- Throws:
Exception
-
checkLine
- Overrides:
checkLinein classAtomSetCollectionReader- Returns:
- true if need to read new line
- Throws:
Exception
-
checkRemark
protected void checkRemark() -
seqAdv
private void seqAdv() -
readHeader
- Throws:
Exception
-
finalizeSubclassReader
Description copied from class:AtomSetCollectionReaderoptional reader-specific method run first.- Overrides:
finalizeSubclassReaderin classAtomSetCollectionReader- Throws:
Exception
-
finalizeReaderPDB
- Throws:
Exception
-
checkUnitCellParams
private void checkUnitCellParams() -
checkForResidualBFactors
-
header
private void header() -
title
private void title() -
compnd
private void compnd(boolean isSource) -
setBiomoleculeAtomCounts
private void setBiomoleculeAtomCounts() -
remark350
- Throws:
Exception
-
remark285
private boolean remark285() -
remark290
- Throws:
Exception
-
getSerial
private int getSerial(int i, int j) -
getSeqNo
private int getSeqNo(int i, int j) -
processAtom
-
processAtom2
-
atom
private void atom() -
filterPDBAtom
-
setAdditionalAtomParameters
adaptable via subclassing- Parameters:
atom-
-
deduceElementSymbol
The problem here stems from the fact that developers have not fully understood the PDB specifications -- and that those have changed. The actual rules are as follows (using 1-based numbering: 1) Chemical symbols may be in columns 77 and 78 for total disambiguity. 2) Only valid chemical symbols should be in columns 13 and 14 These are the first two characters of a four-character field. 3) Four-character atom names for hydrogen necessarily start in column 13, so when that is the case, if the four-letter name starts with "H" then it is hydrogen regardless of what letter comes next. For example, "HG3 " is mercury (and should be in a HETATM record, not an ATOM record, anyway), but "HG33" is hydrogen, presumably. This leave open the ambiguity of a four-letter H name in a heteroatom set where the symbol is really H, not Hg or Ha, or Ho or Hf, etc.- Parameters:
isHetero-- Returns:
- an atom symbol
-
conect
private void conect() -
structure
private void structure() -
getModelNumber
private int getModelNumber() -
getModelName
A Jmol add-on -- allows for model name on MODEL line starting in column 15 (0-based)- Returns:
- name or null
-
model
-
checkNotPDB
private void checkNotPDB() -
cryst1
- Throws:
Exception
-
getFloat
- Throws:
Exception
-
scale
- Throws:
Exception
-
expdta
private void expdta() -
formul
private void formul() -
het
private void het() -
hetnam
private void hetnam() -
anisou
private void anisou() -
site
private void site() -
remarkTls
- Throws:
Exception
-
handleTlsMissingModels
private void handleTlsMissingModels()for now, we just ignore TLS details if user has selected a specific model -
setTlsGroups
Sets the atom property property_tlsGroup based on TLS group ranges and adds "TLS" key to model's auxiliaryInfo.- Parameters:
iGroup-iModel-symmetry-
-
findAtomForRange
private int findAtomForRange(int atom1, int atom2, int chain, int resno, boolean isLast) -
findAtom
private int findAtom(int atom1, int atom2, int chain, int resno, boolean isTrue) -
setTlsTensor
-
tlsAddError
-
fixRadius
protected static float fixRadius(float r) -
addConnection
private void addConnection(int[] is) -
connectAllBad
private void connectAllBad(int maxSerial) -
connectAll
private void connectAll(int maxSerial, boolean isConnectStateBug)
-