Skip to content

zhangfq-chemistry/gchemol-view

 
 

Repository files navigation

Introduction

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

img

Interesting features

  • Lightweight molecule viewer: fast to load molecule with thousands of atoms
  • 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

  • fix visualiation of lattice in trajectory animation
  • set atom freezing codes for optimization
  • select atoms by atom serial numbers
  • measure distance, angle, torsion angle

Credits

Codes that inspired me:

About

A simple molecule viewer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 91.8%
  • JavaScript 4.2%
  • Shell 1.8%
  • HTML 1.4%
  • CSS 0.8%