PyMOL Open-Source Documentation
repository·master·Indexed 23 days ago
https://github.com/schrodinger/pymol-open-sourceThe open-source foundation of PyMOL, a molecular visualization system. This repository provides the core codebase, including the CHAMP module for chemical atom manipulation with patterns, lighting settings GUI tools, and support for OpenVR visualization with HTC Vive hardware.
What's inside PyMOL Open-Source
- Open-Source PyMOL is the open-source foundation of the user-sponsored PyMOL molecular visualization system. While this repository provides the open-source version, the commercial version, known as "Incentive PyMOL," which includes maintenance and support, is available through the official PyMOL website.
Requirements for using the OpenVR extension in PyMOL
masterTo use the OpenVR extension for VR visualization in PyMOL, you must meet the following hardware and software requirements:
Hardware Requirements
- VR System: Currently supports HTC Vive only. Ensure your VR system is installed and configured via the VIVE Setup site.
- Recommended PC Specs:
- Processor: Intel™ Core™ i5-4590 or AMD FX™ 8350 (or better).
- Graphics: NVIDIA GeForce™ GTX 1060 or AMD Radeon™ RX 480 (or better).
- Memory: 4 GB RAM or more.
- Video Output: 1x HDMI 1.4 port, or DisplayPort 1.2 or newer.
- USB: 1x USB 2.0 port or newer.
- Operating System: Windows™ 7 SP1, Windows™ 8.1, or Windows™ 10.
- Performance Check: It is recommended to run the ViveCheck.exe tool to ensure your PC meets performance standards.
Software Requirements
- SteamVR: At least version
1533664367(from August 7, 2018) is required, though the most recent Steam version is recommended to ensure API compatibility.
Note: You can still run PyMOL on systems without VR hardware. While the OpenVR stereo mode will be unavailable, all other PyMOL features will function normally.
Overview of CHAMP (CHemical Atom Manipulation with Patterns)
masterCHAMP is a module designed for chemical atom manipulation using patterns. While it is a component of the PyMOL molecular graphics system, the CHAMP code is built as a separate entity. This separation allows developers to use the CHAMP module in environments outside of the standard PyMOL interpreter.Launch PyMOL from within Python
masterIf PyMOL has been built as a module, you can launch it from within a Python script. To do this, ensure the following module directories are in your Python search path (
sys.pathorPYTHONPATH):pymolchempypmg_tkPmw
You must also set the
PYMOL_PATHenvironment variable to the root directory of your PyMOL installation.Note: If you have built external dependencies separately, you may also need to set the
LD_LIBRARY_PATHenvironment variable to include the paths to those dependencies.# Example using csh on unix setenv PYMOL_PATH $HOME/pymol setenv PYTHONPATH $PYMOL_PATH/modules python launch.pyUse Lighting Presets
masterThe Lighting Settings plugin provides several built-in presets to quickly adjust the visual appearance of molecular models. These can be triggered via the GUI buttons or by calling the following functions directly in the PyMOL command line:
preset_default(): Resets lighting to standard default values.preset_metal(): Configures settings for a metallic appearance.preset_plastic(): Configures settings for a plastic appearance.preset_rubber(): Configures settings for a rubber appearance.preset_xray(): Configures settings for an X-ray visual style.
preset_metal() preset_plastic() preset_rubber() preset_xray()Launch the Lighting Settings GUI
masterTo open the interactive Lighting Settings dialog in PyMOL, call thelightingsettings()function. This function initializes the GUI if it hasn't been created yet and brings the dialog to the foreground.Update Lighting Settings Programmatically
masterTo update a specific lighting setting and ensure the GUI (if open) reflects the change, use theupdate_setting(name, value)function. This function callscmd.set(name, value)and updates the correspondingSettingSliderin the dialog.Reference: Lighting Setting Keys
masterThe plugin manipulates PyMOL settings using
cmd.set(). The following keys are managed by the Lighting Settings GUI and its presets:# Diffuse Reflection 'ambient' 'reflect' 'direct (+reflect)' # maps to 'direct' 'spec_direct' 'spec_direct_power' # Free placeable directed Lights 'light_count' 'edit_light' # Specular Reflection 'spec_count' 'shininess' # same as spec_power 'spec_reflect' 'specular' 'specular_intensity' # same as specular # Ambient Occlusion (Surface only) 'ambient_occlusion_mode' 'ambient_occlusion_scale' 'ambient_occlusion_smooth' # Ray trace only 'power' 'reflect_power'