Skip to main content

An IPython interface for embedding iCn3D viewer

Project description

icn3dpy

icn3dpy is a simple IPython/Jupyter widget to embed an interactive iCn3D viewer in a notebook. Its source code is at PyPI, and is also included at iCn3D GitHub.

The 3D view of icn3dpy in Jupyter Notebook is interactive, just like in any browser. The popup windows will appear under the 3D view. If you have a predefined cutom view, you can use the predefined commands in icn3dpy as shown below.

If you experience problems, please file an issue.

Installation

Install icn3dpy:

pip install icn3dpy

Install the extension:

jupyter labextension install jupyterlab_3dmol

Usage

Open a notebook:

jupyter notebook

and issue Python script as follows:

import icn3dpy

"pdbid" as input:

view = icn3dpy.view(q='pdbid=1tup',command='color spectrum')

view

You can also try other input besides "pdbid". "mmtfid" as input:

view = icn3dpy.view(q='mmtfid=1ffk',command='color spectrum')

view

"mmdbid" as input (works in Chrome, but not in Safari for now):

view = icn3dpy.view(q='mmdbid=1ffk',command='color spectrum')

view

Use predefined commands (see commands in iCn3D Gallery for reference):

view = icn3dpy.view(q='pdbid=6m0j',command='line graph interaction pairs | !A !E | hbonds,salt bridge,interactions,halogen,pi-cation,pi-stacking | false | threshold 3.8 6 4 3.8 6 6; show selection; add residue number labels')

view

Command

You can use iCn3D interactive interface to generate a custom view, then click "File > Share Link" to get the commands in the "Original URL". All iCn3D commands are listed here.

License

United States Government Work

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

icn3dpy-0.1.19.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

icn3dpy-0.1.19-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file icn3dpy-0.1.19.tar.gz.

File metadata

  • Download URL: icn3dpy-0.1.19.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

File hashes

Hashes for icn3dpy-0.1.19.tar.gz
Algorithm Hash digest
SHA256 bdeaffbe0c6a33696fb48fdad2858f835641e6d0acb05cbd7e3152b9146b8737
MD5 0d8dfd2e813b27ddbe905613c500b5c1
BLAKE2b-256 1d4423fbcde8ccdf07050a00a0838e5c91d3cbabe715371f6d34f9056a5aa3bf

See more details on using hashes here.

File details

Details for the file icn3dpy-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: icn3dpy-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

File hashes

Hashes for icn3dpy-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 3a8d8c0c12aafb863aa89eafafab12e6ac3ecb8a5ddb20f163e1186df6a3b7d2
MD5 ebe310a21a42f9221f67e205c82d3539
BLAKE2b-256 91c2ac2616aecd4fe400175f4f7267381b406c498ef831579c0f6aae97e5afad

See more details on using hashes here.

Supported by

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