From 69d94ed1c01b7da8d39d9de53267b0d34b2a74b5 Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Sat, 7 Dec 2024 22:27:28 -0500 Subject: [PATCH] more --- notebooks/molviewspec.ipynb | 52 +++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/notebooks/molviewspec.ipynb b/notebooks/molviewspec.ipynb index f19ead5d..244520dd 100644 --- a/notebooks/molviewspec.ipynb +++ b/notebooks/molviewspec.ipynb @@ -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 }, @@ -38,12 +26,12 @@ "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", @@ -51,6 +39,38 @@ "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": {