-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
igv.js and Jupyter notebooks? #222
Comments
Not to my knowledge. Will keep this open and take it as a request. Happy to entertain a pull request. |
Resolved, see https://github.com/igvteam/igv.js-jupyter |
@paul-shannon Old thread, but are you using igv.js in a Jupyter workbook? I don't think it works any longer. I've been trying to learn enough to bring it up to date but I can't even get the official widget cookie-cutter code to work. So I'm not optimistic. |
Jim,
I switched from Jupyter to shiny last spring. But I ought to be able to resurrect the ipywidget wrapper for igv.js. I have some time to spare next week. Shall I give it a try, offer the code if it works?
- Paul
… On Dec 19, 2018, at 4:39 PM, Jim Robinson ***@***.***> wrote:
@paul-shannon Old thread, but are you using igv.js in a Jupyter workbook? I don't think it works dgany longer. I've been trying to learn enough to bring it up to date but I can't even get the official widget cookie-cutter code to work. So I'm not optimistic.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Don't spend any time on it but the code might be instructive, doesn't have to work. I actually did get our project working, I had configuration problems. |
Here’s what worked last February: https://github.com/paul-shannon/ipyTrenaViz
There’s a makefile in the root directory that includes this build target:
buildWidget:
(cd ./js; npm update)
(cd ./js; webpack --config webpack.config.js)
pip install -e .
jupyter nbextension install --user --py ipyTrenaViz
jupyter nbextension enable --user --py --sys-prefix ipyTrenaViz
A complicated procedure, for sure. The net result is notebook widget with multiple jQuery tabs, one of which embeds igv.js
- Paul
… On Dec 20, 2018, at 7:37 AM, Jim Robinson ***@***.***> wrote:
Don't spend any time on it but the code might be instructive, doesn't have to work. I actually did get our project working, I had configuration problems.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks. Complicated procedures seem to be the bread and butter of Jupyter
nbextension development. To do it well one needs to be an expert in
python, conda and pip, modern javascript, backbone.js, node, NPM, and
webpack.
My goals are modest, to update to the latest IGV release, clean up and
"pythonify" the code, and add some documentation. I probably don't have
time to learn backbone and make a proper widget, and I don't think its
needed as igv.js does not need to control the backend python.
On Thu, Dec 20, 2018 at 7:58 AM Paul Shannon <[email protected]>
wrote:
… Here’s what worked last February:
https://github.com/paul-shannon/ipyTrenaViz
There’s a makefile in the root directory that includes this build target:
buildWidget:
(cd ./js; npm update)
(cd ./js; webpack --config webpack.config.js)
pip install -e .
jupyter nbextension install --user --py ipyTrenaViz
jupyter nbextension enable --user --py --sys-prefix ipyTrenaViz
A complicated procedure, for sure. The net result is notebook widget with
multiple jQuery tabs, one of which embeds igv.js
- Paul
> On Dec 20, 2018, at 7:37 AM, Jim Robinson ***@***.***>
wrote:
>
> Don't spend any time on it but the code might be instructive, doesn't
have to work. I actually did get our project working, I had configuration
problems.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#222 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA49HAzQ6q3CyTfZsZzWEwIMYkvK8qvFks5u67OzgaJpZM4JRIgV>
.
|
Maybe I misunderstand “does not need to control the backend python”?
For what may be a tiny counter-example - or maybe it just illustrates my confusion :} - I find it useful to be able to query igv.js, from python but now especially in R shiny apps, for the current region. Or to ask, from python or R, for igv to display a region, add or remove a track. So back-and-forth communication between the python or R, and igv.js has been very helpful.
However, I suspect I misunderstand!
… On Dec 20, 2018, at 8:02 AM, Jim Robinson ***@***.***> wrote:
Thanks. Complicated procedures seem to be the bread and butter of Jupyter
nbextension development. To do it well one needs to be an expert in
python, conda and pip, modern javascript, backbone.js, node, NPM, and
webpack.
My goals are modest, to update to the latest IGV release, clean up and
"pythonify" the code, and add some documentation. I probably don't have
time to learn backbone and make a proper widget, and I don't think its
needed as igv.js does not need to control the backend python.
On Thu, Dec 20, 2018 at 7:58 AM Paul Shannon ***@***.***>
wrote:
> Here’s what worked last February:
> https://github.com/paul-shannon/ipyTrenaViz
>
> There’s a makefile in the root directory that includes this build target:
>
>
> buildWidget:
> (cd ./js; npm update)
> (cd ./js; webpack --config webpack.config.js)
> pip install -e .
> jupyter nbextension install --user --py ipyTrenaViz
> jupyter nbextension enable --user --py --sys-prefix ipyTrenaViz
>
>
> A complicated procedure, for sure. The net result is notebook widget with
> multiple jQuery tabs, one of which embeds igv.js
>
> - Paul
>
> > On Dec 20, 2018, at 7:37 AM, Jim Robinson ***@***.***>
> wrote:
> >
> > Don't spend any time on it but the code might be instructive, doesn't
> have to work. I actually did get our project working, I had configuration
> problems.
> >
> > —
> > You are receiving this because you were mentioned.
> > Reply to this email directly, view it on GitHub, or mute the thread.
> >
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <#222 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AA49HAzQ6q3CyTfZsZzWEwIMYkvK8qvFks5u67OzgaJpZM4JRIgV>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi Paul, our current extension, as you know, supports python -> igv.js communication, but not the other way. How do you query igv.js for the current region in trenaviz? |
When I worked this out for igvShiny there was not yet a javascript API in igv.js to query the current region. So (maybe even with advice from you) I did it this way:
This then shows up in R as For igvR the locusChange event sets javascript global state which R can later query via the websocket communication channel upon which igvR depends. |
I see. I need something simple to build and maintain and am trying to avoid backbone and importing ipywidgets, partly because I have too many projects to contemplate learning and then supporting that. However, I just discovered a simple way to do this with just javascript and core jupyter, this works beautifully from a cell, so its promising.
|
Nice solution! |
This also looks promising, maybe a little less of a hack: https://jupyter-notebook.readthedocs.io/en/stable/comms.html |
Has anyone wrapped up igv.js as an ipython widget, for use in Jupyter notebooks?
The text was updated successfully, but these errors were encountered: