-
Notifications
You must be signed in to change notification settings - Fork 13
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
Option to allow SVG output #6
Comments
I am guessing you want to get the SVG on the python (server) side, correct? For which platform (Notebook, Lab, Colab). The client-server messaging options are different for each. |
@jrobinso thanks for responding! Yes, I'm trying to get the SVG on the python side and I'm using Jupyter Notebook as the platform. |
Yes I think this can be supported for Notebook and possibly Colab, but not for JupyterLab. Not in this project anyway. Leave this open, I will get to it when I can. |
Its tricky because this will be asyncronous, the SVG will need to be returned to python via a "comm" message unless you know another way. However I think in python we'll want to make it appear synchronous so we can write something like
My idea right now is to poll until the comm message with the svg is received, with a timeout of a second or two. If you have other ideas please post them here. |
Hi Jim, I think your idea to SVG appear synchronous makes sense. I currently don't know what other ways to get the SVG.. Related to SVG output, one feature that would be potentially nice to have is to have igv-notebook directly generates the SVG without having to render the browser and load alignments/annotations inside the Notebook. This would make sense if users need to generate large amount of IGV screenshots for many samples (Traditionally people have to use Shunhua |
I'm not sure that's possible, well anything is possible but would be a substantial amount of work. What you see is dependent on the DOM, which the browser renders. BTW the equivalent is not possible with IGV either, you need a graphics system to render IGV to get screenshots. Some people use a virtual X emulator, but still from IGV's perspective it is rendered in a window. |
@jrobinso Thanks for the explanation! I guess I should use this package in Jupyter Notebook to render a small set of IGV pileups instead of trying to do large amount of samples to maintain reasonable memory usage. |
I'm not sure notebooks + igv.js is going to be a good platform for doing
large numbers of pileups in an automated way, the asynchronous nature of
data loading and rendering is going to be an issue for one thing.
…On Wed, May 4, 2022 at 5:21 PM Shunhua Han ***@***.***> wrote:
@jrobinso <https://github.com/jrobinso> Thanks for the explanation! I
guess I should use this package in Jupyter Notebook to render a small set
of IGV pileups instead of trying to do large amount of samples to maintain
reasonable memory usage.
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHD2HHZTBOMSLIXUU7F24TVIMIAXANCNFSM5U5IYL2A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
For example, assume "get_svg" were available, if you call it immediately
after creating the igv instance you will get nothing or a blank svg since
nothing has been rendered yet. This could be problematic.
On Wed, May 4, 2022 at 6:11 PM James Robinson ***@***.***>
wrote:
… I'm not sure notebooks + igv.js is going to be a good platform for doing
large numbers of pileups in an automated way, the asynchronous nature of
data loading and rendering is going to be an issue for one thing.
On Wed, May 4, 2022 at 5:21 PM Shunhua Han ***@***.***>
wrote:
> @jrobinso <https://github.com/jrobinso> Thanks for the explanation! I
> guess I should use this package in Jupyter Notebook to render a small set
> of IGV pileups instead of trying to do large amount of samples to maintain
> reasonable memory usage.
>
> —
> Reply to this email directly, view it on GitHub
> <#6 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAHD2HHZTBOMSLIXUU7F24TVIMIAXANCNFSM5U5IYL2A>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
@jrobinso I see, thanks for explaining the asynchronous issue in more details! In this case I might need to think of alternative strategies if I want to generate large numbers of pileups automatically. Please feel free to close this SVG output request. |
Yes, I didn't consider that myself at first I just realized it when working on this. igv.js is designed for user interaction, not serial blocking execution, which is at the root of this problem. IGV desktop goes into a special mode when running batch scripts where the UI is locked and everything is synchronous. There is already a python project for creating batch screenshots from IGV desktop, this project could perhaps be used from notebooks. The project is here: https://github.com/stevekm/IGV-snapshot-automator |
Hi,
Thanks for creating this amazing python package! I'm trying to figure out ways automate generating IGV screenshots using igv-notebook and seems like it lacks the SVG output option (currently I need to manually right click the navigator panel to output SVG). I wonder if it's possible that you could enable an option to convert browser content to SVG/PNG format (https://github.com/igvteam/igv.js/wiki/Browser-API-2.0#tosvg)?
Thanks,
Shunhua
The text was updated successfully, but these errors were encountered: