Skip to content

Commit

Permalink
fix example notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Jan 19, 2019
1 parent f1dbf55 commit b36548b
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 40 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Requirements:

```bash
pip install igv
jupyter nbextensioninstall --py igv
jupyter nbextension enable --py igv
```

## Usage
Expand Down Expand Up @@ -155,7 +157,7 @@ b.search('myc')

### SVG output

Saving the current IGV view as an SVG image requires to calls.
Saving the current IGV view as an SVG image requires two calls.

```python
b.get_svg()
Expand Down
49 changes: 22 additions & 27 deletions examples/BamFiles.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -11,7 +11,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -25,9 +25,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<div id=\"igv_4433498\" class=\"igv-js\"></div>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"b.show()"
]
Expand All @@ -48,24 +61,6 @@
" })\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"b.get_svg()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"b.display_svg()"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -78,21 +73,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "python2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.15"
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
Expand Down
18 changes: 18 additions & 0 deletions examples/Embeded-DataURI.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,24 @@
"b.search(\"CIC--DUX4:10,796-10,844\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"b.get_svg()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"b.display_svg()"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
28 changes: 23 additions & 5 deletions examples/LocalFiles.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,43 @@
"source": [
"b.zoom_out()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"b.get_svg()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"b.display_svg()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 2",
"language": "python",
"name": "python3"
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"pygments_lexer": "ipython2",
"version": "2.7.15"
}
},
"nbformat": 4,
Expand Down
25 changes: 25 additions & 0 deletions examples/RemoteFiles.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,31 @@
"source": [
"b.zoom_out()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"b.get_svg()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"b.display_svg()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
3 changes: 0 additions & 3 deletions igv/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ def load_track(self, track):
# Check for minimal igv.js requirements (the only required field for all tracks is url, which must be a string)
if isinstance(track, dict) == False:
raise Exception("track parameter must be a dictionary")
if "url" not in track:
raise Exception("track dictionary must contain a 'url' field")


return self._send({
"id": self.igv_id,
Expand Down
2 changes: 1 addition & 1 deletion igv/static/extension.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(
["/nbextensions/igv/igvjs/igv.min.js"],
["/nbextensions/igv/igvjs/igv.js"],
//["https://cdn.jsdelivr.net/npm/[email protected]/dist/igv.min.js"],
function (igv) {

Expand Down
2 changes: 0 additions & 2 deletions igv/static/igvjs/igv.min.js

This file was deleted.

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='igv',
packages=['igv'],
version='0.9.2',
version='0.9.4',
description='Jupyter extension for embedding the genome visualation igv.js in a notebook',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit b36548b

Please sign in to comment.