Skip to main content

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 node if node is unavailable. One way in Mac is to use "brew":

brew update

brew install node 

Install Jupyter Lab and the extension "jupyterlab_3dmol":

pip install jupyterlab

jupyter labextension install jupyterlab_3dmol
or jupyterhub labextension install jupyterlab_3dmol

Usage

Open a notebook:

jupyter notebook

and issue Python script as follows:

import icn3dpy

"mmdbid" as input:

view = icn3dpy.view(q='mmdbid=6hjr')
view

You can also try other input besides "mmdbid". "cid" as input:

view = icn3dpy.view(q='cid=2244')
view

"url" as input for local PDB files, e.g., "./1TOP.pdb":

view = icn3dpy.view(q='url=pdb|./1TOP.pdb')
view

"url" as input for remote PDB files:

view = icn3dpy.view(q='url=pdb|https://storage.googleapis.com/membranome-assets/pdb_files/proteins/FCG2A_HUMAN.pdb')
view

"url" as input for iCn3D PNG Image files:

view = icn3dpy.view(q='url=icn3dpng|https://api.figshare.com/v2/file/download/39125801')
view

Use predefined commands (The Jupyter Notebook commands can be copied from the "Copy Commands" button in the "File > Share Link" menu of interactive iCn3D viewers in Jupyter Notebook or in a web browser):

view = icn3dpy.view(q='mmdbid=6m0j',command='scatterplot 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

Embed a static image instead of an interactive 3D view to improve the performace of a page with multiple structures. The image is clickable to launch an interactive 3D view. The parameters are separated with the symbol "&" (e.g., "imageonly=1&showanno=1"). All parameters are described in the "URL parameters" section:

view = icn3dpy.view(q='mmdbid=6hjr', para='imageonly=1')
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

Release files for icn3dpy 3.53.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for icn3dpy 3.53.0
File Size Uploaded
icn3dpy-3.53.0.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for icn3dpy 3.53.0
File Interpreter ABI Platform
icn3dpy-3.53.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / icn3dpy-3.53.0.tar.gz

Download URL icn3dpy-3.53.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
27e1eca7c9111a388e7be345feb39554c1d3a74420c91c20de1e68f97849b5e4
BLAKE2b-256 checksum
How to use checksums
62115f751951f2d1d8a6fef03e652e10aea54eef4e32f8a3d772edfafad00f93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.8.2 requests/2.28.1 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.7.3

Release files / icn3dpy-3.53.0-py3-none-any.whl

Download URL icn3dpy-3.53.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d3cb4d4cf305f11166d91c03f05e731adb0a3341f0ec2734348435e734f76a8
BLAKE2b-256 checksum
How to use checksums
6437f7d74f14cd7efd16bdab756109e9e567fc8936f9fc9a98942e01eb1f523f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.8.2 requests/2.28.1 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

3.53.0 This release

2 release files

3.52.0

2 release files

3.50.0

2 release files

3.47.0

2 release files

3.46.0

2 release files

3.44.0

2 release files

3.43.0

2 release files

3.42.0

2 release files

3.40.0

2 release files

3.38.0

2 release files

3.37.0

2 release files

3.35.0

2 release files

3.34.0

2 release files

3.33.0

2 release files

3.32.0

2 release files

3.31.0

2 release files

3.30.0

2 release files

3.29.0

2 release files

3.28.2

2 release files

3.28.1

2 release files

3.27.0

2 release files

3.26.0

2 release files

3.25.2

2 release files

3.25.1

2 release files

3.25.0

2 release files

3.24.3

2 release files

3.24.2

2 release files

3.24.1

2 release files

3.24.0

2 release files

3.23.1

2 release files

3.23.0

2 release files

3.22.0

2 release files

3.21.0

2 release files

3.20.1

2 release files

3.20.0

2 release files

3.19.0

2 release files

3.17.0

2 release files

3.16.3

2 release files

3.16.2

2 release files

3.16.1

2 release files

3.15.2

2 release files

3.15.1

2 release files

3.15.0

2 release files

3.14.3

2 release files

3.13.2

2 release files

3.13.0

2 release files

3.12.8

2 release files

3.12.4

2 release files

3.12.3

2 release files

3.11.2

2 release files

3.11.1

2 release files

3.11.0

2 release files

3.9.0

2 release files

3.8.1

2 release files

3.8.0

2 release files

3.7.2

2 release files

3.7.1

2 release files

3.7.0

2 release files

3.6.0

2 release files

3.5.2

2 release files

3.5.1

2 release files

3.5.0

2 release files

3.4.11

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.24.0

2 release files

2.23.0

2 release files

2.22.0

2 release files

2.21.0

2 release files

2.19.0

2 release files

2.18.4

2 release files

2.18.2

2 release files

2.18.1

2 release files

2.18.0

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page