eigenstate / vmd-python Goto Github PK
View Code? Open in Web Editor NEWInstallable VMD as a python module
License: Other
Installable VMD as a python module
License: Other
Before I dig too deep into this, I just wanted to know whether vmd-python was ever intended to run on Power systems...? If so, I will append the particular problem I'm seeing.
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?
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
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/
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!
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
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.
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.
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)
I want to use VMD to visualize my own python package. Does this package can visualize my data or just use VMD python-api to compute some data?
We're seeing changes in behavior related to one or more of these get-commands. Any idea what changed?
$ 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
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
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/
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.
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.
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?
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) ?
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
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?
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
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
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
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.
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
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?
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.
[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
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
Hi,
I'd like to emphasize one residue caused by mutation, like the red frame on the right side of this picture.
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?
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.
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.
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")
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?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.