Skip to content

ybyygu/gchemol-view

Repository files navigation

Introduction

gchemol-view is a simple molecule viewer based on gchemol and bevy.

img

Features

  • Lightweight molecule viewer: fast to load molecule with thousands of atoms
  • Load molecules by drag-and-drop for files or directories.
  • Input files generator for VASP, ORCA, Gaussian and more.
  • Remote view: view molecules locally sent from a remote client in the terminal without an X environment

Install

Binary install

Download prebuilt binary for Linux/Windows/MacOS on the release page.

Compile from sources

Linux GTK is required for using native file dialog: On Ubuntu:

sudo apt-get install libgtk-3-dev

How to use

Visualization of molecules from common file formats supported by gchemol

gchemol-view foo.xyz
gchemol-view POSCAR
gchemol-view foo.cif

View molecule sent from the command line without an X environment

You can view a molecule in gchemol-view on your local machine that was sent from a remote HPC server in command line using spdkit-python.

from spdkit import *

mol = Molecule.from_file("foo.mol2", remote=True)
view(mol, remote=True)

To achieve this, you need a working reverse SSH channel.

How to setup in Linux

Setup reverse port forwarding from desktop to remote SSH server:

ssh -N -R remote-port:localhost:3039 remote-ssh-server

To automatically set up a reverse channel when logging into a remote SSH server, you can create an entry in your ~/.ssh/config file.

host Khpcserver01
    hostname remote-ssh-server
    ExitOnForwardFailure yes
    RemoteForward {{remote-port}} localhost:3039

How to setup in Windows

If you are using XShell, you can refer to the image below:

img

Todo List

  • measure distance, angle, torsion angle
  • visuailize volume data: orbital, DOS, etc.
  • select atoms by atom serial numbers
  • better animation system
  • set atom freezing codes for optimization

Credits

Codes that inspired me: