Giter Site home page Giter Site logo

eigenstate / vmd-python Goto Github PK

View Code? Open in Web Editor NEW
127.0 9.0 24.0 40.99 MB

Installable VMD as a python module

License: Other

Shell 0.15% C 41.21% Tcl 35.72% JavaScript 0.02% GLSL 0.01% HTML 0.74% Perl 0.01% CSS 0.01% Makefile 0.46% C++ 8.81% Cuda 2.56% Python 0.63% Java 0.39% Lex 0.02% Yacc 0.02% Rich Text Format 9.23% SWIG 0.01% Raku 0.01% Rez 0.01%

vmd-python's Introduction

vmd-python

Installable VMD as a python module

NEW: Support for new arm64 macs!

Version 3.0 has the following new features

  • Atomselection attributes can be accessed or set more easily: atomsel.get("x") can be written as atomsel.x!
  • Removed extra info dumped to stdout
  • Docstrings for all methods and modules
  • Much more functionality as Python methods! atomsel.hbonds, etc
  • The selection module lets you define custom atomselection macros
  • More rigorous reference counting / fewer memory leaks
  • Much prettier code

CI status Downloads Conda PyPi

Features

All features of VMD from the 1.9.4 tree, plus some optional plugins not included in binary distributions:

  • Read and write formal charges to MAE files
  • DMS plugin for DESRES molecular file format
  • HOOMD plugin
  • It doesn't crash when you import it
  • Doesn't care which numpy you compile against
  • Support for Python 2 or Python 3

Included modules

The following sub-modules are part of VMD. The import system makes more sense now, so standard importing like from vmd import atomsel will work correctly.

Some of these modules don't make much sense without the graphical display window. I don't currently distribute a VMD binary with Python built in, but you can look at my build scripts and compile your own, or use the available ones from the official developers.

The following python modules are part of vmd-python. Some of these are currently not documented on the website (indicated with *).

  • animate
  • axes
  • atomsel (atom selection language)
  • color
  • display
  • evaltcl (run all your old tcl scripts)
  • graphics
  • imd
  • label
  • material
  • measure*
  • molecule (read and write all kinds of molecules)
  • molrep
  • mouse* (of limited utility in the command line...)
  • render
  • trans
  • topology*
  • vmdmenu*
  • vmdnumpy (very very useful!)

There are also some object oriented classes that provide a higher-level interface to the sub-modules above. Note these are case sensitive!!

  • Label
  • Material
  • Molecule

Usage

Here's a very simple example of using the VMD-python API to calculate the root-mean-square- fluctuation of all tyrosine residues in a loaded trajectory molid relative to some average structure molid_avg:

from vmd import molecule, vmdnumpy
import numpy as np
mask = vmdnumpy.atomselect(molid_avg, 0, "resname TYR")
ref = np.compress(mask, vmdnumpy.timestep(molid_avg, 0), axis=0)

rmsf = np.zeros(len(ref))
for frame in range(molecule.numframes(molid)):
    frame = np.compress(mask, vmdnumpy.timestep(molid, f), axis=0)
    rmsf += np.sqrt(np.sum((frame-ref)**2, axis=1))
rmsf /= float(molecule.numframes(molid)-minframe)
rmsf = np.sqrt(rmsf)

Please refer to the documentation for description of all functions. Also note that the built in help() command in Python may sometimes give you more up-to-date information than the website.

Warnings

Don't confuse the Molecule and the molecule modules. Molecule is part of the high-level Python interface, and can be pickled and have different representations. It's a class. However molecule is a module that allows loading and saving of molecules while tracking them by an integer index.

Installation

The easiest way to install the module is by using the Conda Python package manager. Vmd-python is in the conda forge channel:

Simple binary installation with conda:

conda install -c conda-forge vmd-python

For other architectures, you can build from source by cloning this repo:

python setup.py build
python setup.py install

Installation can take a while since it compiles VMD from source.

Installing with EGL support (experimental)

NOTE: The build process for this is currently broken.

VMD-Python can render to an offscreen buffer if you build it yourself with the --egl flag. You'll need the following files on your system to build and link successfully:

* GL/gl.h
* EGL/egl.h, EGL/eglext.h
* libOpenGL.so

In Debian, these are provided in libegl1-mesa-dev, mesa-common-dev, and libopengl0 packages. To build:

python setup.py --egl build
python setup.py install

Please file issues if you have problems with this!!

Dependencies

vmd-python has the following dependencies:

* python>2.7 or>3.6
* numpy
* libnetcdf >= 4.3
* expat
* sqlite
* Tcl/Tk
* importlib_resources

To build on Debian, that's the following packages:

* libsqlite3-dev
* libexpat1-dev
* libnetcdf-dev
* tcl8.5-dev
* libegl1-dev
* libopengl0

Licensing

This software is classified as a "derivative work" of the original Visual Molecular Dynamics software. It uses the main VMD source code and Python compilation options as well as code I have written for simple compilation and installation, as well as several patches I have applied.

As such, this is a MODIFIED VERSION of VMD and is not the original software distributed by Illinois.

"This software includes code developed by the Theoretical and Computational Biophysics Group at the Beckman Institute for Advanced Science and Technology at the University of Illinois at Urbana-Champaign."

Official VMD web page: http://www.ks.uiuc.edu/Research/vmd

vmd-python's People

Contributors

al42and avatar eigenstate avatar ismaelresp avatar jvermaas avatar rasmusfonseca avatar rbetz avatar tonigi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vmd-python's Issues

Can't use topotools::mergetools when evaluating a tcl script.

A tcl script which runs find using vmd version "VMD for LINUXAMD64, version 1.9.3 (November 30, 2016)"

like this
$ vmd < scripts/merge_protein_and_solvent_box.tcl

Or starting the tkconsole and sourcing the script, also works fine.

Fails when using it like this

from vmd import evaltcl
ions = evaltcl("source scripts/merge_protein_and_solvent_box.tcl

problem.zip

Memory bleed (not dumping) issue

When running vmd.eval("source xxxx.tcl") file, it errors if you have exit at the 'exit' of the xxxx.tcl, like you should. However, if exit is not there, it just holds all the loaded dcd files (loaded from xxx.tcl) in memory. Hence if you are doing for loops on files, you run out of memory.

index / serial

Hi,

I think there's a typo in the document about the index and serial properties of the atoms:
https://vmd.robinbetz.com/atomsel.html

In the standalone VMD, index is 0-based and serial is 1-based. As I tested it, the behavior of the vmd-python code also follows this convention. However, the document above had them swapped. Please kindly clarify. Thanks!

FZ

Build issues

Hi,
I am trying to build vmd-python, i am getting following error.
Can someone help me resolving this.

Moreover is vmd-python not available as a conda package anymore?

image

anaconda: package missing

Hi,

I've been trying to install your package via conda but got below error. Any idea why? thanks.

$ conda install -c https://conda.anaconda.org/rbetz vmd-python
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ............
Solving package specifications: .
Error:  Package missing in current linux-64 channels:
  - vmd-python

Did you mean one of these?

    dynd-python, python, dnspython

You can search for this package on anaconda.org with

    anaconda search -t conda vmd-python
$ arch
x86_64

some problems in python

Hi,Robin!I tried to code by python like you! When I typed "from vmd import molecule,molrep",it warnning with red color line under "molecule,molrep",were i install wrong vmd package,but i,m not fortunately find the true!I had installed module vmd-python,it,s useless.Copying your code is also useless,so sad !Hoping your reply!Thank you sincerely!And please send me right,full vmd package!

Squelching vmd output to stdout

When calling molecule.load and molecule.read VMD prints info to stdout:

netcdfplugin) conventions: 'AMBER'
netcdfplugin) trajectory follows AMBER conventions version '1.0'
netcdfplugin) AMBER: program 'cpptraj'
netcdfplugin) AMBER: program version 'V15.0'
netcdfplugin) AMBER: title 'Cpptraj Generated trajectory'
netcdfplugin) AMBER: application 'AMBER'
netcdfplugin) AMBER: spatial dimension: 3
netcdfplugin) AMBER: atom dimension: 54849
netcdfplugin) AMBER: frame dimension: 421
netcdfplugin) AMBER: coordinates units: 'angstrom'
netcdfplugin) AMBER: no coordinates scalefactor attribute, 1.0 assumed
netcdfplugin) AMBER: coordinates scalefactor: 1.000000
netcdfplugin) AMBER trajectory contains periodic cell information
netcdfplugin) AMBER: cell lengths units: 'angstrom'
netcdfplugin) AMBER: no cell lengths scalefactor attribute, 1.0 assumed
netcdfplugin) AMBER: cell lengths scalefactor: 1.000000
netcdfplugin) AMBER: cell angles units: 'degree'
netcdfplugin) AMBER: no cell angles scalefactor attribute, 1.0 assumed
netcdfplugin) AMBER: cell angles scalefactor: 1.000000

Is there a way to squelch this output?

ImportError: no module named 'control'

Hi! Awesome work in making vmd python3 compatiable and conda installable!

Although, I am having trouble importing the module. Traceback below:

Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vmd
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/limn1/anaconda3/lib/python3.5/site-packages/GromacsWrapper-0.6.1-py3.5.egg/vmd/__init__.py", line 41, in <module>
ImportError: No module named 'control'

Suggestions?

problem compiling on MacOS high Sierra 10.13.3 (python 3.6)

$ python3 setup.py build
running build
running build_py
Compiling VMD
Finding libraries...
  Searching /usr/lib /usr/local/lib
   LIB: libtcl8.5.dylib -> /usr/lib
   INC: tcl.h -> /usr/local/include
  Searching /usr/lib /usr/local/lib
   LIB: libsqlite3.dylib -> /usr/lib
   INC: sqlite3.h -> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include
  Searching /usr/lib /usr/local/lib
   LIB: libexpat.dylib -> /usr/lib
   INC: expat.h -> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include
  Searching /usr/lib /usr/local/lib
   LIB: libnetcdf.dylib -> /usr/local/lib
   INC: netcdf.h -> /usr/local/include
  Searching /usr/lib /usr/local/lib
WARNING: Could not find library file 'libpython3.6*.dylib' in standard library directories.
 Defaulting to: '/usr/local/opt/python3/3.6/lib/libpython3.6*.dylib'
   LIB: libpython3.6*.dylib -> /usr/local/opt/python3/3.6/lib
Traceback (most recent call last):
  File "setup.py", line 293, in <module>
    'test': VMDTest,
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 32, in run
    self.execute(self.compile, [], msg="Compiling VMD")
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 335, in execute
    util.execute(func, args, msg, dry_run=self.dry_run)
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/util.py", line 301, in execute
    func(*args)
  File "setup.py", line 43, in compile
    self.set_environment_variables(pydir)
  File "setup.py", line 225, in set_environment_variables
    pythonldflag = "-l%s" % os.path.split(libs[-1])[-1][3:] # Remove "lib"
IndexError: list index out of range

compiles on python 2.7. However, when import vmd in python2.7 leads to Segmentation fault: 11

DCD files

CAn i use this to generate dcd file from a pdb file? if so can you please provide the code or if not guide me on how to do so?

Use PSFgen version 2.0

Hello,
PSFGEN 2.0 from the last VMD 1.9.4 alpha (october 2021) include some new functions (like HMASSREPART). Is there any way to use it with my current install of VMD-python (3.0.6) ?

ImportError: libtcl8.5.so: cannot open shared object file: No such file or directory

Hi!
After downloading and successfully installing the latest GitHub version to my Linux machine, I get the following error while importing the new module:

ImportError                               Traceback (most recent call last)
<ipython-input-1-1ec58bc80a6c> in <module>()
----> 1 import vmd

/home/vladas/software/anaconda/lib/python2.7/site-packages/vmd/__init__.py in <module>()
     21 
     22 # Load the library
---> 23 vmd = imp.load_dynamic(__name__, resource_filename(__name__, "libvmd.so"))
     24 
     25 # These modules define classes for convenient manipulation of VMD state.

ImportError: libtcl8.5.so: cannot open shared object file: No such file or directory

Documentation updates?

Hi Robin,

I hope you'll bear with a couple of silly questions, and if it helps then I can take some time to update your README, to help clarify a couple of things.

I'm a software person and terribly new to the world of scientific computing, so I'm still really getting oriented. I've been asked to write a VMD plugin for configuring and submitting jobs, hopefully in Python. Would you be willing to spend a few moments helping me to understand how I can do that? It would be my pleasure to write up some tutorial notes and submit a pull request.

thanks for your time
Tyler

libtcl8.5.so ImportError

Hi!

I've installed vmd-python using conda install (python 3.6) procedure.
It seemed to install fine with no errors, but when I try to import the module in IPython using

import vmd

I get the following error:
ImportError: libtcl8.5.so: cannot open shared object file: No such file or directory

I searched for libtcl8.5.so in my conda installation lib folder. It seems I had libtcl8.6.so, not libtcl8.5.so, so I simply made a copy of libtcl8.6.so and renamed it to libtcl.8.5.so. Then I was able to import with no problems, but I guess this is not an expected behaviour. Why do you think libtcl8.6.so is not detected?

Building a water box fails randomly.

I installed vmd-python python via conda. I am using it to evaluate a tcl file (contents below) which creates a water box. The below error was returned. ValueError: Unable to load file 'combine.psf' using file type 'psf'.

package require solvate

set molname water_box
solvate -minmax {{0 0 0} {200 200 200}} -o /home/greg/Desktop/Wolf_GOMC/workflow/../output/200/MINIMIZATION/$molname 

I reran it and it completed successfully.

I'm not sure if this is a vmd or a vmd-python problem.

__init__.py not found

Hi Robin, I used python3 setup.py build to build and got that the init script not found. Regarding the compiling, I think all the linked .so file created but I don't know the last few lines matters?
Here it is:
VMD installation complete. Enjoy!
/bin/sh: line 0: cd: ../doc: No such file or directory
running build_py
package init file 'vmd/init.py' not found (or not a regular file)

add label and specific color for some resid

Hi,
I'd like to emphasize one residue caused by mutation, like the red frame on the right side of this picture.
image
assuming we have a mutation on resid 11. I add the label by this code: "label.add('Atoms',[0],[11])". It showed like the following picture, I am confused why the label is "LEU9:C" because the specific number of resid is 11. On the other hand, Can I add self-defined text label?
image

The other question is about the color, how can I change the color of specific resid? and this change can be rendered out as file "*dat".

Could you help me about these questions about label and color? Thank you.

Integration with VMD

Dear Developers,
How does the display function/module work? Do we have any kind of Display out from this module? The Actual VMD app is not integrated with this module. While installing via conda I didn't find it to install any other VMD app. Please suggest something...
Thanks,
Pallab

Wrong path to netcdf build flags

On Ubuntu 16.04 (netcdf 4.4) pip (version 9.0.1) gives the following error:

error: [Errno 2] No such file or directory: '/usr/lib/libnetcdf.settings'

The Debian package for libnetcdf-dev has the file only in the build-specific library path.

The conda installer seems to work OK.

Segmentation fault on OSX anaconda python

Just did a clean install of anaconda and I'm now getting segfaults when importing:

MBPro:~/Programs $ conda activate py27
(py27) MBPro:~/Programs $ python
Python 2.7.14 |Anaconda, Inc.| (default, Dec  7 2017, 11:07:58)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import vmd
Segmentation fault: 11
(py27) MBPro:~/Programs $ conda activate base
(base) MBPro:~/Programs $ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import vmd
Segmentation fault: 11

Suppress `dcdplugin.c` output

When I load trajectories theres a lot of noisy messages:

dcdplugin) detected standard 32-bit DCD file of native endianness
dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)
dcdplugin) detected standard 32-bit DCD file of native endianness
dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)
dcdplugin) detected standard 32-bit DCD file of native endianness
dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)
dcdplugin) detected standard 32-bit DCD file of native endianness
dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)
dcdplugin) detected standard 32-bit DCD file of native endianness
dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)
....

which get kind of excessive after a certain point. I can modify dcdplugin.c to comment out the relevant printf statements which would solve it locally. Would you accept a PR with this modification or is there a better way for me to fix this for more users?

number of frames is 0

Hi Robin,

I start Vmd and type gopython and then load a file by:
molid = molecule.load('parm7', '1BIQ_solvate.top', 'crdbox', 'prod_imaged.mdcrd')
tf = molecule.numframes(molid)
print(tf)
This will give the number of total frames of 300, it works.

However, when I put the same code in a python file like:
from vmd import *
mid = molecule.load('parm7', '1BIQ_solvate.top', 'crdbox', 'prod_imaged.mdcrd')
tf = molecule.numframes(mid)
print('Loaded mid is: ', mid)
print('Total number frames is', tf)

The total number of frames is 0.

Do you have any idea of what is wrong here?
Thanks.

Cannot install vmd-python

Hi, I'm still a newbie to programming.

I tried to install vmd-python, but it complains about not being able to find correct version (I suppose python version?). I am using Python 3.7.9. Is this not supported?

The error message:

pip install vmd-python
Note: you may need to restart the kernel to use updated packages.
ERROR: Could not find a version that satisfies the requirement vmd-python (from versions: none)
ERROR: No matching distribution found for vmd-python

Support for Python 3.10+

Hiya,

Thanks for maintaining this!

I'm unable to install on Python 3.10

conda create -n vmd python=3.10
conda activate vmd
conda install -c conda-forge vmd-python
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - vmd-python -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.5,<3.6.0a0']

Your python: python=3.10

Any chance we can get support for newer python versions?

Installation error in vmd-python

I have used the following command:
conda install -c conda-forge vmd-python

However, it shows the following error:
(base) saikat@saikat-ROG-Strix:~$ conda install -c conda-forge vmd-python
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): -

Could please guide me to install the vmd python.
I have tried the other method also. It did not works for me.

setup.py build error on macOS 10.13+

Hi, compilation does not work on macOS 10.13+ with error
PythonTextInterp.C:30:10: fatal error: 'Python/errcode.h' file not found #include "Python/errcode.h"

Quick fix was to comment out a few lines around l.30 invmd-python/vmd/vmd_src/src/PythonTextInterp.C:

//#if defined(__APPLE__)
// use the Apple-provided Python framework
//#include "Python/errcode.h"
//#else
#include "errcode.h"
//#endif

netcdf error when running python setup.py build

[akm64@farnam2 vmd-python]$ python setup.py build
running build
running build_py
Compiling VMD
Finding libraries...
LIB: libtcl8.5.so -> /usr/lib64
INC: tcl.h -> /usr/include
LIB: libsqlite3.so -> /usr/lib64
INC: sqlite3.h -> /usr/include
LIB: libexpat.so -> /usr/lib64
INC: expat.h -> /usr/include
WARNING: Could not find library file 'libnetcdf.so' in standard library directories.
Defaulting to: '/usr/lib/libnetcdf.so'
LIB: libnetcdf.so -> /usr/lib

WARNING: Could not find include file 'netcdf.h' in standard include directories.
Defaulting to: '/usr/include/netcdf.h'
INC: netcdf.h -> /usr/include/netcdf.h
LIB: libpython2.7*.so -> /usr/lib64
Setting environment variables
Deleting previous plugin directory /ysm-gpfs/home/akm64/lib/vmd-python/build/lib/vmd/plugins
Compiling plugins to /ysm-gpfs/home/akm64/lib/vmd-python/build/lib/vmd/plugins
Building Molecule File Reader plugins
src/netcdfplugin.c:22:20: fatal error: netcdf.h: No such file or directory
#include <netcdf.h>
^
compilation terminated.
make[2]: *** [../compile/lib_LINUXAMD64/molfile/netcdfplugin.o] Error 1
make[1]: *** [molfilelibs] Error 1
make: *** [LINUXAMD64] Error 2
Traceback (most recent call last):
File "setup.py", line 293, in
'test': VMDTest,
File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 32, in run
self.execute(self.compile, [], msg="Compiling VMD")
File "/usr/lib64/python2.7/distutils/cmd.py", line 349, in execute
util.execute(func, args, msg, dry_run=self.dry_run)
File "/usr/lib64/python2.7/distutils/util.py", line 324, in execute
func(*args)
File "setup.py", line 52, in compile
check_call(cmd, cwd=srcdir)
File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/ysm-gpfs/home/akm64/lib/vmd-python/vmd/install.sh', 'LINUXAMD64', '/ysm-gpfs/home/akm64/lib/vmd-python/build/lib/vmd', '/usr/']' returned non-zero exit status 2

TCL related error when installing using pip3.6

DN525uqm:~/Programs $ pip3.6 install -i https://pypi.anaconda.org/rbetz/simple vmd-python
Collecting vmd-python
  Downloading https://pypi.anaconda.org/rbetz/simple/vmd-python/2.0.4/vmd-python-2.0.4.tar.gz (27.8MB)
    100% |████████████████████████████████| 27.8MB 71kB/s
Building wheels for collected packages: vmd-python
  Running setup.py bdist_wheel for vmd-python ... error
  Complete output from command /usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/tmp9f0_asgbpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  Compiling VMD
  Finding libraries...
  WARNING: Could not find library file 'libtcl8.5.dylib' in standard library directories.
   Defaulting to: '/usr/local/opt/python3/3.6/lib/libtcl8.5.dylib'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/setup.py", line 273, in <module>
      'test': VMDTest,
    File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 179, in run
      self.run_command('build')
    File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/setup.py", line 31, in run
      self.execute(self.compile, [], msg="Compiling VMD")
    File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 335, in execute
      util.execute(func, args, msg, dry_run=self.dry_run)
    File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/util.py", line 301, in execute
      func(*args)
    File "/private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/setup.py", line 44, in compile
      self.set_environment_variables(pydir)
    File "/private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/setup.py", line 163, in set_environment_variables
      os.environ["TCL_LIBRARY_DIR"] = self._find_library_dir("libtcl8.5", pydir)
    File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/os.py", line 674, in __setitem__
      value = self.encodevalue(value)
    File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/os.py", line 742, in encode
      raise TypeError("str expected, not %s" % type(value).__name__)
  TypeError: str expected, not NoneType

  ----------------------------------------
  Failed building wheel for vmd-python
  Running setup.py clean for vmd-python
Failed to build vmd-python
Installing collected packages: vmd-python
  Running setup.py install for vmd-python ... error
    Complete output from command /usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-c2w5byfo-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    Compiling VMD
    Finding libraries...
    WARNING: Could not find library file 'libtcl8.5.dylib' in standard library directories.
     Defaulting to: '/usr/local/opt/python3/3.6/lib/libtcl8.5.dylib'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/setup.py", line 273, in <module>
        'test': VMDTest,
      File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/setup.py", line 31, in run
        self.execute(self.compile, [], msg="Compiling VMD")
      File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 335, in execute
        util.execute(func, args, msg, dry_run=self.dry_run)
      File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/util.py", line 301, in execute
        func(*args)
      File "/private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/setup.py", line 44, in compile
        self.set_environment_variables(pydir)
      File "/private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/setup.py", line 163, in set_environment_variables
        os.environ["TCL_LIBRARY_DIR"] = self._find_library_dir("libtcl8.5", pydir)
      File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/os.py", line 674, in __setitem__
        value = self.encodevalue(value)
      File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/os.py", line 742, in encode
        raise TypeError("str expected, not %s" % type(value).__name__)
    TypeError: str expected, not NoneType

    ----------------------------------------
Command "/usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-c2w5byfo-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/pm/vtj2fdz94xxfw2sr59lsyrw40000gn/T/pip-build-fboeyl5o/vmd-python/

Building with EGL support

Hi! Many thanks for providing this tool. I was trying to build the package with EGL support following the provided instructions under Ubuntu 22.04. I managed to install all listed dependencies but the setup.py script complained that it could not find libnetcdf.so in any standard library location.

This is solved by installing the libnetcdf-dev package under Debian/Ubuntu. Compilation seems to work fine for a while, but then returns non-exit zero status 2 which is not very descriptive.

