This project aims to enhance the functionality of the cBioPortal by integrating it with JupyterLite, a browser-based Jupyter notebook environment. Users of cBioPortal will now be able to directly spawn Jupyter notebook environments from various points within the application, allowing them to perform custom analysis and visualization of the data they have queried or filtered.
The project consists of two main folders:
package
: This folder contains the code for the cBioPortal extension that facilitates the integration with JupyterLite.lite
: This folder contains the code for the JupyterLite application that will be spawned from within the cBioPortal.
The package
folder contains the code for the cBioPortal extension. The main file to focus on is:
src/index.ts
: This file contains the code of the extension. First the file gets saved and then as soon as it receives the message from the host (cBioPortal), it starts auto-executing the code.
The lite
folder contains the code for the JupyterLite application. The main file to focus on is:
lab/index.html
: This file serves as the entry point for the JupyterLite application and can be used to customize the user interface. It receives the data from the host.
- Here we use conda, a package and environment manager.
- Node.js and npm (Node Package Manager) installed on your system.
-
Create a conda environment:
conda create -n jupyterlab-iframe-ext --override-channels --strict-channel-priority -c conda-forge -c nodefaults jupyterlab=4 nodejs=20 git copier=7 jinja2-time jupyterlite-core conda activate jupyterlab-iframe-ext
-
Change directory to the
package
folder:cd package
-
Create a
yarn
environment and install all dependencies:yarn init -y yarn
-
Finally, install the dependencies and the extension, to add the extension in conda environment.
pip install -e . jupyter labextension develop --overwrite .
-
Whenever a new changes are performed, to sync them with the environment run:
jlpm run build
-
For building the JupyterLite application run the below command in root directory:
cd .. jupyter lite build --output-dir lite
-
To start the development server, run the following command:
python -m http.server -b 127.0.0.1
This will start the JupyterLite application and make it available at
http://127.0.0.1:8000
. This will start the cBioPortal extension and integrate it with the JupyterLite application.
Once the setup is complete, users will be able to access the JupyterLite integration within the cBioPortal application.
The project is designed to be easily customizable and extensible. You can modify the code in the package
and lite
folders to add more features, integrate additional tools, or enhance the overall user experience based on above steps.
If you would like to contribute to this project, please feel free to submit pull requests or open issues on the project's repository.