Class PdbReader

  • All Implemented Interfaces:
    javajs.api.GenericLineReader
    Direct Known Subclasses:
    JmolDataReader, P2nReader, PqrReader, PyMOLReader

    public class PdbReader
    extends AtomSetCollectionReader
    PDB file reader.

    http://www.rcsb.org

    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 Detail

      • 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
      • htElementsInCurrentGroup

        private Map<String,​Boolean> htElementsInCurrentGroup
      • vBiomolecules

        private javajs.util.Lst<Map<String,​Object>> vBiomolecules
      • 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
      • currentGroup3

        private String currentGroup3
      • currentKey

        private String currentKey
      • currentResno

        private int currentResno
      • configurationPtr

        private int configurationPtr
      • resetKey

        private boolean resetKey
      • compnd

        private String 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
      • maxLength

        private int maxLength
      • haveDoubleBonds

        private boolean haveDoubleBonds
      • cryst1

        private float cryst1
      • fileSgName

        private String fileSgName
      • dataT

        private final float[] dataT
      • tlsU

        private Map<Atom,​float[]> tlsU
      • vConnect

        private javajs.util.Lst<int[]> vConnect
      • connectNextAtomIndex

        private int connectNextAtomIndex
      • connectNextAtomSet

        private int connectNextAtomSet
      • connectLast

        private int[] connectLast
    • Constructor Detail

      • PdbReader

        public PdbReader()
    • Method Detail

      • checkRemark

        protected void checkRemark()
      • seqAdv

        private void seqAdv()
      • finalizeReaderPDB

        protected void finalizeReaderPDB()
                                  throws Exception
        Throws:
        Exception
      • checkUnitCellParams

        private void checkUnitCellParams()
      • checkForResidualBFactors

        private void checkForResidualBFactors​(SymmetryInterface symmetry)
      • header

        private void header()
      • title

        private void title()
      • compnd

        private void compnd​(boolean isSource)
      • setBiomoleculeAtomCounts

        private void setBiomoleculeAtomCounts()
      • remark285

        private boolean remark285()
      • getSerial

        private int getSerial​(int i,
                              int j)
      • getSeqNo

        private int getSeqNo​(int i,
                             int j)
      • processAtom

        protected Atom processAtom​(Atom atom,
                                   String name,
                                   char altID,
                                   String group3,
                                   int chainID,
                                   int seqNo,
                                   char insCode,
                                   boolean isHetero,
                                   String sym)
      • processAtom2

        protected void processAtom2​(Atom atom,
                                    int serial,
                                    float x,
                                    float y,
                                    float z,
                                    int charge)
      • atom

        private void atom()
      • filterPDBAtom

        protected boolean filterPDBAtom​(Atom atom,
                                        int iAtom)
      • setAdditionalAtomParameters

        protected void setAdditionalAtomParameters​(Atom atom)
        adaptable via subclassing
        Parameters:
        atom -
      • deduceElementSymbol

        protected String deduceElementSymbol​(boolean isHetero)
        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()
      • model

        protected void model​(int modelNumber)
      • checkNotPDB

        private void checkNotPDB()
      • getFloat

        private float getFloat​(int ich,
                               int cch)
                        throws Exception
        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()
      • handleTlsMissingModels

        private void handleTlsMissingModels()
        for now, we just ignore TLS details if user has selected a specific model
      • setTlsGroups

        private void setTlsGroups​(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.
        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)
      • tlsAddError

        private void tlsAddError​(String error)
      • 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)