make: *** [Makefile:546: py_atomsel.o] Error 1
Traceback (most recent call last):
  File "setup.py", line 448, in <module>
    setup(name='vmd-python',
  File "/home/jjimenezluna/miniconda3/envs/drugstruct/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/home/jjimenezluna/miniconda3/envs/drugstruct/lib/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/jjimenezluna/miniconda3/envs/drugstruct/lib/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/jjimenezluna/miniconda3/envs/drugstruct/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "setup.py", line 71, in run
    self.compile_vmd()
  File "setup.py", line 94, in compile_vmd
    check_call(cmd, cwd=srcdir)
  File "/home/jjimenezluna/miniconda3/envs/drugstruct/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/jjimenezluna/vmd-python/vmd/install.sh', 'LINUXAMD64', '/home/jjimenezluna/vmd-python/build/lib/vmd', '/home/jjimenezluna/miniconda3/envs/drugstruct']' returned non-zero exit status 2.

Do you folks know if I'm missing any other dependency? Any clue is appreciated.

library issue on MacOS

I seem to be having a library issue when installing this via pip on MacOS. Any thoughts here? Are others having issues of this sort?

It might be nice to add MacOS to the travis config to see if it installs properly on a clean build.

➜  ml-ecoli-svmrank git:(master) ✗ pip install -i https://pypi.anaconda.org/rbetz/simple vmd-python

Collecting vmd-python
  Downloading https://pypi.anaconda.org/rbetz/simple/vmd-python/2.0.1/vmd-python-2.0.1.tar.gz (27.8MB)
    100% |████████████████████████████████| 27.8MB 16kB/s
Building wheels for collected packages: vmd-python
  Running setup.py bdist_wheel for vmd-python ... error
  Complete output from command /Users/saladi/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/ds/85_stvb54l77t3ddk3vtb2d40000gn/T/pip-build-2liosvpe/vmd-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/ds/85_stvb54l77t3ddk3vtb2d40000gn/T/tmpqh9zpv55pip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  Compiling VMD
  Finding libraries...
  /bin/sh: ldconfig: command not found
  WARNING: Could not find library file 'libtcl8.5.so' in standard library directories.
   Defaulting to: '/Users/saladi/anaconda3/lib/libtcl8.5.so'
     LIB: libtcl8.5.so -> /Users/saladi/anaconda3/lib/libtcl8.5.so

  WARNING: Could not find include file 'tcl.h' in standard include directories.
   Defaulting to: '/Users/saladi/anaconda3/include/tcl.h'
     INC: tcl.h -> /Users/saladi/anaconda3/include/tcl.h
  /bin/sh: ldconfig: command not found
  WARNING: Could not find library file 'libsqlite3.so' in standard library directories.
   Defaulting to: '/Users/saladi/anaconda3/lib/libsqlite3.so'
     LIB: libsqlite3.so -> /Users/saladi/anaconda3/lib/libsqlite3.so

  WARNING: Could not find include file 'sqlite3.h' in standard include directories.
   Defaulting to: '/Users/saladi/anaconda3/include/sqlite3.h'
     INC: sqlite3.h -> /Users/saladi/anaconda3/include/sqlite3.h
  /bin/sh: ldconfig: command not found
  WARNING: Could not find library file 'libexpat.so' in standard library directories.
   Defaulting to: '/Users/saladi/anaconda3/lib/libexpat.so'
     LIB: libexpat.so -> /Users/saladi/anaconda3/lib/libexpat.so

  WARNING: Could not find include file 'expat.h' in standard include directories.
   Defaulting to: '/Users/saladi/anaconda3/include/expat.h'
     INC: expat.h -> /Users/saladi/anaconda3/include/expat.h
  /bin/sh: ldconfig: command not found
  WARNING: Could not find library file 'libnetcdf.settings' in standard library directories.
   Defaulting to: '/Users/saladi/anaconda3/lib/libnetcdf.settings'
     LIB: libnetcdf.settings -> /Users/saladi/anaconda3/lib/libnetcdf.settings

  WARNING: Could not find include file 'netcdf.h' in standard include directories.
   Defaulting to: '/Users/saladi/anaconda3/include/netcdf.h'
     INC: netcdf.h -> /Users/saladi/anaconda3/include/netcdf.h
  error: [Errno 20] Not a directory: '/Users/saladi/anaconda3/lib/libnetcdf.settings/libnetcdf.settings'

  ----------------------------------------
  Failed building wheel for vmd-python
  Running setup.py clean for vmd-python
Failed to build vmd-python
Installing collected packages: vmd-python
  Running setup.py install for vmd-python ... error
    Complete output from command /Users/saladi/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/ds/85_stvb54l77t3ddk3vtb2d40000gn/T/pip-build-2liosvpe/vmd-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/ds/85_stvb54l77t3ddk3vtb2d40000gn/T/pip-0mi4mtxa-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    Compiling VMD
    Finding libraries...
    /bin/sh: ldconfig: command not found
    WARNING: Could not find library file 'libtcl8.5.so' in standard library directories.
     Defaulting to: '/Users/saladi/anaconda3/lib/libtcl8.5.so'
       LIB: libtcl8.5.so -> /Users/saladi/anaconda3/lib/libtcl8.5.so

    WARNING: Could not find include file 'tcl.h' in standard include directories.
     Defaulting to: '/Users/saladi/anaconda3/include/tcl.h'
       INC: tcl.h -> /Users/saladi/anaconda3/include/tcl.h
    /bin/sh: ldconfig: command not found
    WARNING: Could not find library file 'libsqlite3.so' in standard library directories.
     Defaulting to: '/Users/saladi/anaconda3/lib/libsqlite3.so'
       LIB: libsqlite3.so -> /Users/saladi/anaconda3/lib/libsqlite3.so

    WARNING: Could not find include file 'sqlite3.h' in standard include directories.
     Defaulting to: '/Users/saladi/anaconda3/include/sqlite3.h'
       INC: sqlite3.h -> /Users/saladi/anaconda3/include/sqlite3.h
    /bin/sh: ldconfig: command not found
    WARNING: Could not find library file 'libexpat.so' in standard library directories.
     Defaulting to: '/Users/saladi/anaconda3/lib/libexpat.so'
       LIB: libexpat.so -> /Users/saladi/anaconda3/lib/libexpat.so

    WARNING: Could not find include file 'expat.h' in standard include directories.
     Defaulting to: '/Users/saladi/anaconda3/include/expat.h'
       INC: expat.h -> /Users/saladi/anaconda3/include/expat.h
    /bin/sh: ldconfig: command not found
    WARNING: Could not find library file 'libnetcdf.settings' in standard library directories.
     Defaulting to: '/Users/saladi/anaconda3/lib/libnetcdf.settings'
       LIB: libnetcdf.settings -> /Users/saladi/anaconda3/lib/libnetcdf.settings

    WARNING: Could not find include file 'netcdf.h' in standard include directories.
     Defaulting to: '/Users/saladi/anaconda3/include/netcdf.h'
       INC: netcdf.h -> /Users/saladi/anaconda3/include/netcdf.h
    error: [Errno 20] Not a directory: '/Users/saladi/anaconda3/lib/libnetcdf.settings/libnetcdf.settings'

    ----------------------------------------
Command "/Users/saladi/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/ds/85_stvb54l77t3ddk3vtb2d40000gn/T/pip-build-2liosvpe/vmd-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/ds/85_stvb54l77t3ddk3vtb2d40000gn/T/pip-0mi4mtxa-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/ds/85_stvb54l77t3ddk3vtb2d40000gn/T/pip-build-2liosvpe/vmd-python/

Accessing volumetric data as numpy arrays

Dear developers!
I got interested in using this module to employ VMD's volmap functionality to calculate density grids and do comparisons while in python environment. While I am successful in making the calculations (after loading vmd and a trajectory) via evaltcl:
vmd.evaltcl('volmap density [atomselect 0 "name CA"] -res 1.0 -allframes -mol 0')
However, I am only able to save the files as ".dx" via tcleval and no direct access to the grid data that could be further manipulated.
Some manipulation is available through volutil package but it also just reads/writes ".dx" files and does not keep them as referable objects. It also is just passable through tcleval. (so hardly any upgrade from using a .tcl scripts).

Would it be possible to interface the volumetric data as 3D numpy arrays via vmd.vmdnumpy* ? That would be fantastic!

Many thanks for your comments.

render produce wrong output file when running through script

I wrote a code: visual.py, just two step:load and render. I can correctly run when I firstly get into python environment, and run step by step. While I run through script (python visual.py), the output file 1fqy.dat can not produce correctly. I don't know why output get wrong as I run the same code as before.

the content of script visual.py:
from vmd import Molecule
from Molecule import *
from vmd import render
molecule.load('pdb','1fqy.pdb')
render.render(method="Tachyon",filename="1fqy.dat")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.