Lab Extension

ENTERPRISE

Using JupyterLab Extension with DC/OS Data Science Engine

This guide will show you how to install JupyterLab Extension. You can use these extensions to customize the JupyterLab UI.

NOTE: Installing extension in this way is not persistent during service restart. If you want persistent installation of the extension you should try Custom Image with the extension of your choice installed in it.

Steps to Install

  1. Go to the Commands (Ctrl+Shift+C) -> Extension Manager -> Enable Extension Manager in the left panel.

    Enable Extension Manager

    Figure 1 - Enable Extension Manager

  2. It will show you the prompt asking for confirmation, click on Enable.

    Extension Manager Prompt

    Figure 2 - Enable Extension Manager Prompt

  3. Now you would be able to see Extension Manager option in the left panel. Once you go to the Extension Manager, you could search for an extension and install it. For the example purpose, we are going to install @jupyterlab/fasta-extension.

    Extension Manager Search

    Figure 3 - Search For An Extension

  4. Once extension is installed, open Terminal and run following command:

    jupyter lab build --minimize=False --dev-build=False
    
  5. After successful build, refresh the page. Now you are ready to use the extension.

Example Notebook

In the following example, you will use a newly installed extension.

Open a Python Notebook and put the following in a code cell:

from IPython.display import display
 
def Fasta(data=''):
    bundle = {}
    bundle['application/vnd.fasta.fasta'] = data
    bundle['text/plain'] = data
    display(bundle, raw=True)
 
Fasta(""">SEQUENCE_1
MTEITAAMVKELRESTGAGMMDCKNALSETNGDFDKAVQLLREKGLGKAAKKADRLAAEG
LVSVKVSDDFTIAAMRPSYLSYEDLDMTFVENEYKALVAELEKENEERRRLKDPNKPEHK
IPQFASRKQLSDAILKEAEEKIKEELKAQGKPEKIWDNIIPGKMNSFIADNSQLDSKLTL
MGQFYVMDDKKTVEQVIAEKEKEFGGKIKIVEFICFEVGEGLEKKTEDFAAEVAAQL
>SEQUENCE_2
SATVSEINSETDFVAKNDQFIALTKDTTAHIQSNSLQSVEELHSSTINGVKFEEYLKSQI
ATIGENLVVRRFATLKAGANGVVNGYIHTNGRVGVVIAAACDSAEVASKSRDLLRQICMH""")

Expected output would be:

FASTA Extension Example