Package org.jmol.adapter.readers.pymol
Class PyMOLScene
java.lang.Object
org.jmol.adapter.readers.pymol.PyMOLScene
- All Implemented Interfaces:
JmolSceneGenerator
A class to allow manipulation of scenes dissociated from file loading. A
"scene" in this context is a distillation of PyMOL information into a
Hashtable for easier retrieval using RESTORE SCENE name.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javajs.util.Lst
<Integer> private int
private int
private int
private javajs.util.BS
private javajs.util.BS
private javajs.util.BS
(package private) javajs.util.BS
(package private) javajs.util.BS
(package private) javajs.util.BS
private javajs.util.BS
(package private) javajs.util.BS
(package private) javajs.util.BS
(package private) javajs.util.BS
private javajs.util.BS
private javajs.util.BS
private int
private boolean
private boolean
private float
private int[]
private short[]
(package private) int
(package private) boolean
private int
private JmolObject
private Map
<String, PyMOLGroup> private boolean
private boolean
private Map
<String, MeasurementData[]> private javajs.util.Lst
<JmolObject> private int
private int
private javajs.util.P3
private javajs.util.P3
private float
private static final int[]
(package private) String
private float
private javajs.util.Lst
<String> private boolean[]
private float
private float
private boolean
private String
private String
private String
private int
private final javajs.util.P3
private int
private float[]
private PymolAtomReader
private int
private float
private int[]
private javajs.util.Lst
<Object> private boolean
private int
private float
private float
private int
private float
private int
(package private) String
private int
private int
private float
private int[]
private Viewer
-
Constructor Summary
ConstructorsConstructorDescriptionPyMOLScene
(PymolAtomReader reader, Viewer vwr, javajs.util.Lst<Object> settings, Map<Integer, javajs.util.Lst<Object>> uniqueSettings, int pymolVersion, boolean haveScenes, int baseAtomIndex, int baseModelIndex, boolean doCache, String filePath) -
Method Summary
Modifier and TypeMethodDescription(package private) String
(package private) PyMOLGroup
Create a hierarchical list of named groups as generally seen on the PyMOL app's right-hand object menu.(package private) JmolObject
addIsosurface
(String objectName) private JmolObject
addJmolObject
(int id, javajs.util.BS bsAtoms, Object info) (package private) void
(package private) boolean
addMeasurements
(MeasurementData[] mdList, int nCoord, javajs.util.Lst<Object> list, javajs.util.BS bsReps, int color, javajs.util.Lst<Object> offsets, boolean haveLabels) (package private) void
private JmolObject
addObject
(JmolObject obj) private void
addSetting
(int key, int type, Object val) (package private) boolean
booleanSetting
(int i) (package private) void
buildScene
(String name, javajs.util.Lst<Object> thisScene, Map<String, javajs.util.Lst<Object>> htObjNames, Map<String, javajs.util.Lst<Object>> htSecrets) Build a scene at file reading time.private void
checkNucleicObject
(javajs.util.BS bs, boolean isTrace) private void
cleanSingletons
(javajs.util.BS bs) PyMOL does not display cartoons or traces for single-residue runs.private void
private int
colorSetting
(int i) private void
createCartoonObject
(String key, int sizeID) private void
createPuttyObject
(javajs.util.BS bs) "Putty" shapes scaled in a variety of ways.private void
createRibbonObject
(javajs.util.BS bs) PyMOL "ribbons" could be Jmol backbone or trace, depending upon the value of PyMOL.ribbon_sampling.private void
createShapeObject
(int shapeID, javajs.util.BS bs) Create JmolObjects for each shape.(package private) void
createShapeObjects
(javajs.util.BS[] reps, boolean allowSurface, int ac0, int ac) create all objects for a given molecule or sceneprivate void
Create a BALLS JmolObject for each radius.private void
createTraceObject
(javajs.util.BS bs) trace, or cartoon in the case of cartoon ladders.private void
defineAtoms
(String name, javajs.util.BS bs) (package private) void
ensureCapacity
(int n) private void
Finally, we turn each JmolObject into its Jmol equivalent.private void
(package private) void
Create group JmolObjects, and set hierarchical visibilitiesprivate String
private void
fixReps
(javajs.util.BS[] reps) (package private) float
floatSetting
(int i) private void
generateColors
(Object[] colors) Set PyMOL "atom-wise" colors -- the colors that are defined initially as element colors but possibly set with the PyMOL 'color' command and are used when representation colors (cartoon, dots, etc.) are not defined (-1).void
generateScene
(Map<String, Object> scene) Generate the saved scene using file settings preserved here and scene-specific information including frame, view, colors, visibilities, .private void
generateShapes
(Object[] reps) Create all Jmol shape objects.private void
generateVisibilities
(Map<String, Object> vis) Hide everything, then just make visible the sets of atoms specified in the visibility (i.e.private javajs.util.BS
private void
getBsAtoms
(javajs.util.Lst<Object> list, int[] atomMap, javajs.util.BS bs) (package private) short
getColix
(int colorIndex, float translucency) (package private) PyMOLGroup
private String
getJmolName
(String name) private JmolObject
getJmolObject
(int id, javajs.util.BS bsAtoms, Object info) (package private) String
getObjectID
(String name) (package private) javajs.util.Lst
<Object> getObjectSetting
(int i) private void
private int
getObjectType
(String name) private float[]
getPymolView
(javajs.util.Lst<Object> view, boolean isViewObj) adds depth_cue, fog, and fog_startprivate javajs.util.BS
getSelectionAtoms
(javajs.util.Lst<Object> molecules, int istate, javajs.util.BS bs) Add selected atoms to a growing bit set.private javajs.util.Lst
<Object> getSetting
(int i) (package private) javajs.util.BS
getSSMapAtom
(String ssType) (package private) float
getUniqueFloatDef
(int id, int key, float defaultValue) (package private) javajs.util.P3
getUniquePoint
(int id, int key, javajs.util.P3 pt) (package private) javajs.util.SB
getViewScript
(javajs.util.Lst<Object> view) (package private) float
globalSetting
(int i) private void
listToSettings
(javajs.util.Lst<Object> list, Map<Integer, javajs.util.Lst<Object>> objectSettings) (package private) boolean
private Text
newTextLabel
(String label, float[] labelOffset, int colorIndex, int fontID, float fontSize) (package private) void
private javajs.util.P3
pointSetting
(int i) (package private) void
processSelection
(javajs.util.Lst<Object> selection) process the selection sets (sele), (...)private void
selectAllAtoms
(javajs.util.Lst<Object> obj, int istate, javajs.util.BS bs) Collect all the atoms specified by an object state into a bit set.(package private) void
setAtomColor
(int atomColor) (package private) void
setAtomInfo
(int[] uniqueIDs, int[] cartoonTypes, int[] sequenceNumbers, boolean[] newChain, float[] radii) (package private) javajs.util.BS
setAtomMap
(int[] atomMap, int ac0) (package private) void
setBondParameters
(Bond b, int modelIndex, float rad, float pymolValence, int argb, float trans) used in PyMOL reader to set unique bond settings and for valence(package private) void
setCarveSets
(Map<String, javajs.util.Lst<Object>> htObjNames) (package private) void
setFrameObject
(int type, Object info) private void
private void
setGroupVisible
(PyMOLGroup g, boolean parentVis) Iterate through groups, setting visibility flags.(package private) float[]
setLabelPosition
(javajs.util.P3 offset, float[] labelPos) (package private) void
setReaderObjectInfo
(String name, int type, String groupName, boolean isHidden, javajs.util.Lst<Object> listObjSettings, javajs.util.Lst<Object> listStateSettings, String ext) (package private) void
private void
setSceneObject
(String name, int istate) Set scene object/state-specific global fields and settings based on the name and state or stored values from when the file was loaded.(package private) void
setStateCount
(int stateCount) (package private) void
setUniqueBond
(int index, int uniqueID) (package private) void
setUniqueBonds
(javajs.util.BS bsBonds, boolean isSticks) private JmolObject
setUniqueObjects
(int shape, javajs.util.BS bs, int setColor, int color, int setTrans, float trans, int setSize, float size, float f) private void
Attempt to adjust for PyMOL versions.(package private) String
stringSetting
(int i)
-
Field Details
-
vwr
-
pymolVersion
private int pymolVersion -
bsHidden
javajs.util.BS bsHidden -
bsNucleic
javajs.util.BS bsNucleic -
bsNonbonded
javajs.util.BS bsNonbonded -
bsLabeled
javajs.util.BS bsLabeled -
bsHydrogen
javajs.util.BS bsHydrogen -
bsNoSurface
javajs.util.BS bsNoSurface -
htSpacefill
-
ssMapAtom
-
atomColorList
-
occludedObjects
-
labels
-
colixes
private short[] colixes -
frameObj
-
groups
-
objectSettings
-
bsCartoon
private javajs.util.BS bsCartoon -
htCarveSets
-
htDefinedAtoms
-
htHiddenObjects
-
moleculeNames
-
jmolObjects
-
htAtomMap
-
htObjectAtoms
-
htObjectGroups
-
htMeasures
-
htObjectSettings
-
objectInfo
-
settings
-
htStateSettings
-
stateSettings
-
uniqueSettings
-
uniqueList
-
bsUniqueBonds
private javajs.util.BS bsUniqueBonds -
bgRgb
private int bgRgb -
dotColor
private int dotColor -
surfaceMode
private int surfaceMode -
surfaceColor
private int surfaceColor -
cartoonColor
private int cartoonColor -
ribbonColor
private int ribbonColor -
sphereColor
private int sphereColor -
labelFontId
private int labelFontId -
labelColor
private int labelColor -
cartoonTranslucency
private float cartoonTranslucency -
ribbonTranslucency
private float ribbonTranslucency -
labelSize
private float labelSize -
meshWidth
private float meshWidth -
nonbondedSize
private float nonbondedSize -
nonbondedTranslucency
private float nonbondedTranslucency -
sphereScale
private float sphereScale -
sphereTranslucency
private float sphereTranslucency -
stickTranslucency
private float stickTranslucency -
transparency
private float transparency -
cartoonLadderMode
private boolean cartoonLadderMode -
cartoonRockets
private boolean cartoonRockets -
haveNucleicLadder
private boolean haveNucleicLadder -
labelPosition
private javajs.util.P3 labelPosition -
labelPosition0
private javajs.util.P3 labelPosition0 -
objectName
-
objectNameID
-
objectJmolName
-
objectType
private int objectType -
bsAtoms
private javajs.util.BS bsAtoms -
objectHidden
private boolean objectHidden -
reader
-
uniqueIDs
private int[] uniqueIDs -
cartoonTypes
private int[] cartoonTypes -
sequenceNumbers
private int[] sequenceNumbers -
newChain
private boolean[] newChain -
radii
private float[] radii -
baseModelIndex
private int baseModelIndex -
baseAtomIndex
private int baseAtomIndex -
stateCount
private int stateCount -
mepList
String mepList -
doCache
boolean doCache -
haveScenes
private boolean haveScenes -
bsCarve
private javajs.util.BS bsCarve -
solventAccessible
private boolean solventAccessible -
bsLineBonds
private javajs.util.BS bsLineBonds -
bsStickBonds
private javajs.util.BS bsStickBonds -
thisState
private int thisState -
currentAtomSetIndex
int currentAtomSetIndex -
surfaceInfoName
String surfaceInfoName -
ptTemp
private final javajs.util.P3 ptTemp -
MEAS_DIGITS
private static final int[] MEAS_DIGITS
-
-
Constructor Details
-
PyMOLScene
-
-
Method Details
-
clearReaderData
private void clearReaderData() -
setUniqueBond
void setUniqueBond(int index, int uniqueID) -
setStateCount
void setStateCount(int stateCount) -
colorSetting
private int colorSetting(int i) -
pointSetting
private javajs.util.P3 pointSetting(int i) -
ensureCapacity
void ensureCapacity(int n) -
setReaderObjectInfo
-
listToSettings
-
getObjectSettings
private void getObjectSettings() -
setAtomInfo
void setAtomInfo(int[] uniqueIDs, int[] cartoonTypes, int[] sequenceNumbers, boolean[] newChain, float[] radii) -
setSceneObject
Set scene object/state-specific global fields and settings based on the name and state or stored values from when the file was loaded.- Parameters:
name
-istate
-
-
buildScene
void buildScene(String name, javajs.util.Lst<Object> thisScene, Map<String, javajs.util.Lst<Object>> htObjNames, Map<String, javajs.util.Lst<Object>> htSecrets) Build a scene at file reading time. We only implement frame-specific scenes. Creates a map of information that can be used later and will also be a reference to this instance of PyMOLScene, which is an implementation of JmolSceneGenerator.- Parameters:
name
-thisScene
-htObjNames
-htSecrets
-
-
generateScene
Generate the saved scene using file settings preserved here and scene-specific information including frame, view, colors, visibilities, . Called by StateManager via implemented JmolSceneGenerator.- Specified by:
generateScene
in interfaceJmolSceneGenerator
- Parameters:
scene
-
-
generateColors
Set PyMOL "atom-wise" colors -- the colors that are defined initially as element colors but possibly set with the PyMOL 'color' command and are used when representation colors (cartoon, dots, etc.) are not defined (-1). This is the same as Jmol's inherited atom color.- Parameters:
colors
-
-
processSelection
process the selection sets (sele), (...)- Parameters:
selection
-
-
getSelectionAtoms
private javajs.util.BS getSelectionAtoms(javajs.util.Lst<Object> molecules, int istate, javajs.util.BS bs) Add selected atoms to a growing bit set.- Parameters:
molecules
-istate
-bs
-- Returns:
- bs for convenience
-
selectAllAtoms
Collect all the atoms specified by an object state into a bit set.- Parameters:
obj
-istate
- 0 for "all states"bs
-
-
generateVisibilities
Hide everything, then just make visible the sets of atoms specified in the visibility (i.e. "activity") list within scene_dict.- Parameters:
vis
-
-
generateShapes
Create all Jmol shape objects.- Parameters:
reps
-
-
getBS
-
getBsAtoms
-
setReaderObjects
void setReaderObjects() -
finalizeObjects
private void finalizeObjects()Finally, we turn each JmolObject into its Jmol equivalent. -
offsetObjects
void offsetObjects() -
getJmolObject
-
addJmolObject
-
getPymolView
adds depth_cue, fog, and fog_start- Parameters:
view
-isViewObj
-- Returns:
- 22-element array
-
globalSetting
float globalSetting(int i) -
addGroup
PyMOLGroup addGroup(javajs.util.Lst<Object> object, String parent, int type, javajs.util.BS bsAtoms) Create a hierarchical list of named groups as generally seen on the PyMOL app's right-hand object menu.- Parameters:
object
-parent
-type
-bsAtoms
-- Returns:
- group
-
getGroup
-
finalizeVisibility
void finalizeVisibility()Create group JmolObjects, and set hierarchical visibilities -
setCarveSets
-
setGroupVisibilities
private void setGroupVisibilities() -
defineAtoms
-
getJmolName
-
createShapeObjects
void createShapeObjects(javajs.util.BS[] reps, boolean allowSurface, int ac0, int ac) create all objects for a given molecule or scene- Parameters:
reps
-allowSurface
-ac0
- > 0 for a molecule; -1 for a sceneac
-
-
addLabel
-
getUniqueFloatDef
float getUniqueFloatDef(int id, int key, float defaultValue) -
getUniquePoint
javajs.util.P3 getUniquePoint(int id, int key, javajs.util.P3 pt) -
getObjectSetting
-
booleanSetting
boolean booleanSetting(int i) -
floatSetting
float floatSetting(int i) -
stringSetting
-
getSetting
-
setLabelPosition
float[] setLabelPosition(javajs.util.P3 offset, float[] labelPos) -
addCGO
-
addMeasurements
boolean addMeasurements(MeasurementData[] mdList, int nCoord, javajs.util.Lst<Object> list, javajs.util.BS bsReps, int color, javajs.util.Lst<Object> offsets, boolean haveLabels) -
getViewScript
-
getColix
short getColix(int colorIndex, float translucency) -
setAtomColor
void setAtomColor(int atomColor) -
setFrameObject
-
fixName
-
getObjectID
-
getObjectType
-
setAtomMap
javajs.util.BS setAtomMap(int[] atomMap, int ac0) -
newTextLabel
-
setVersionSettings
private void setVersionSettings()Attempt to adjust for PyMOL versions. See PyMOL layer3.Executive.c -
addSetting
-
fixReps
private void fixReps(javajs.util.BS[] reps) -
cleanSingletons
private void cleanSingletons(javajs.util.BS bs) PyMOL does not display cartoons or traces for single-residue runs. This two-pass routine first sets bits in a residue bitset, then it clears out all singletons, and in a second pass all atom bits for not-represented residues are cleared.- Parameters:
bs
-
-
createShapeObject
private void createShapeObject(int shapeID, javajs.util.BS bs) Create JmolObjects for each shape. Note that LINES and STICKS are done initially, then all the others are processed.- Parameters:
shapeID
-bs
-
-
setUniqueObjects
private JmolObject setUniqueObjects(int shape, javajs.util.BS bs, int setColor, int color, int setTrans, float trans, int setSize, float size, float f) -
createSpacefillObjects
private void createSpacefillObjects()Create a BALLS JmolObject for each radius. -
createTraceObject
private void createTraceObject(javajs.util.BS bs) trace, or cartoon in the case of cartoon ladders.- Parameters:
bs
-
-
checkNucleicObject
private void checkNucleicObject(javajs.util.BS bs, boolean isTrace) -
createPuttyObject
private void createPuttyObject(javajs.util.BS bs) "Putty" shapes scaled in a variety of ways.- Parameters:
bs
-
-
createRibbonObject
private void createRibbonObject(javajs.util.BS bs) PyMOL "ribbons" could be Jmol backbone or trace, depending upon the value of PyMOL.ribbon_sampling.- Parameters:
bs
-
-
createCartoonObject
-
addObject
-
setGroupVisible
Iterate through groups, setting visibility flags.- Parameters:
g
-parentVis
-
-
getSSMapAtom
-
setAtomDefs
-
needSelections
boolean needSelections() -
setUniqueBonds
void setUniqueBonds(javajs.util.BS bsBonds, boolean isSticks) -
finalizeUniqueBonds
private void finalizeUniqueBonds() -
setBondParameters
void setBondParameters(Bond b, int modelIndex, float rad, float pymolValence, int argb, float trans) used in PyMOL reader to set unique bond settings and for valence- Parameters:
b
-modelIndex
-rad
-pymolValence
- 1 for "show multiple bonds"argb
-trans
-
-
addMesh
-
addIsosurface
-