Skip to content

Commit

Permalink
Update examples and README
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Apr 22, 2022
1 parent f3aa66e commit 3de79e4
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 138 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/igvteam/juicebox-notebook/main?filepath=examples) _**Jupyter Notebook**_

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/igvteam/juicebox-notebook/main?urlpath=lab/tree/examples) _**JupyterLab**_
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/igvteam/juicebox-notebook/main?urlpath=lab/tree/examples/RemoteFiles.ipynb) _**JupyterLab**_

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1oLrDItsMZAEQmrsXa9A7MiiMjar0aagW?usp=sharing)

Expand Down
57 changes: 0 additions & 57 deletions examples/ConfigureResolutionAndNormalization.ipynb

This file was deleted.

74 changes: 10 additions & 64 deletions examples/LocalFilePaths.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example of loading a map and track from local files.\n",
"## Example of loading a map from a local file.\n",
"\n",
"**Note: To use update the 2 \"url\" fields to local file paths**"
"**Jupyter Notebook and Colab only -- will not work with JupyterLab.**\n",
"\n",
"**Note: To use download the test file below and update \"path\" to the local file absolute path**\n",
"\n",
"```https://s3.amazonaws.com/igv.org.test/data/hic/HCT-116_Cohesin_Loss.hic```"
]
},
{
Expand All @@ -15,14 +19,7 @@
"metadata": {},
"outputs": [],
"source": [
"pip install juicebox-notebook"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Load a map and track in the intial config"
"pip install juicebox-notebook\n"
]
},
{
Expand All @@ -42,63 +39,12 @@
"b = juicebox_notebook.Browser(\n",
" {\n",
" \"name\": \"GM12878\",\n",
" \"path\": \"/Volumes/GoogleDrive/Shared drives/IGV/TestData/juicebox/HCT-116_Untreated.hic\",\n",
" \"tracks\": [\n",
" {\n",
" \"path\": \"/Volumes/GoogleDrive/Shared drives/IGV/TestData/juicebox/CTCF_Untreated.bw\",\n",
" \"type\": \"wig\",\n",
" \"name\": \"CTCF\",\n",
" \"color\": \"rgb(22, 129, 198)\"\n",
" }\n",
" ]\n",
" \"path\": \"/your/local/path/HCT-116_Untreated.hic\"\n",
" }\n",
"\n",
")\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"### Load a map and track dynamically"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import juicebox_notebook\n",
"\n",
"juicebox_notebook.init()\n",
"\n",
"b = juicebox_notebook.Browser({})\n",
"\n",
"b.load_map({\n",
" \"name\": \"GM12878\",\n",
" \"path\": \"/Volumes/GoogleDrive/Shared drives/IGV/TestData/juicebox/HCT-116_Untreated.hic\"\n",
"})\n",
"\n",
"b.load_track({\n",
" \"path\": \"/Volumes/GoogleDrive/Shared drives/IGV/TestData/juicebox/CTCF_Untreated.bw\",\n",
" \"type\": \"wig\",\n",
" \"name\": \"CTCF\",\n",
" \"color\": \"rgb(22, 129, 198)\"\n",
"})\n"
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -122,4 +68,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
155 changes: 140 additions & 15 deletions examples/RemoteFiles.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"**Install juicebox-notebook**"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -13,6 +24,88 @@
"pip install juicebox-notebook"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"**Load map and tracks during Browser initialization**"
]
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"import juicebox_notebook\n",
"\n",
"juicebox_notebook.init()\n",
"\n",
"b = juicebox_notebook.Browser({\n",
" \"url\": \"https://www.encodeproject.org/files/ENCFF718AWL/@@download/ENCFF718AWL.hic\",\n",
" \"name\": \"GM12878\",\n",
" \"locus\": \"ace\",\n",
" \"normalization\": \"VC_SQRT\",\n",
" \"resolution\": \"25000\",\n",
" \"tracks\": [{\n",
" \"url\": \"https://www.encodeproject.org/files/ENCFF000ARJ/@@download/ENCFF000ARJ.bigWig\",\n",
" \"name\": \"CTCF\",\n",
" \"color\": \"#ff8802\"\n",
" }]\n",
" })\n"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "markdown",
"source": [
"**Load map and tracks dynamically**"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"import juicebox_notebook\n",
"\n",
"juicebox_notebook.init()\n",
"\n",
"b = juicebox_notebook.Browser({})\n",
"\n",
"b.load_map({\n",
" \"url\": \"https://www.encodeproject.org/files/ENCFF718AWL/@@download/ENCFF718AWL.hic\",\n",
" \"name\": \"GM12878\"\n",
"})\n",
"\n",
"b.load_track_list(\n",
" [{\n",
" \"url\": \"https://www.encodeproject.org/files/ENCFF000ARJ/@@download/ENCFF000ARJ.bigWig\",\n",
" \"name\": \"CTCF\",\n",
" \"color\": \"#ff8802\"\n",
" }]\n",
")\n",
"\n",
"\n"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -29,24 +122,56 @@
"\n",
"b = juicebox_notebook.Browser({})\n",
"\n",
"b.load_map(\n",
" {\n",
" \"url\": \"https://www.encodeproject.org/files/ENCFF179HVU/@@download/ENCFF179HVU.hic\"\n",
" }\n",
"b.load_map({\n",
" \"url\": \"https://www.encodeproject.org/files/ENCFF718AWL/@@download/ENCFF718AWL.hic\",\n",
" \"name\": \"GM12878\"\n",
"})\n",
"\n",
"b.load_track_list(\n",
" [{\n",
" \"url\": \"https://www.encodeproject.org/files/ENCFF000ARJ/@@download/ENCFF000ARJ.bigWig\",\n",
" \"name\": \"CTCF\",\n",
" \"color\": \"#ff8802\"\n",
" }]\n",
")\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Load map and tracks dynamically**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"import juicebox_notebook\n",
"\n",
"juicebox_notebook.init()\n",
"\n",
"b = juicebox_notebook.Browser({})\n",
"\n",
"b.load_map({\n",
" \"url\": \"https://www.encodeproject.org/files/ENCFF718AWL/@@download/ENCFF718AWL.hic\",\n",
" \"name\": \"GM12878\"\n",
"})\n",
"\n",
"b.load_track_list(\n",
" [\n",
" {\n",
" \"url\": \"https://www.encodeproject.org/files/ENCFF000ARJ/@@download/ENCFF000ARJ.bigWig\",\n",
" \"name\": \"CTCF\",\n",
" \"color\": \"#ff8802\"\n",
" },\n",
" {\n",
" \"url\": \"https://hicfiles.s3.amazonaws.com/hiseq/nhek/in-situ/combined_blocks.txt\",\n",
" \"name\": \"Rao & Huntley et al. | Cell 2014 | NHEK combined domains\"\n",
" }\n",
" ]\n",
" [{\n",
" \"url\": \"https://www.encodeproject.org/files/ENCFF000ARJ/@@download/ENCFF000ARJ.bigWig\",\n",
" \"name\": \"CTCF\",\n",
" \"color\": \"#ff8802\"\n",
" }]\n",
")\n",
"\n",
"\n"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(name='juicebox-notebook',
packages=['juicebox_notebook'],
version='0.2.0',
version='0.2.1',
description='Package for embedding the juicebox.js hic visualization in IPython notebooks',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 3de79e4

Please sign in to comment.