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 intprivate intprivate intprivate javajs.util.BSprivate javajs.util.BSprivate javajs.util.BS(package private) javajs.util.BS(package private) javajs.util.BS(package private) javajs.util.BSprivate javajs.util.BS(package private) javajs.util.BS(package private) javajs.util.BS(package private) javajs.util.BSprivate javajs.util.BSprivate javajs.util.BSprivate intprivate booleanprivate booleanprivate floatprivate int[]private short[](package private) int(package private) booleanprivate intprivate JmolObjectprivate Map<String,PyMOLGroup> private booleanprivate booleanprivate Map<String,MeasurementData[]> private javajs.util.Lst<JmolObject>private intprivate intprivate javajs.util.P3private javajs.util.P3private floatprivate static final int[](package private) Stringprivate floatprivate javajs.util.Lst<String>private boolean[]private floatprivate floatprivate booleanprivate Stringprivate Stringprivate Stringprivate intprivate final javajs.util.P3private intprivate float[]private PymolAtomReaderprivate intprivate floatprivate int[]private javajs.util.Lst<Object>private booleanprivate intprivate floatprivate floatprivate intprivate floatprivate int(package private) Stringprivate intprivate intprivate floatprivate 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) PyMOLGroupCreate a hierarchical list of named groups as generally seen on the PyMOL app's right-hand object menu.(package private) JmolObjectaddIsosurface(String objectName) private JmolObjectaddJmolObject(int id, javajs.util.BS bsAtoms, Object info) (package private) void(package private) booleanaddMeasurements(MeasurementData[] mdList, int nCoord, javajs.util.Lst<Object> list, javajs.util.BS bsReps, int color, javajs.util.Lst<Object> offsets, boolean haveLabels) (package private) voidprivate JmolObjectaddObject(JmolObject obj) private voidaddSetting(int key, int type, Object val) (package private) booleanbooleanSetting(int i) (package private) voidbuildScene(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 voidcheckNucleicObject(javajs.util.BS bs, boolean isTrace) private voidcleanSingletons(javajs.util.BS bs) PyMOL does not display cartoons or traces for single-residue runs.private voidprivate intcolorSetting(int i) private voidcreateCartoonObject(String key, int sizeID) private voidcreatePuttyObject(javajs.util.BS bs) "Putty" shapes scaled in a variety of ways.private voidcreateRibbonObject(javajs.util.BS bs) PyMOL "ribbons" could be Jmol backbone or trace, depending upon the value of PyMOL.ribbon_sampling.private voidcreateShapeObject(int shapeID, javajs.util.BS bs) Create JmolObjects for each shape.(package private) voidcreateShapeObjects(javajs.util.BS[] reps, boolean allowSurface, int ac0, int ac) create all objects for a given molecule or sceneprivate voidCreate a BALLS JmolObject for each radius.private voidcreateTraceObject(javajs.util.BS bs) trace, or cartoon in the case of cartoon ladders.private voiddefineAtoms(String name, javajs.util.BS bs) (package private) voidensureCapacity(int n) private voidFinally, we turn each JmolObject into its Jmol equivalent.private void(package private) voidCreate group JmolObjects, and set hierarchical visibilitiesprivate Stringprivate voidfixReps(javajs.util.BS[] reps) (package private) floatfloatSetting(int i) private voidgenerateColors(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).voidgenerateScene(Map<String, Object> scene) Generate the saved scene using file settings preserved here and scene-specific information including frame, view, colors, visibilities, .private voidgenerateShapes(Object[] reps) Create all Jmol shape objects.private voidgenerateVisibilities(Map<String, Object> vis) Hide everything, then just make visible the sets of atoms specified in the visibility (i.e.private javajs.util.BSprivate voidgetBsAtoms(javajs.util.Lst<Object> list, int[] atomMap, javajs.util.BS bs) (package private) shortgetColix(int colorIndex, float translucency) (package private) PyMOLGroupprivate StringgetJmolName(String name) private JmolObjectgetJmolObject(int id, javajs.util.BS bsAtoms, Object info) (package private) StringgetObjectID(String name) (package private) javajs.util.Lst<Object>getObjectSetting(int i) private voidprivate intgetObjectType(String name) private float[]getPymolView(javajs.util.Lst<Object> view, boolean isViewObj) adds depth_cue, fog, and fog_startprivate javajs.util.BSgetSelectionAtoms(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.BSgetSSMapAtom(String ssType) (package private) floatgetUniqueFloatDef(int id, int key, float defaultValue) (package private) javajs.util.P3getUniquePoint(int id, int key, javajs.util.P3 pt) (package private) javajs.util.SBgetViewScript(javajs.util.Lst<Object> view) (package private) floatglobalSetting(int i) private voidlistToSettings(javajs.util.Lst<Object> list, Map<Integer, javajs.util.Lst<Object>> objectSettings) (package private) booleanprivate TextnewTextLabel(String label, float[] labelOffset, int colorIndex, int fontID, float fontSize) (package private) voidprivate javajs.util.P3pointSetting(int i) (package private) voidprocessSelection(javajs.util.Lst<Object> selection) process the selection sets (sele), (...)private voidselectAllAtoms(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) voidsetAtomColor(int atomColor) (package private) voidsetAtomInfo(int[] uniqueIDs, int[] cartoonTypes, int[] sequenceNumbers, boolean[] newChain, float[] radii) (package private) javajs.util.BSsetAtomMap(int[] atomMap, int ac0) (package private) voidsetBondParameters(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) voidsetCarveSets(Map<String, javajs.util.Lst<Object>> htObjNames) (package private) voidsetFrameObject(int type, Object info) private voidprivate voidsetGroupVisible(PyMOLGroup g, boolean parentVis) Iterate through groups, setting visibility flags.(package private) float[]setLabelPosition(javajs.util.P3 offset, float[] labelPos) (package private) voidsetReaderObjectInfo(String name, int type, String groupName, boolean isHidden, javajs.util.Lst<Object> listObjSettings, javajs.util.Lst<Object> listStateSettings, String ext) (package private) voidprivate voidsetSceneObject(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) voidsetStateCount(int stateCount) (package private) voidsetUniqueBond(int index, int uniqueID) (package private) voidsetUniqueBonds(javajs.util.BS bsBonds, boolean isSticks) private JmolObjectsetUniqueObjects(int shape, javajs.util.BS bs, int setColor, int color, int setTrans, float trans, int setSize, float size, float f) private voidAttempt to adjust for PyMOL versions.(package private) StringstringSetting(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:
generateScenein 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:
modelIndex-b-rad-pymolValence- 1 for "show multiple bonds"argb-trans-
-
addMesh
-
addIsosurface
-