{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "

Interactive Data Visualization and Analysis Interface

\n", "

\n", "\n", "

Zhi Li1, Mansoor Ani Najeeb2, Liana Alves2,1, Alyssa Z. Sherman2, Venkateswaran Shekar3, Peter Cruz Parrilla2, Ian M. Pendleton2, Wesley Wang16, Philip W. Nega1, Matthias Zeller4, Joshua Schrier2,5, Alexander J. Norquist2, Emory M. Chan1

\n", "
\n", "\n", "1. Molecular Foundry, Lawrence Berkeley National Laboratory, 1 Cyclotron Road, Berkeley, California 94720, USA\n", "2. Department of Chemistry, Haverford College, 370 Lancaster Avenue, Haverford, Pennsylvania 19041, USA\n", "3. Department of Computer Science, Haverford College, 370 Lancaster Avenue, Haverford, Pennsylvania 19041, USA\n", "4. Department of Chemistry, Purdue University, West Lafayette IN 47907, USA\n", "5. Department of Chemistry, Fordham University, 441 E. Fordham Road, The Bronx, New York, 10458, USA\n", "6. Department of Chemistry, University of California, Berkeley, 420 Latimer Hall, Berkeley, California 94720, USA\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Visualization\n", "\n", "

If accessing this jupyter notebook via mybinder.org, please wait for the notebook to load completely, it may take around 10-20 minutes for mybinder to load.

\n", "\n", "1) To display visualizations click on the \"Cell\" menu above and click on \"Run All\". \n", "\n", "2) It may take a few minutes on an average for the cells to process. If not, refresh the page and try Step 1 again\n", "\n", "3) To access the source code for this notebook and the associated data please visit: https://github.com/darkreactions/rapid" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import importlib" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Reaction outcomes\n", "\n", "Reaction outcomes are plotted as a function of the reaction composition, in the following figure. The highest quality crystal outcomes (score = 4) are represented as red points. Lower quality outcomes are depicted as yellow, green, and blue for scores of 3, 2, 1, respectively.\n", "\n", "Each point in the following figure represents an experiment and its color indicates the crystal score. The plot can be rotated by clicking and dragging the mouse. Experiment details can be obtained by clicking on any point. The clicked experiment is highlighted by a solid color and increased size. Points of the same class as the clicked experiment are also larger.\n", "\n", "The convex hull shows the experimental space defined by the model set of stock solutions; individual points can be outside of this space if they came from experiments whose stock solutions where the actual prepared stock solutions were slightly more or less concentrated than the nominal description.\n", "Warning: Experiments are clickable only when the convex hull is turned off. To do so, toggle the \"Show Convex Hull\" button.\n", "\n", "Note: Clicking on \"Show X-Y axes\" will show a projection into the organic/inorganic plane.\n", "\n", "Note: Clicking on the legend will show/hide the correspoding crystal scores in the plot. Double clicking a crystal score on the legend will only show that score\n", "\n" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "scrolled": false }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "210282de87ea4f4abffa5a627fb19110", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(Tab(children=(VBox(children=(FigureWidget({\n", " 'data': [{'hoverinfo': 'text',\n", " 'm…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plots\n", "importlib.reload(plots)\n", "fig1 = plots.Figure1('./data/0042.perovskitedata_RAPID.csv')\n", "fig1.plot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## XRD plot\n", "Select the amine, plate and vial from the drop down menu below the figure. If vial name is 'None', it is a representative XRD for that plate. The experiment details tab shows the vial image and experimental conditions for the selected vial\n", "\n", "Tools to manipulate the figure appear on the top right corner of the plot when the mouse hovers over the plot" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": false }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "23c2399530354b9782940da94cace3f0", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Tab(children=(VBox(children=(FigureWidget({\n", " 'data': [{'type': 'scatter',\n", " 'uid': '4dffc9cb-83…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import xrd_plot\n", "importlib.reload(xrd_plot)\n", "\n", "xrd = xrd_plot.XRD()\n", "xrd.plot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Machine Learning Outcomes\n", "\n", "The following plot shows different metrics for 6 machines learning models run on 45 amines. The different amines and model metrics can be selected by clicking on the drop-down menu below the plot. Clicking on the model name in the legend will hide the selected model plot. Double clicking will remove all other models from the plot.\n", "\n", "Hovering over points will show the number of training experiments and metric followed by the model name." ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a421e2d849964a2c93563f91dd8c97ab", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(FigureWidget({\n", " 'data': [{'marker': {'color': 'rgba(31, 118, 180, 1)', 'size': 5},\n", " …" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import ml_section\n", "importlib.reload(ml_section)\n", "\n", "mlsection = ml_section.MLSection()\n", "mlsection.plot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## CIF\n", "\n", "To show an interactive 3D molecule please click on the \"Show Molecule\" button\n", "Once the plot loads, you can view a 2x2x2 supercell by clicking on the button below the figure.\n", "Right clicking on the figure will provide many other jsmol tools" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", "
\n", "
\n", "
\n", " \n", "
\n", "
\n", "
\n", " \n", "
\n", "
\n", "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import cif_plots\n", "importlib.reload(cif_plots)\n", "\n", "cif_paths = ['data/cifs/AcetPbI3.cif', 'data/cifs/CHMA2PbI4.cif']\n", "fig_names = ['AcetPbI3', 'CHMA2PbI4']\n", "doi_values = {'AcetPbI3':'10.5517/cc1j04rf', 'CHMA2PbI4': '10.5517/ccdc.csd.cc1j88bd'}\n", "fig4 = cif_plots.JsMolFigure(cif_paths, fig_names, doi_values, widget_side=600)\n", "fig4.plot" ] } ], "metadata": { "hide_input": false, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.8" }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }