Git Product home page Git Product logo

chemview's People

Contributors

gabrielelanaro avatar gitter-badger avatar jameskermode 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chemview's Issues

few questions about chemview

Hi Gabriele,

I initially fork mdtraj.html module to separated package, name mdview.
However @rmcgibbo pointed out that I should look at your chemview package.

I've tried chemview with pytraj and this seems quite easy to plug to chemview

screenshot

So I just have few question?

  • What's about potential of renaming chemview to something more general, like for biology structure (protein, membrane, ...)
  • re-lisence chemview to something less restricted, like BSD or MIT?
  • considering implement (or including) pv's javascript code? https://biasmv.github.io/pv/demo.html

Let me know what you think. thanks.

Optional requirement for numba/jit

I use chemview on several machines within several virtual environments. Consequently, I have to install chemview and its dependencies frequently. Being a non-Anaconda user, I've found it is a pain to get chemview installed each time for several reasons:

  1. The setup.py does not attempt to install the dependencies or warn about missing dependencies. Rather, you find out that dependencies are missing upon runtime.
  2. Numba, which depends on llvmlite, which depends on llvm 3.5 being installed in the correct location (which is not the case for Ubuntu), and lib-edit-dev (not installed by default).
  3. A given version of Numba will only work with a small specific set of llvmlite versions.

I suggest making the usage of Numba optional, i.e. something like this:

try:
    import numba as nb
except ImportError:
    print("WARNING: Not using Numba JIT compiler, marching cubes algorithm significantly slower", file=sys.stderr)

This may reduce the activation barrier for new users who are not using Anaconda and want to try chemview.

Can't install the widget to jupyter manually.

When I try to install the chemview widget as per the installation instructions, I get the following error:

KeyError: 'The Python module chemview is not a valid nbextension, it is missing the _jupyter_nbextension_paths() method.'

Python camera manipulation

A way to syncronize "cameras" across different widgets from an user perspective my idea would be:

from IPython.display import display
from IPython.utils.traitlets import link

mv1 = MolecularViewer() # returns an IPython widget
mv2 = MolecularViewer()

link(mv1.camera, mv2.camera) # Now the cameras are linked
display(v1)
display(v2)

add_representation for points, not rotated right ?

Hi,

I try the points and spheres:
spheres rotation has not problem,
but points seems does not work right (also the mouse zoom) !

here is my test code, I put a box with lines for reference.
you may need ASE to run it.

from ase import Atoms

import numpy as np
import chemview
import time

from chemview.utils import get_atom_color
from chemview import RepresentationViewer
from IPython.display import display
chemview.enable_notebook()

def viewer(atom):

    cell = atom.cell.astype('float32')

    ps = atom.positions.astype('float32')


    original=np.zeros(3,dtype=float)

    lines=[[original,cell[0]],
           [cell[1],cell[1]+cell[0]],
           [cell[2],cell[2]+cell[0]],
           [cell[1]+cell[2],cell[0]+cell[1]+cell[2]],
           [original,cell[1]],
           [cell[0],cell[0]+cell[1]],
           [cell[2],cell[2]+cell[1]],
           [cell[0]+cell[2],cell[0]+cell[1]+cell[2]],
           [original,cell[2]],
           [cell[0],cell[0]+cell[2]],
           [cell[1],cell[1]+cell[2]],
           [cell[0]+cell[1],cell[0]+cell[1]+cell[2]] ]

    rv=RepresentationViewer(600, 600)

    color= np.array([0xFF0000, 0x00FF00, 0x0000FF])[[0, 1, 2]].tolist()

    for line in lines:
        rv.add_representation('lines', {'startCoords': line[0],
                                               'endCoords': line[1],
                                               'startColors': color,
                                               'endColors': color},
                         )
    colors = [get_atom_color(t.upper()) for t in atom.get_chemical_symbols()]

    rv.add_representation('spheres', {'coordinates': ps, 
                                                   'colors': colors , 
                                                   'radii': [0.1]*len(ps), 
                                                   'resolution': 32})

#     rv.add_representation('points', {'coordinates': ps, 
#                                                'colors': colors , 
#                                                'sizes': [50]*len(ps),
#                                                'opacity': 1.0})
    rv.autozoom(ps)
    return rv
atom = Atoms(['Fe','Ni','Ni','Ni'],[(0,0,0),
                   (0.5,0,0.5),
                   (0,0.5,0.5),
                   (0.5,0.5,0)],pbc=[True,True,True])
viewer(atom*4)

Please un-comment the part for points and try to repeat my problem.

This could be use as a extension for crystal?

BTW:
does chemview works with the new jupyter notebook, I also try your branch new-widget, but not work for me ?

Best Regards!

no molecule rendered

I'm sorry to open a ticket for an aspect that no one else seems to have had trouble with, but I can't get anything to render with chemview. I've installed decent versions of all the dependencies through pip or conda (below shows mostly pip, but I've another try that's mostly conda to same result). chemview itself is installed from a git clone through pip install . to get a recent version that's Jupyter-compatible. Running the basic tutorial gives only warnings (no errors) but also no rendered molecule. Any suggestions as to what I'm doing wrong?

screen shot 2016-05-03 at 10 19 35 pm

>>> conda list
chemview                  0.6                       <pip>
ipykernel                 4.3.1                    py27_0    defaults
ipython                   4.1.2                    py27_2    defaults
ipython-genutils          0.1.0                     <pip>
ipython-notebook          4.0.4                    py27_0    defaults
ipython-qtconsole         3.1.0                    py27_0    defaults
ipython_genutils          0.1.0                    py27_0    defaults
ipywidgets                4.1.1                    py27_0    defaults
jupyter                   1.0.0                     <pip>
jupyter-client            4.2.2                     <pip>
jupyter-console           4.1.1                     <pip>
jupyter-core              4.1.0                     <pip>
jupyter_client            4.2.2                    py27_0    defaults
jupyter_core              4.1.0                    py27_0    defaults
matplotlib                1.4.3                np19py27_2    defaults
nglview                   0.4                       <pip>
notebook                  4.2.0                    py27_0    defaults
numba                     0.14.0               np19py27_0    http://repo.continuum.io/pkgs/free/osx-64/numba-
numpy                     1.9.2                    py27_0    defaults
openbabel                 2.3.2                    py27_0    https://conda.binstar.org/psi4/osx-64/openbabel-2.3.2-
python                    2.7.11                        0    defaults
traitlets                 4.2.1                    py27_0    defaults
vapory                    0.1.1                     <pip>

Using chemview from Julia

I work mostly from Julia and I'd love to use chemview for visualising within an IJulia notebook. I appreciate that you may not be interested in fixing anything related to this, but I am hoping you can give me some pointers.

I use Julia 0.5 and Anaconda. To import python packages I use PyCall. When I first tried, even numba import failed, but eventually I built llvmlite from source, pointing to the LLVM 3.7.1 library that comes included with Julia. I can now successfully @pyimport numba.

But when I try @pyimport chemview I get the following error message (in the Julia REPL; from the notebook I don't get anything useful at all): (sorry for the very long output)

signal (11): Segmentation fault: 11
while loading no file, in expression starting on line 426
_ZN4llvm17PMTopLevelManager16findAnalysisPassEPKv at /Users/ortner/anaconda/lib/python2.7/site-packages/llvmlite/binding/libllvmlite.dylib (unknown line)
_ZN4llvm17PMTopLevelManager12schedulePassEPNS_4PassE at /Users/ortner/anaconda/lib/python2.7/site-packages/llvmlite/binding/libllvmlite.dylib (unknown line)
_ZN4llvm18PassManagerBuilder25populateModulePassManagerERNS_6legacy15PassManagerBaseE at /Users/ortner/anaconda/lib/python2.7/site-packages/llvmlite/binding/libllvmlite.dylib (unknown line)
ffi_call_unix64 at /Users/ortner/anaconda/lib/python2.7/lib-dynload/_ctypes.so (unknown line)
ffi_call at /Users/ortner/anaconda/lib/python2.7/lib-dynload/_ctypes.so (unknown line)
_ctypes_callproc at /Users/ortner/anaconda/lib/python2.7/lib-dynload/_ctypes.so (unknown line)
PyCFuncPtr_call at /Users/ortner/anaconda/lib/python2.7/lib-dynload/_ctypes.so (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
fast_function at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
fast_function at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
fast_function at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
fast_function at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
function_call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
instancemethod_call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
slot_tp_init at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
type_call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
fast_function at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
function_call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
instancemethod_call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
slot_tp_init at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
type_call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
fast_function at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
function_call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_CallFunctionObjArgs at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
slot_tp_descr_get at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
_PyObject_GenericGetAttrWithDict at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
function_call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
call_function_tail at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_CallFunction at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
property_descr_get at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
_PyObject_GenericGetAttrWithDict at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
function_call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
instancemethod_call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
slot_tp_init at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
type_call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
fast_function at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCode at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyImport_ExecCodeModuleEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
load_source_module at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
import_submodule at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
load_next at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyImport_ImportModuleLevel at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
builtin___import__ at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_CallObjectWithKeywords at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCode at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyImport_ExecCodeModuleEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
load_source_module at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
import_submodule at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
load_next at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyImport_ImportModuleLevel at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
builtin___import__ at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_CallObjectWithKeywords at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalFrameEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCodeEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyEval_EvalCode at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyImport_ExecCodeModuleEx at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
load_source_module at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
load_package at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
import_submodule at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
load_next at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyImport_ImportModuleLevel at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
builtin___import__ at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_Call at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
call_function_tail at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyObject_CallFunction at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyImport_Import at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
PyImport_ImportModule at /Users/ortner/anaconda/lib/libpython2.7.dylib (unknown line)
# lots more julia related lines
Allocations: 3500342 (Pool: 3497996; Big: 2346); GC: 5
Segmentation fault: 11

replay and play movie in full screen mode?

Hi,

env: jupyter notebook

is it easy for you to add

  • replay for movie?
  • having play control in full screen mode? I would I to click the play button in this mode.

So far the API of chemview is pretty good.

things about speed + mouse wheel direction + global options

I've been trying few visualize program but VMD is the best one IMO, in term off rotating molecule, mouse sensitivity.

Most of other programs give me a feeling of 'heavy' movement.

So what do you think about change the default values for:

  • controls.rotateSpeed = 2.0 (instead of 0.4)
  • controls.zoomSpeed = 1.8 (instead of 1.2)
  • this.camera_z = +150 (instead of -150): This mouse direction is similar to VMD. It's more common to zoom in than zoom out, moving the wheel forward (to screen) is much easier. So I guess VMD does opposite way compared to others. But I I like VMD's one.

Alpha channel in representations

Transparency in molecular representations could allow comparisons between large geometries such as proteins and nanotubes in chemical reactions, optimisations etc.

alphatest

For entire representations, it's fairly easy to allow transparency by adding:
transparent: true, opacity: alpha
to the THREE material's arguments. However, a bit more effort would be needed to control individual atoms, but I can't think of a situation where varying transparencies could be useful.

For now, if it seems useful, I can add an opacity option for balls_and_sticks and isosurfaces.

Update for Jupyter Notebook

Attempting to run the Quick Start notebook:

from chemview import enable_notebook, MolecularViewer
enable_notebook()

results in

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-d8be18394f63> in <module>()
----> 1 from chemview import enable_notebook, MolecularViewer
      2 enable_notebook()

/usr/lib/python2.7/site-packages/chemview/__init__.py in <module>()
----> 1 from .install import enable_notebook
      2 from .widget import RepresentationViewer
      3 from .viewer import MolecularViewer, TrajectoryControls
      4 from .trajectory import TrajectoryViewer

/usr/lib/python2.7/site-packages/chemview/install.py in <module>()
      4 import warnings
      5 from IPython.display import display, Javascript
----> 6 from IPython.html.nbextensions import install_nbextension
      7 with warnings.catch_warnings():
      8     warnings.simplefilter("ignore")

ImportError: No module named nbextensions

so it looks like things need to be updated for Jupyter Notebook.

Unable to install on Ubuntu

I am unable to install chemview.

When I follow the conda instructions:

  • conda install -c http://conda.binstar.org/gabrielelanaro doesn't work (Error: too few arguments, must supply command line package specs or --file)
  • conda install -c gabrielelanaro chemview=0.3 does work

The notebook is not quite working after this installation:
screenshot from 2016-10-15 20-46-46
screenshot from 2016-10-15 20-47-57

I don't know if this is exclusively related to Python 3.

When I clone the repo and install the package locally, I get this error:

    npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
    npm WARN notsup Not compatible with your operating system or architecture: [email protected]
    npm WARN [email protected] No license field.
    rebuilding js and css failed
    missing files: ['/tmp/pip-67vQhC-build/chemview/static/extension.js', '/tmp/pip-67vQhC-build/chemview/static/index.js']
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-67vQhC-build/setup.py", line 170, in <module>
        setup(**setup_args)
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-67vQhC-build/setup.py", line 45, in run
        raise e
    ValueError: Missing file: /tmp/pip-67vQhC-build/chemview/static/extension.js

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-67vQhC-build/

I'm on Ubuntu 16.10. The only python thing that is probably non-standard is that I have python and pip as alias for python3 and pip3.

serialization done right

We want to produce static versions of the widget

We have developed a new scene API that is standardized

Bond rendering issue

Hi, thanks for releasing chemview, it's a very neat tool. We've been developing an interface between it and the Atomic Simulation Environment (ASE) as part of our materials science toolkit matscipy, and have come across some issues rendering bonds.

Here's are a couple of screenshots to show what I mean, before and after zooming out, and the self-contained code used to setup the MolecularViewer. I've taken care only to include bonds which are fully within the simulation cell, so it's not a boundary wrapping issue.

Any suggestions of what might be going on?

image

image

import numpy as np
from chemview import enable_notebook
from chemview import MolecularViewer, RepresentationViewer
enable_notebook()

positions = np.array(
      [[ 0.    ,  0.    ,  0.    ],
       [ 1.3575,  1.3575,  1.3575],
       [ 0.    ,  2.715 ,  2.715 ],
       [ 1.3575,  4.0725,  4.0725],
       [ 2.715 ,  0.    ,  2.715 ],
       [ 4.0725,  1.3575,  4.0725],
       [ 2.715 ,  2.715 ,  0.    ],
       [ 4.0725,  4.0725,  1.3575],
       [ 0.    ,  0.    ,  5.43  ],
       [ 1.3575,  1.3575,  6.7875],
       [ 0.    ,  2.715 ,  8.145 ],
       [ 1.3575,  4.0725,  9.5025],
       [ 2.715 ,  0.    ,  8.145 ],
       [ 4.0725,  1.3575,  9.5025],
       [ 2.715 ,  2.715 ,  5.43  ],
       [ 4.0725,  4.0725,  6.7875],
       [ 5.43  ,  0.    ,  0.    ],
       [ 6.7875,  1.3575,  1.3575],
       [ 5.43  ,  2.715 ,  2.715 ],
       [ 6.7875,  4.0725,  4.0725],
       [ 8.145 ,  0.    ,  2.715 ],
       [ 9.5025,  1.3575,  4.0725],
       [ 8.145 ,  2.715 ,  0.    ],
       [ 9.5025,  4.0725,  1.3575],
       [ 5.43  ,  0.    ,  5.43  ],
       [ 6.7875,  1.3575,  6.7875],
       [ 5.43  ,  2.715 ,  8.145 ],
       [ 6.7875,  4.0725,  9.5025],
       [ 8.145 ,  0.    ,  8.145 ],
       [ 9.5025,  1.3575,  9.5025],
       [ 8.145 ,  2.715 ,  5.43  ],
       [ 9.5025,  4.0725,  6.7875]])

topology = {'atom_types': 
               ['Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si',
                'Si'],
 'bonds': [(0, 1),
           (1, 6),
           (1, 4),
           (1, 2),
           (2, 3),
           (3, 14),
           (4, 5),
           (5, 18),
           (5, 24),
           (5, 14),
           (6, 7),
           (7, 18),
           (8, 9),
           (9, 14),
           (9, 12),
           (9, 10),
           (10, 11),
           (12, 13),
           (13, 26),
           (14, 15),
           (15, 26),
           (16, 17),
           (17, 22),
           (17, 20),
           (17, 18),
           (18, 19),
           (19, 30),
           (20, 21),
           (21, 30),
           (22, 23),
           (24, 25),
           (25, 30),
           (25, 28),
           (25, 26),
           (26, 27),
           (28, 29),
           (30, 31)]}

mv = MolecularViewer(positions/10,
                     topology=topology)
mv.ball_and_sticks()
mv

Display MOL data

So for a course we want to instruct students to write a piece of python that retrieves mol files from PubChem or other services (like the NIH resolver), and display those in 3D. How do I accomplish that in chemview? I think I might need chemlab, but installing it from conda gives a dependency issue with python 3. I also could not find the repository to install from source.

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.