# Class PyMOLReader

java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
org.jmol.adapter.readers.pdb.PdbReader
org.jmol.adapter.readers.pymol.PyMOLReader

All Implemented Interfaces:
  `GenericLineReader`

public class PyMOLReader extends PdbReader
PyMOL PSE (binary Python session) file reader. development started Feb 2013 Jmol 13.1.13 reasonably full implementation May 2013 Jmol 13.1.16 PyMOL state --> Jmol model PyMOL object --> Jmol named atom set, isosurface, CGO, or measurement PyMOL group --> Jmol named atom set (TODO: add isosurfaces and measures to these?) PyMOL movie: an initial view and a set of N "frames" PyMOL frame: references (a) a state, (b) a script, and (c) a view PyMOL scene --> Jmol scene, including view, frame, visibilities, colors using set LOGFILE, we can dump this to a readable form. trajectories are not supported yet. Basic idea is as follows: 1) Pickle file is read into a Hashtable. 2) Atoms, bonds, and structures are created, as per other readers, from MOLECULE objects 3) Rendering of atoms and bonds is interpreted as JmolObject objects via PyMOLScene 3) Other objects such as electron density maps, compiled graphical objects, and measures are interpreted, creating more JmolObjects 3) JmolObjects are finalized after file reading takes place by a call from ModelLoader back here to finalizeModelSet(), which runs PyMOLScene.setObjects, which runs JmolObject.finalizeObject. TODO: Handle discrete objects, DiscreteAtmToIdx?

Author:
  Bob Hanson hansonr@stolaf.edu

## Field Summary

### Fields inherited from class PdbReader

`biomtChainAtomCounts, fileAtomIndex, gromacsWideFormat, pdbID`

### Fields inherited from class 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, CELL_TYPE_SUPER, cellSlop, centroidPacked, checkNearAtoms, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCentroidUnitCell, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterAllHetero, filterCased, filteredPrecision, filterHetero, floatifyJavaDouble, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, is2D, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isSUPERCELL, isTrajectory, latticeCells, latticeScaling, latticeType, line, lowPrecision, lstNCS, matUnitCellOrientation, merging, modDim, modelNumber, ms, mustFinalizeModelSet, next, noHydrogens, noMinimize, noPack, optimize2D, out, paramsCentroid, paramsLattice, precision, 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
Constructor
Description
`PyMOLReader()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`compareAtoms(int iPrev, int i)`
`void`
`finalizeModelSet()`
At the end of the day, we need to finalize all the JmolObjects, set the trajectories, and, if filtered with DOCACHE, cache a streamlined binary file for inclusion in the PNGJ file.
`protected void`
`finalizeSubclassReader()`
`int`
`getCartoonType(int iAtom)`
`int`
`getSequenceNumber(int iAtom)`
`int`
`getUniqueID(int iAtom)`
PymolAtomReader interface
`double`
`getVDW(int iAtom)`
`protected void`
`initializeReader()`
`void`
`processBinaryDocument()`
`protected void`
`setAdditionalAtomParameters(Atom atom)`
adaptable via subclassing
`protected void`
`setup(String fullPath, Map<String,Object> htParams, Object reader)`
`static Lst<Object>`
`sublistAt(Lst<Object> mesh, int... pt)`

### Methods inherited from class PdbReader

`checkLine, checkRemark, deduceElementSymbol, filterPDBAtom, finalizeReaderPDB, fixRadius, model, processAtom, processAtom2`

### Methods inherited from class AtomSetCollectionReader

`addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addMoreUnitCellInfo, addSites, addSiteScript, appendLoadNote, 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, finalizeReaderASCR, finalizeSubclassSymmetry, fixDoubleA, fixFloatA, fixFloatPt, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFilterWithCase, getFortranFormatLengths, getInterface, getPackingRangeValue, getStrings, getSymmetry, getTokens, getTokensFloat, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, parsePrecision, parseToken, parseTokenNext, parseTokenRange, parseTokenStr, processDOM, rd, read3Vectors, readDataObject, readLines, readNextLine, rejectAtomName, RL, set2D, setAtomCoord, setAtomCoordScaled, setAtomCoordTokens, setAtomCoordXYZ, setChainID, setElementAndIsotope, setFilter, setFilterAtomTypeStr, setFractionalCoordinates, setIsPDB, setLoadNote, setModelPDB, setPrecision, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem, setupASCR, warnSkippingOperation`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PyMOLReader

public PyMOLReader()

## Method Details

### setup

protected void setup(String fullPath, Map<String,Object> htParams, Object reader)

Overrides:
  `setup` in class `AtomSetCollectionReader`

### initializeReader

protected void initializeReader() throws Exception

Overrides:
  `initializeReader` in class `PdbReader`
Throws:
  `Exception`

### processBinaryDocument

public void processBinaryDocument() throws Exception

Overrides:
  `processBinaryDocument` in class `AtomSetCollectionReader`
Throws:
  `Exception`

### setAdditionalAtomParameters

protected void setAdditionalAtomParameters(Atom atom)
Description copied from class: `PdbReader`
adaptable via subclassing

Overrides:
  `setAdditionalAtomParameters` in class `PdbReader`
Parameters:
  `atom` -

### finalizeSubclassReader

protected void finalizeSubclassReader() throws Exception

Overrides:
  `finalizeSubclassReader` in class `PdbReader`
Throws:
  `Exception`

### finalizeModelSet

public void finalizeModelSet()
At the end of the day, we need to finalize all the JmolObjects, set the trajectories, and, if filtered with DOCACHE, cache a streamlined binary file for inclusion in the PNGJ file.

Overrides:
  `finalizeModelSet` in class `AtomSetCollectionReader`

### sublistAt

public static Lst<Object> sublistAt(Lst<Object> mesh, int... pt)

### getUniqueID

public int getUniqueID(int iAtom)
PymolAtomReader interface

### getCartoonType

public int getCartoonType(int iAtom)

### getVDW

public double getVDW(int iAtom)

### getSequenceNumber

public int getSequenceNumber(int iAtom)

### compareAtoms

public boolean compareAtoms(int iPrev, int i)