Skip to main content

Render SMILES into 3D video

Project description

Tern Viz

Open In Colab

Convert SMILES to a 3D rotating video. Check-out the Twitter bot @ternviz!

Install

You need to install both VMD and ffmpeg. After that:

pip install ternviz

Usage

It can be used to render stills, rotating videos, comparisons of molecules, and compilation videos of multiple proteins.

Render a molecule

To render a molecule:

ternviz CCCO

You may need to specify the path to VMD or ffmpeg:

ternviz CO --vmd /path/to/vmd/executable

You can modify a few things too:

ternviz CCCO --name "my molecule" --color white

try --low-quality to render quickly.

Render a protein

This will do a still frame

ternviz-pdb 1A1L

To do a rotating movie, specify number of frames (at 60 fps)

ternviz-pdb 1A1L --frames 60

You can pass in multiple PDBs

ternviz-pdb my.pdb other.pdb

You can specify how the structure is colored and other details

ternviz-pdb 1A1L --frames 60 --color white --scolor Chain

Aligning PDBs

You can align structures before rendering

ternviz-align ref.pdb *.pdb

by default it aligns on the protein. You can also change selection string, using MDAnalysis Selection String Syntax

ternviz-align ref.pdb --sel "chainid B" *.pdb

Example Render

https://user-images.githubusercontent.com/908389/147892964-c15ac0fd-44be-4473-b82a-799260e0f373.mp4

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ternviz-0.6.2.tar.gz (12.3 kB view hashes)

Uploaded Source

Built Distribution

ternviz-0.6.2-py3-none-any.whl (13.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page