Running a JupyterLab Notebook
Last updated
Was this helpful?
Last updated
Was this helpful?
Before you begin, review the overview documentation and log onto the
Use a DNAnexus JupyerLab notebook so that they will save onto the platform easily.
When you open your JupyterLab session, you will select this option to start a DNAnexus JupyterLab notebook
You can do that by selecting these 2 different options:
Remember to save your notebooks and anything you want to export out of the notebook.
You can access data what is in your notebook space vs what is in your DNAnexus project space by viewing them individually here:
All notebooks that are stored in Project will have DX before the name. Example below:
When you are running code blocks, remember that in JupyterLab you can run them out of order. This means that you need to pay attention to the numbers on the side of the code blocks for the order. This is highlighted in gold below:
If you choose to write in python or R primarily, you can use the following at the top of your code block to "switch" to bash scripting. Example below
Notebook locking: only one user can edit at a time from project storage 4. When a user is editing a notebook, it is locked and others cannot edit it.
When a notebook is saved and the kernel is shutdown in JupyterLab, then others can access it.
In order to unlock it, you will need to close the notebook and then use the screen shot below to ensure that you have shutdown the kernel.
Download or Access data files to JupyterLab environment
to Download:
To access data in JupyterLab environment
this will be read only
do not reflect recent changes in the file system
to add from Project storage add
to the front of your path
Import the data
Do analysis
This is where you will add the code chunks in that you will need for the rest of your analysis
Upload Results back to Project Space
Notebooks can also be directly opened from project storage
When you save in JupyterLab, notebook gets uploaded to platform as a new file. This goes back to the concept of immutability
Old version of notebook goes into .Notebook_archive/ folder in project
Install packages normally with package managers such as pip install (python) or install.packages (R)
Use the correct base image (Spark or Jupyter)
Install all software using a separate Jupyter Notebook
Use version tags when possible
pip install <PACKAGE>==<VERSION>
R: Install from CRAN URL
install.packages(packageurl, repos=NULL, type="source")
Rename and move image from Notebook_Snapshot/ folder
Don't save data in your snapshot - it uses storage space and impacts costs.
Snapshots can be large - they use storage space so think twice.
Make sure to rename the snapshot according to your organization's naming conventions: you can remember what they refer to when returning to the project in the future.
To create a support ticket if there are technical issues:
Go to the Help header (same section where Projects and Tools are) inside the platform
Select "Contact Support"
Fill in the Subject and Message to submit a support ticket.
A number of packages are preinstalled, based on the instance type.
packageurl <- ""