From d657fa60a70181b3a1b984235e113ca9f30deeb2 Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Wed, 4 Dec 2024 16:36:02 -0500 Subject: [PATCH] add_representation --- notebooks/molstarview.ipynb | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/notebooks/molstarview.ipynb b/notebooks/molstarview.ipynb index 0f03c4ff..043e5cbb 100644 --- a/notebooks/molstarview.ipynb +++ b/notebooks/molstarview.ipynb @@ -9,7 +9,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "9b5586a7f3c243ceb16e803e97db27e5", + "model_id": "91ffff2fd7c543cda5b6c60af5e68769", "version_major": 2, "version_minor": 0 }, @@ -21,7 +21,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "b71b8c0bdd014221b67768790f63fdb1", + "model_id": "7236255e5c194422b24c453987083e61", "version_major": 2, "version_minor": 0 }, @@ -29,9 +29,8 @@ "MolstarView()" ] }, - "execution_count": 1, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ @@ -91,7 +90,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "b71b8c0bdd014221b67768790f63fdb1", + "model_id": "7236255e5c194422b24c453987083e61", "version_major": 2, "version_minor": 0 }, @@ -99,15 +98,38 @@ "MolstarView()" ] }, - "execution_count": 4, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ "view" ] }, + { + "cell_type": "markdown", + "id": "41b835c5-3a2a-4b34-b862-0c6eb4f6700e", + "metadata": {}, + "source": [ + "# Add representation" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "5c15c428-8b99-42b0-887f-d767b08e7fd6", + "metadata": {}, + "outputs": [], + "source": [ + "params = {\n", + " \"type\": \"spacefill\",\n", + " \"typeParams\": { \"sizeFactor\": 0.5 },\n", + " \"color\": \"hydrophobicity\",\n", + " \"colorParams\": { \"scale\": \"DGwoct\" },\n", + "}\n", + "view.add_representation(**params)" + ] + }, { "cell_type": "markdown", "id": "7afb6cdc-5bcf-4abf-9db3-cf204d624c67",