icn3dpy
=======
icn3dpy is a simple [IPython/Jupyter](http://jupyter.org/) widget to
embed an interactive [iCn3D](https://github.com/ncbi/icn3d) viewer in a notebook. Its source code is at [PyPI](https://pypi.org/project/icn3dpy/), and is also included at [iCn3D GitHub](https://github.com/ncbi/icn3d/tree/master/jupyternotebook).
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](https://github.com/ncbi/icn3d/issues).
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](https://www.ncbi.nlm.nih.gov/Structure/icn3d/?mmdbid=6m0j)):
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](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#parameters):
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](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#commands).
License
-------
United States Government Work
Raw data
{
"_id": null,
"home_page": "https://github.com/ncbi/icn3d",
"name": "icn3dpy",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "WebGL-based protein structure viewer",
"author": "Jiyao Wang",
"author_email": "wangjiy@ncbi.lm.nih.gov",
"download_url": "https://files.pythonhosted.org/packages/4d/c1/a060f34d6568c8c1736ecf52a4fa2c79ac3dc710709624b4073d7d3a8237/icn3dpy-3.39.0.tar.gz",
"platform": null,
"description": "icn3dpy\n=======\n\nicn3dpy is a simple [IPython/Jupyter](http://jupyter.org/) widget to\nembed an interactive [iCn3D](https://github.com/ncbi/icn3d) viewer in a notebook. Its source code is at [PyPI](https://pypi.org/project/icn3dpy/), and is also included at [iCn3D GitHub](https://github.com/ncbi/icn3d/tree/master/jupyternotebook).\n\nThe 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.\n\nIf you experience problems, please file an [issue](https://github.com/ncbi/icn3d/issues).\n\n\nInstallation\n------------\n\nInstall icn3dpy:\n\n pip install icn3dpy\n\nInstall node if node is unavailable. One way in Mac is to use \"brew\":\n\n brew update\n\n brew install node \n\nInstall Jupyter Lab and the extension \"jupyterlab_3dmol\":\n\n pip install jupyterlab\n\n jupyter labextension install jupyterlab_3dmol\n or jupyterhub labextension install jupyterlab_3dmol\n\n\n\nUsage\n-----\n\nOpen a notebook:\n\n jupyter notebook\n\nand issue Python script as follows:\n\n import icn3dpy\n\n\"mmdbid\" as input:\n\n view = icn3dpy.view(q='mmdbid=6hjr')\n view\n\nYou can also try other input besides \"mmdbid\".\n\"cid\" as input:\n\n view = icn3dpy.view(q='cid=2244')\n view\n\n\"url\" as input for local PDB files, e.g., \"./1TOP.pdb\":\n\n view = icn3dpy.view(q='url=pdb|./1TOP.pdb')\n view\n\n\"url\" as input for remote PDB files:\n\n view = icn3dpy.view(q='url=pdb|https://storage.googleapis.com/membranome-assets/pdb_files/proteins/FCG2A_HUMAN.pdb')\n view\n\n\"url\" as input for iCn3D PNG Image files:\n\n view = icn3dpy.view(q='url=icn3dpng|https://api.figshare.com/v2/file/download/39125801')\n view\n\nUse 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](https://www.ncbi.nlm.nih.gov/Structure/icn3d/?mmdbid=6m0j)):\n\n 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')\n view\n\nEmbed 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](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#parameters):\n\n view = icn3dpy.view(q='mmdbid=6hjr', para='imageonly=1')\n view\n\nCommand\n-------\n\nYou 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](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#commands).\n\n\nLicense\n-------\n\nUnited States Government Work\n\n\n\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "An IPython interface for embedding iCn3D viewer",
"version": "3.39.0",
"project_urls": {
"Homepage": "https://github.com/ncbi/icn3d"
},
"split_keywords": [
"webgl-based",
"protein",
"structure",
"viewer"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a0a1c0d1143d31ac292271cdc1cb8da815d0caa02e667554537543672a83bcbf",
"md5": "4d1bea79aa2a81117c6bd3960079f218",
"sha256": "6d9ee4537d2211667a836258b99dacc5be82a41292faddfe1875f309eab33174"
},
"downloads": -1,
"filename": "icn3dpy-3.39.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4d1bea79aa2a81117c6bd3960079f218",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10590,
"upload_time": "2024-12-03T17:33:06",
"upload_time_iso_8601": "2024-12-03T17:33:06.148608Z",
"url": "https://files.pythonhosted.org/packages/a0/a1/c0d1143d31ac292271cdc1cb8da815d0caa02e667554537543672a83bcbf/icn3dpy-3.39.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4dc1a060f34d6568c8c1736ecf52a4fa2c79ac3dc710709624b4073d7d3a8237",
"md5": "90b1ea6a68fd704c5fc7b67fd7a87fa5",
"sha256": "10053b89934a6c77edbc0434f4f3f922698b44fceae4c348c70ce30c2f4fcf86"
},
"downloads": -1,
"filename": "icn3dpy-3.39.0.tar.gz",
"has_sig": false,
"md5_digest": "90b1ea6a68fd704c5fc7b67fd7a87fa5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6146,
"upload_time": "2024-12-03T17:33:08",
"upload_time_iso_8601": "2024-12-03T17:33:08.575229Z",
"url": "https://files.pythonhosted.org/packages/4d/c1/a060f34d6568c8c1736ecf52a4fa2c79ac3dc710709624b4073d7d3a8237/icn3dpy-3.39.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-03 17:33:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ncbi",
"github_project": "icn3d",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "icn3dpy"
}