Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
hainm committed Dec 8, 2024
1 parent 1040b02 commit 69d94ed
Showing 1 changed file with 36 additions and 16 deletions.
52 changes: 36 additions & 16 deletions notebooks/molviewspec.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,14 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 36,
"id": "fedefdce-ce21-4c3c-90bd-27909fe17413",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e74f2c3635cc4b89987bd72f1c25880b",
"version_major": 2,
"version_minor": 0
},
"text/plain": []
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f2dd1db95dca410fa8c99c6839f22ae0",
"model_id": "0a443df2c58f44bc801f8371bc11e510",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -38,19 +26,51 @@
"import molviewspec as mvs\n",
"builder = mvs.create_builder()\n",
"# at each step, auto-complete will suggest possible actions depending on the current state of the builder\n",
"(\n",
" builder.download(url='https://files.wwpdb.org/download/1cbs.cif')\n",
"(builder.download(url='https://files.wwpdb.org/download/1cbs.cif')\n",
" .parse(format='mmcif')\n",
" .assembly_structure(assembly_id='1')\n",
" .component()\n",
" .representation()\n",
" .color(color='blue')\n",
")\n",
"state = builder.get_state()\n",
"\n",
"view = widget_molstar.MolstarView()\n",
"view.load_spec(state)\n",
"view"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "52cc8f60-4aa8-4978-99a4-ba0e07ac3f5f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'kind': 'download',\n",
" 'params': {'url': 'https://files.wwpdb.org/download/1cbs.cif'},\n",
" 'children': [{'kind': 'parse',\n",
" 'params': {'format': 'mmcif'},\n",
" 'children': [{'kind': 'structure',\n",
" 'params': {'type': 'assembly', 'assembly_id': '1'},\n",
" 'children': [{'kind': 'component',\n",
" 'params': {'selector': 'all'},\n",
" 'children': [{'kind': 'representation',\n",
" 'params': {'type': 'cartoon'},\n",
" 'children': [{'kind': 'color',\n",
" 'params': {'selector': 'all', 'color': 'blue'}}]}]}]}]}]}"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d['root']['children'][0]"
]
}
],
"metadata": {
Expand Down

0 comments on commit 69d94ed

Please sign in to comment.