g2nb / igv-jupyter

Extension for Jupyter which integrates igv.js
MIT License
154 stars 13 forks source link

how would I actually view the plot? #4

Closed KhagayN closed 8 years ago

KhagayN commented 8 years ago

I'm able to run this code from the example but, how would I go about viewing the plot?

# Define IGV.js instance from igv import IGV, Reference, Track

IGV(locus="chr12:98,997,292-98,997,392", reference=Reference(id="hg19"), tracks=[ Track(name="Genes", format="bed", url="//s3.amazonaws.com/igv.broadinstitute.org/annotations/hg19/genes/gencode.v18.collapsed.bed", display_mode="EXPANDED"), Track(name="Brain (BodyMap)", format="bam", url="//data.broadinstitute.org/igvdata/BodyMap/hg19/IlluminaHiSeq2000_BodySites/brain_merged/accepted_hits.bam")])

turner commented 8 years ago

Each notebook is composed of executable cells. To execute (run) a cell 1) select it (a left hand blue border appears to indicate selection) 2) click the play button (or shift-enter)

Here is a screen shot of the play button.

foo

Here is a screen shot of API Examples notebook where I have selected the first cell. screen shot 2016-09-01 at 1 19 56 pm

KhagayN commented 8 years ago

Thank you for the quick reply! Unfortunately, I followed your instructions and a plot still does not appear.

screen shot 2016-09-01 at 1 38 33 pm

turner commented 8 years ago

Can you run any notebooks in Jupyter?

KhagayN commented 8 years ago

Yes, I can run certain lab analyses in Jupyter notebooks

tmtabor commented 8 years ago

One possibility is that you haven't enabled the nbextension yet. Assuming that you've installed the igv python package, if you go to your command line and run the following two commands, it will enable support for the plots in the notebook environment. (More info on the README.)

jupyter nbextension install --py igv

jupyter nbextension enable --py igv

KhagayN commented 8 years ago

screen shot 2016-09-01 at 1 53 52 pm

I have installed/enabled it. The image is the output after running jupyter nbextension list

tmtabor commented 8 years ago

That would be why the plot is not displaying. The real question is why the nbextension isn't validating.

You might want to check your nbextension path just to make sure that the igv-jupyter.js file actually copied there successfully during installation. In my personal experience, I occasionally have trouble installing nbextensions due to file permission issues copying the file over in the first place.

On a Mac nbextensions will usually be installed to ~/Library/Jupyter/nbextensions/ or /usr/local/share/jupyter/nbextensions/. On Linux it's going to vary by distribution.

jrobinso commented 8 years ago

Hi @KhagayN , were you able to resolve your problem?

KhagayN commented 8 years ago

Yes @jrobinso. I had to contact people who had admin privileges to enable the extension. After that, I was able to load and use the package! Thanks for the help!