igvteam / igv-notebook

Module for embedding igv.js in an IPython notebook
MIT License
59 stars 13 forks source link

issues with loading reference using absolute URLs #30

Open nettanetta opened 6 months ago

nettanetta commented 6 months ago

Hi, I tried to load reference files and bed tracks using URLs as explained in this example. However, nothing is presented. When I try to copy the example notebook it works fine. when I manually load the file to the IGV web app it also works fine.

my code: b = igv_notebook.Browser( { "reference": { "fastaURL": "https://files.cs.huji.ac.il/morani/Netta/ginger/atcc_aligners_comparison/genomes.fasta", "indexURL": "https://files.cs.huji.ac.il/morani/Netta/ginger/atcc_aligners_comparison/genomes.fasta.fai", }, "roi": [ { "name": "tblastn_protein_genes_to_genomes", "url": "https://files.cs.huji.ac.il/morani/Netta/ginger/atcc_aligners_comparison/blast/tblastn_protein_genes_to_genomes.tsv.bed", "indexed": False, }, { "name": "tblastn_protein_genes_to_genomes_nms", "url": "https://files.cs.huji.ac.il/morani/Netta/ginger/atcc_aligners_comparison/blast/tblastn_protein_genes_to_genomes.tsv.nms.bed", "indexed": False, } ] })

Can you help me understand what's wrong? thanks Netta

jrobinso commented 6 months ago

Can you describe in a little more detail what goes wrong? A screenshot might help. Also, check the console for errors in the devleoper tools of your web browser.

jrobinso commented 6 months ago

I think the root of the problem can be found in the console,

Access to XMLHttpRequest at 'https://files.cs.huji.ac.il/morani/Netta/ginger/atcc_aligners_comparison/genomes.fasta.fai' from origin 'http://localhost:8888' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. It appears the server (https://files.cs.huji.ac.il) does not support CORS requests, which is required for all javascript access on the web. This is fairly easy to configure on most servers, see https://github.com/igvteam/igv.js/wiki/Data-Server-Requirements for more details

A couple of other possible issues. Did you run igv_notebook.init() before other commands? This is required, it should be executed once. Secondly, you have not loaded any tracks in your example, only regions of interest (ROI). So there are no tracks to display. For more details on configuration see the igv.js documentation https://github.com/igvteam/igv.js/wiki