Official github repository of public UnityMol source code releases -- more details at http://unitymol.sourceforge.net
This is the public version of UnityMol 1.0.36 source files released (July 2020) with ABPS-UnityMol paper: Visualizing biomolecular electrostatics in virtual reality with UnityMol-APBS (10.1002/pro.3773)
APBS integration was done by Joseph Laurenti.
Recent UnityMol versions can be found on sourceforge
UnityMol is based on the game engine Unity.
This version is working on Unity 2019.4.21f1 LTS, tested on Windows/Mac/Linux. Main developpement is done on Windows.
MainUIScene.unity
is the main scene for desktop.MainScene_VR_Desktop.unity
is the Virtual Reality (VR) scene that has a switch to turn VR on/off.The integration of APBS tools was mainly done by Joseph Laurenti from Nathan Baker's group at PNNL.
First, install PDB2PQR and APBS (https://sourceforge.net/projects/pdb2pqr/ & https://sourceforge.net/projects/apbs/), for example with "C:/APBS_PDB2PQR/apbs/bin/apbs.exe" & "C:/APBS_PDB2PQR/pdb2pqr/pdb2pqr.exe". Set executable path by clicking the first button of the PDB2PQR menu, UnityMol will look in sub directories for apbs and pdb2pqr binaries.
Note that some steps will load another molecular file and hide the previous one.
APBS tools are not binded to APIPython functions so you cannot script APBS calls for now.
For the VR scene to work, the VR headset must be first configured and functional with SteamVR.
UnityMol uses VRTK 3.x that is limited to the SteamVR plugin version 1.2.3, you must stick to this version (already imported in the project).
The scene lack of a skybox due to the large size of the image file needed. You can find nice examples on this website https://polyhaven.com/. For instance, we usually use this image https://polyhaven.com/a/noon_grass (version 4K).
To add it to the scene:
Shape
-> cube
Max Size
-> 4096
Use Crunch Compression
Cubemap
option of the skyhdr
material (under Assets/Ressources/Materiels
)Windows
->Rendering
->Lightning Settings
)This is implemented with IronPython, an interpreter for Python 2.7 in C#. You can use most of standard library python modules but not numpy of cython.
UnityMol implements an atom selection language, based on the MDAnalysis one. Please refer to MDAnalysis documentation (here) for a detailed explanation about the language and some examples.
The language is not fully implemented, also some keywords have been added.
To load and display a molecule from a script, use UMol.API.APIPython
functions:
using UnityEngine;
using UMol;
using UMol.API;
public class loadMolecule : MonoBehaviour {
void Start() {
UnityMolStructure s = APIPython.fetch("1KX2"); //This fetches the file from the PDB
UnityMolStructure s2 = APIPython.fetch("PDBs/3eam.cif"); //This loads a local file
UnityMolSelection sel = APIPython.select("3eam and resid 1:10 and chain A", "chainA"); //Create a selection
APIPython.showSelection("chainA", "hyperball"); //Show the selection as hyperball
APIPython.delete(s.name); //Remove a loaded molecule
//Use more APIPython functions here
}
}
Same commands from the python console:
s = fetch("1KX2")
s2 = load("PDBs/3eam.cif")
sel = select("3eam and resid 1:10 and chain A", "chainA")
showSelection("chainA", "hb")
delete(s.name)
LoadedMolecules
object will be created if it doesn't exist and all selections of the molecules will be created under it. The global scale is set by changing this LoadedMolecules
object.[VRTK_Scripts]
child objects in the VR scene. Grabbing molecules is based on a custom raycasting implementation (CustomRaycast
). The VR camera is different for each HMD type, check [VRTK_SDKManager]
object based on the VRTK framework.UnityMol is dual-licensed under the LGPL-3.0 (see under). However, all external assets used in UnityMol are under a permissive open-source license: MIT/Apache-2.0/BSD-3.0
For commercial use, UnityMol can be licensed under a custom license. Please contact [email protected]