This Jupyter notebook will show you how to add tracks using your local data. We are able to leverage Jupyter's server to serve local files that exist within the notebook's file tree, but we also provide a separate dev server for additional support in other environments (binder, colab, etc).
You can run this notebook completely with jupyterlab or jupyter notebook.
$ jupyter lab
or
$ jupyter notebook
If you decide to run this in colab, you can skip the first part of adding tracks (Using the Jupyter server) and go straight to (Using the JBrowse Jupyter dev server)
!pip install jbrowse-jupyter
Collecting git+https://github.com/GMOD/jbrowse-jupyter.git@path_support_two Cloning https://github.com/GMOD/jbrowse-jupyter.git (to revision path_support_two) to /private/var/folders/96/hq94_1qd3c9_q87bwqhg05s80000gn/T/pip-req-build-2d1iovvr Running command git clone -q https://github.com/GMOD/jbrowse-jupyter.git /private/var/folders/96/hq94_1qd3c9_q87bwqhg05s80000gn/T/pip-req-build-2d1iovvr Running command git checkout -b path_support_two --track origin/path_support_two Switched to a new branch 'path_support_two' Branch 'path_support_two' set up to track remote branch 'path_support_two' from 'origin'. Resolved https://github.com/GMOD/jbrowse-jupyter.git to commit 55b815a085f1bfbc8c8b9d3627b708b3c47ebf30 Requirement already satisfied: dash==2.3.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jbrowse-jupyter==1.3.5) (2.3.0) Requirement already satisfied: dash-jbrowse==1.1.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jbrowse-jupyter==1.3.5) (1.1.0) Requirement already satisfied: jupyter_dash>=0.4.2 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jbrowse-jupyter==1.3.5) (0.4.2) Requirement already satisfied: Werkzeug==2.0.3 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jbrowse-jupyter==1.3.5) (2.0.3) Requirement already satisfied: pandas>=1.1.5 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jbrowse-jupyter==1.3.5) (1.4.2) Requirement already satisfied: Flask>=1.0.4 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from dash==2.3.0->jbrowse-jupyter==1.3.5) (2.1.3) Requirement already satisfied: flask-compress in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from dash==2.3.0->jbrowse-jupyter==1.3.5) (1.11) Requirement already satisfied: dash-table==5.0.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from dash==2.3.0->jbrowse-jupyter==1.3.5) (5.0.0) Requirement already satisfied: dash-html-components==2.0.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from dash==2.3.0->jbrowse-jupyter==1.3.5) (2.0.0) Requirement already satisfied: plotly>=5.0.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from dash==2.3.0->jbrowse-jupyter==1.3.5) (5.7.0) Requirement already satisfied: dash-core-components==2.0.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from dash==2.3.0->jbrowse-jupyter==1.3.5) (2.0.0) Requirement already satisfied: Jinja2>=3.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from Flask>=1.0.4->dash==2.3.0->jbrowse-jupyter==1.3.5) (3.1.2) Requirement already satisfied: importlib-metadata>=3.6.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from Flask>=1.0.4->dash==2.3.0->jbrowse-jupyter==1.3.5) (4.11.3) Requirement already satisfied: click>=8.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from Flask>=1.0.4->dash==2.3.0->jbrowse-jupyter==1.3.5) (8.1.3) Requirement already satisfied: itsdangerous>=2.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from Flask>=1.0.4->dash==2.3.0->jbrowse-jupyter==1.3.5) (2.1.2) Requirement already satisfied: zipp>=0.5 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from importlib-metadata>=3.6.0->Flask>=1.0.4->dash==2.3.0->jbrowse-jupyter==1.3.5) (3.8.0) Requirement already satisfied: MarkupSafe>=2.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from Jinja2>=3.0->Flask>=1.0.4->dash==2.3.0->jbrowse-jupyter==1.3.5) (2.0.1) Requirement already satisfied: requests in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (2.27.1) Requirement already satisfied: retrying in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (1.3.3) Requirement already satisfied: ipython in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (8.2.0) Requirement already satisfied: ansi2html in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (1.7.0) Requirement already satisfied: ipykernel in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (6.12.1) Requirement already satisfied: nest-asyncio in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (1.5.5) Requirement already satisfied: numpy>=1.18.5 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from pandas>=1.1.5->jbrowse-jupyter==1.3.5) (1.22.3) Requirement already satisfied: python-dateutil>=2.8.1 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from pandas>=1.1.5->jbrowse-jupyter==1.3.5) (2.8.2) Requirement already satisfied: pytz>=2020.1 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from pandas>=1.1.5->jbrowse-jupyter==1.3.5) (2022.1) Requirement already satisfied: tenacity>=6.2.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from plotly>=5.0.0->dash==2.3.0->jbrowse-jupyter==1.3.5) (8.0.1) Requirement already satisfied: six in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from plotly>=5.0.0->dash==2.3.0->jbrowse-jupyter==1.3.5) (1.16.0) Requirement already satisfied: brotli in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from flask-compress->dash==2.3.0->jbrowse-jupyter==1.3.5) (1.0.9) Requirement already satisfied: matplotlib-inline>=0.1 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.1.3) Requirement already satisfied: jupyter-client>=6.1.12 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (7.2.2) Requirement already satisfied: debugpy>=1.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (1.6.0) Requirement already satisfied: tornado>=6.1 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (6.1) Requirement already satisfied: packaging in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (21.3) Requirement already satisfied: traitlets>=5.1.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (5.1.1) Requirement already satisfied: appnope in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.1.3) Requirement already satisfied: psutil in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (5.9.0) Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (3.0.29) Requirement already satisfied: pygments>=2.4.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (2.11.2) Requirement already satisfied: pexpect>4.3 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (4.8.0) Requirement already satisfied: backcall in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.2.0) Requirement already satisfied: decorator in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (5.1.1) Requirement already satisfied: pickleshare in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.7.5) Requirement already satisfied: stack-data in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.2.0) Requirement already satisfied: setuptools>=18.5 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (58.0.4) Requirement already satisfied: jedi>=0.16 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.18.1) Requirement already satisfied: parso<0.9.0,>=0.8.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jedi>=0.16->ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.8.3) Requirement already satisfied: entrypoints in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-client>=6.1.12->ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.4) Requirement already satisfied: jupyter-core>=4.9.2 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-client>=6.1.12->ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (4.9.2) Requirement already satisfied: pyzmq>=22.3 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-client>=6.1.12->ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (22.3.0) Requirement already satisfied: ptyprocess>=0.5 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from pexpect>4.3->ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.7.0) Requirement already satisfied: wcwidth in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.2.5) Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from packaging->ipykernel->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (3.0.7) Requirement already satisfied: certifi>=2017.4.17 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from requests->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (2021.10.8) Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from requests->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (1.26.9) Requirement already satisfied: charset-normalizer~=2.0.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from requests->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (2.0.12) Requirement already satisfied: idna<4,>=2.5 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from requests->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (3.3) Requirement already satisfied: pure-eval in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from stack-data->ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.2.2) Requirement already satisfied: executing in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from stack-data->ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (0.8.3) Requirement already satisfied: asttokens in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from stack-data->ipython->jupyter_dash>=0.4.2->jbrowse-jupyter==1.3.5) (2.0.5)
from jbrowse_jupyter import launch, create, serve
from dash import jupyter_dash
import requests
# Uncomment and run the next line if you are running this in jupyterlab/jupyternotebook
!pip install jupyter_server_proxy
Requirement already satisfied: jupyter_server_proxy in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (3.2.1) Requirement already satisfied: aiohttp in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter_server_proxy) (3.8.1) Requirement already satisfied: simpervisor>=0.4 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter_server_proxy) (0.4) Requirement already satisfied: jupyter-server>=1.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter_server_proxy) (1.16.0) Requirement already satisfied: jupyter-core>=4.7.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (4.9.2) Requirement already satisfied: Send2Trash in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (1.8.0) Requirement already satisfied: nbconvert>=6.4.4 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (6.4.5) Requirement already satisfied: terminado>=0.8.3 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (0.13.3) Requirement already satisfied: anyio>=3.1.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (3.5.0) Requirement already satisfied: traitlets>=5.1.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (5.1.1) Requirement already satisfied: jupyter-client>=6.1.12 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (7.2.2) Requirement already satisfied: websocket-client in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (1.3.2) Requirement already satisfied: packaging in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (21.3) Requirement already satisfied: nbformat>=5.2.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (5.3.0) Requirement already satisfied: prometheus-client in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (0.14.1) Requirement already satisfied: pyzmq>=17 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (22.3.0) Requirement already satisfied: tornado>=6.1.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (6.1) Requirement already satisfied: argon2-cffi in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (21.3.0) Requirement already satisfied: jinja2 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-server>=1.0->jupyter_server_proxy) (3.1.2) Requirement already satisfied: sniffio>=1.1 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from anyio>=3.1.0->jupyter-server>=1.0->jupyter_server_proxy) (1.2.0) Requirement already satisfied: idna>=2.8 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from anyio>=3.1.0->jupyter-server>=1.0->jupyter_server_proxy) (3.3) Requirement already satisfied: python-dateutil>=2.8.2 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-client>=6.1.12->jupyter-server>=1.0->jupyter_server_proxy) (2.8.2) Requirement already satisfied: entrypoints in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-client>=6.1.12->jupyter-server>=1.0->jupyter_server_proxy) (0.4) Requirement already satisfied: nest-asyncio>=1.5.4 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jupyter-client>=6.1.12->jupyter-server>=1.0->jupyter_server_proxy) (1.5.5) Requirement already satisfied: beautifulsoup4 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (4.11.1) Requirement already satisfied: MarkupSafe>=2.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (2.0.1) Requirement already satisfied: defusedxml in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (0.7.1) Requirement already satisfied: pygments>=2.4.1 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (2.11.2) Requirement already satisfied: bleach in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (5.0.0) Requirement already satisfied: pandocfilters>=1.4.1 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (1.5.0) Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (0.5.13) Requirement already satisfied: mistune<2,>=0.8.1 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (0.8.4) Requirement already satisfied: testpath in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (0.6.0) Requirement already satisfied: jupyterlab-pygments in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (0.2.0) Requirement already satisfied: jsonschema>=2.6 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbformat>=5.2.0->jupyter-server>=1.0->jupyter_server_proxy) (3.2.0) Requirement already satisfied: fastjsonschema in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from nbformat>=5.2.0->jupyter-server>=1.0->jupyter_server_proxy) (2.15.3) Requirement already satisfied: attrs>=17.4.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jsonschema>=2.6->nbformat>=5.2.0->jupyter-server>=1.0->jupyter_server_proxy) (21.4.0) Requirement already satisfied: setuptools in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jsonschema>=2.6->nbformat>=5.2.0->jupyter-server>=1.0->jupyter_server_proxy) (58.0.4) Requirement already satisfied: six>=1.11.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jsonschema>=2.6->nbformat>=5.2.0->jupyter-server>=1.0->jupyter_server_proxy) (1.16.0) Requirement already satisfied: pyrsistent>=0.14.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from jsonschema>=2.6->nbformat>=5.2.0->jupyter-server>=1.0->jupyter_server_proxy) (0.18.1) Requirement already satisfied: ptyprocess in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from terminado>=0.8.3->jupyter-server>=1.0->jupyter_server_proxy) (0.7.0) Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from aiohttp->jupyter_server_proxy) (2.0.12) Requirement already satisfied: frozenlist>=1.1.1 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from aiohttp->jupyter_server_proxy) (1.3.0) Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from aiohttp->jupyter_server_proxy) (4.0.2) Requirement already satisfied: yarl<2.0,>=1.0 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from aiohttp->jupyter_server_proxy) (1.7.2) Requirement already satisfied: aiosignal>=1.1.2 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from aiohttp->jupyter_server_proxy) (1.2.0) Requirement already satisfied: multidict<7.0,>=4.5 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from aiohttp->jupyter_server_proxy) (6.0.2) Requirement already satisfied: argon2-cffi-bindings in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from argon2-cffi->jupyter-server>=1.0->jupyter_server_proxy) (21.2.0) Requirement already satisfied: cffi>=1.0.1 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from argon2-cffi-bindings->argon2-cffi->jupyter-server>=1.0->jupyter_server_proxy) (1.15.0) Requirement already satisfied: pycparser in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->jupyter-server>=1.0->jupyter_server_proxy) (2.21) Requirement already satisfied: soupsieve>1.2 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from beautifulsoup4->nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (2.3.2) Requirement already satisfied: webencodings in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from bleach->nbconvert>=6.4.4->jupyter-server>=1.0->jupyter_server_proxy) (0.5.1) Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Users/teresamartinez/opt/anaconda3/envs/jbrowse-jupyter/lib/python3.8/site-packages (from packaging->jupyter-server>=1.0->jupyter_server_proxy) (3.0.7)
# Uncomment and run the next line if you are running this in jupyterlab/jupyternotebook
from dash import jupyter_dash
jupyter_dash.infer_jupyter_proxy_config()
# Create an Hg19 JBrowse config
hg19 = create('LGV', genome='hg19')
The following two sections
are the two ways in which JBrowse Jupyter supports using local data to configure JBrowse views in the development environment.
Before proceeding with the tutorials, download our example gff files to add a track to our hg19 config.
# You can skip this step if you are using your own data.
file1 = 'https://s3.amazonaws.com/jbrowse.org/genomes/hg19/ncbi_refseq/GRCh37_latest_genomic.sort.gff.gz'
file2 = 'https://s3.amazonaws.com/jbrowse.org/genomes/hg19/ncbi_refseq/GRCh37_latest_genomic.sort.gff.gz.tbi'
response1 = requests.get(file1)
response2 = requests.get(file2)
open("GRCh37_latest_genomic.sort.gff.gz", "wb").write(response1.content)
open("GRCh37_latest_genomic.sort.gff.gz.tbi", "wb").write(response2.content)
227612
Note If you have local files that you want to use, proceed to
- Step 3. on the Using the Jupyter server tutorial or
- Step 1. of the Using the JBrowse Jupyter dev server tutorial
This section will show you how to use local files with jbrowse jupyter when your files exist within your jupyterlab/jupyter notebook file system.
!!!! Intended for those running this notebook in jupyter lab or jupyter notebook !!!!
1. Run Jupyter.
2. Verify that local files exist within your notebook file system.
Now that we have these new files in your file tree, we will be able to format urls to pass on to our components. Navigate to http://localhost:8888/tree to verify that GRCh37_latest_genomic.sort.gff.gz and GRCh37_latest_genomic.sort.gff.gz.tbi exist within the file tree.
NOTE: Your port and host may be different, so make sure that you use the same port from your jupyter notebook configuration. To ensure you have the correct one, you can look at the port in the url window where your notebook is running. http://your-host:your-port/tree
3. Create Paths for your files. Paths should be relative to the root of the Jupyter file tree.
Example:
jbrowse-jupyter/ local_support.ipynb GRCh37_latest_genomic.sort.gff.gz GRCh37_latest_genomic.sort.gff.gz.tbi
Path relative to the root of the Jupyter file tree since we ran jupyter lab/jupyter notebook from the root of the repo. Path to the gff files would be e.g /GRCh37_latest_genomic.sort.gff.gz
# With the gff files that we just downloaded to our directory, we will add a track.
track_data = '/GRCh37_latest_genomic.sort.gff.gz'
track_data_index = '/GRCh37_latest_genomic.sort.gff.gz.tbi'
# you can check your jupyter host and port match that used by JBrowse by running
hg19.get_env()
# if they do not match, you can change it using the command below
notebook port: 8888 notebook host: localhost
('localhost', 8888)
# uncomment the line below and modify according to your Jupyter config.
# hg19.set_env("localhost", 8889)
# The command above is changing the port to 8889 since my jupyter config is set to port 8889 and localhost
hg19.add_track(track_data, index=track_data_index, track_id='jupyter_server_demo', name='jupyter_server_demo')
hg19.set_default_session(['jupyter_server_demo'],False)
NOTE: You can now skip to launch the Linear Genome View or continue with the next tutorial to checkout our JBrowse dev server.
1. git clone our repo: https://github.com/GMOD/jbrowse-jupyter. You can skip this step if you are already running this tutorial from within this repo.
2. From the root of our directory, run
$ python serve.py
3. You can provide a specific PORT, HOST, and DIRECTORY from where you want to serve your data. None of these are required. PORT will default to 8080 Host will default to 'localhost' The directory will default to your current working directory.
Your terminal should look something like this, if no input was provided.
> python serve.py
Enter a PORT: [default:8080] >
8080
ENTER A HOST: [default:localhost] >
localhost
ENTER PATH TO YOUR LOCAL DATA: [default:(pwd)] >
=============================================
Warning:
This is a development environment.
This is not recommended for production.
=============================================
Server is now running at
"http://localhost:8080"
4. Navigate to the url and verify that your local data is there. If you do not see your files, make sure you moved the files you wish to serve to the directory you provided to the server above.
E.g: if you chose the defaults, the dev server is serving the files in your current working directory (this repo). You can move the files you just downloaded or that you wish to display into the current working directory. Otherwise, exit the server and rerun the script with the correct path to the folder containing your files.
Now you should be able to provide urls to your local data to the JBrowse Jupyter config. Below you can find an example of our dev server serving files GRCh37_latest_genomic.sort.gff.gz and GRCh37_latest_genomic.sort.gff.gz.tbi on port 8080 on local host.
You can also run the server by using the serve() method from our package. Checkout our docs for more information regarding our local dev server: https://github.com/GMOD/jbrowse-jupyter/blob/main/README.md
NOTE: You can skip the following cell if you did not run the local dev server provided by JBrowse Jupyter.
track_data2 = 'http://localhost:8080/GRCh37_latest_genomic.sort.gff.gz'
track_data_index2 = 'http://localhost:8080/GRCh37_latest_genomic.sort.gff.gz.tbi'
hg19.add_track(track_data2, index=track_data_index2, track_id='jbrowse_dev_server_demo', name='jbrowse_dev_server_demo')
hg19.set_default_session(['jbrowse_dev_server_demo'],False)
You will be able to checkout your newly added tracks by opening the track selector. For more information on our embedded components https://jbrowse.org/storybook/lgv/v2.1.4/?path=/story/getting-started--page
# Uncomment the next line if you wish to see the tracks from both tutorials
hg19.set_default_session(['jupyter_server_demo', 'jbrowse_dev_server_demo'],False)
config = hg19.get_config()
launch(config, port=3232)
Issues with the JupyterDash proxy?
jupyterlab-dash
extension installed and you have pip installed jupyter_server_proxy
. If you get an error when installing it or after installing it, exit jupyter lab then run $ jupyter lab build
and run jupyter lab again.Issues with the PORT?
Issues with Jupyter Dash?
I am running this notebook in colab and can't access the files?
For other issues, please open a ticket on our repo or contact our gitter channel for more support
Report a bug or request a feature at https://github.com/GMOD/jbrowse-jupyter/issues Join our developers chat at https://gitter.im/GMOD/jbrowse2 Send an email to our mailing list at gmod-ajax@lists.sourceforge.net