igvteam / igv.js

Embeddable genomic visualization component based on the Integrative Genomics Viewer
MIT License
641 stars 229 forks source link

Some existing IGV pages fail with "Uncaught (in promise) TypeError: t.chromosomeOrder.split is not a function" #1761

Closed whoisthatdog closed 7 months ago

whoisthatdog commented 8 months ago

At some point the default genomes file at https://s3.amazonaws.com/igv.org.genomes/genomes.json was updated such that chromosomeOrder became a list rather than a string. This causes older versions of IGVjs (in my case, 2.5.2) to fail with the above error.

One of the great things about IGVjs is that I can send biologists self-contained HTML files with their data mapped to the genome. Unfortunately this error means that no existing file will work without updating the HTML - something that they will not know how to do. Can this change be rolled back?

jrobinso commented 8 months ago

This should be fixed now, give it a try.

jrobinso commented 8 months ago

@whoisthatdog BTW your application of igv.js sounds interesting, would you be willing to share more? Are you using igv-reports? You can respond, if you wish, to igv-team@broadinstitute.org. Thanks.

whoisthatdog commented 8 months ago

Thanks for the quick response. The files do work now, but it pops up this error dialog. Once cleared the browser seems fully functional.

Screen Shot 2024-02-05 at 5 25 19 PM

I'll follow up on the application over email, thanks.

jrobinso commented 8 months ago

That's curious, anything in the console log? Can you can provide me with a test html that reproduces this?

whoisthatdog commented 8 months ago

The console reports this:

Screen Shot 2024-02-05 at 6 18 41 PM

Here is a test file that reproduces it on my system. It does not appear with IGV version 2.15.11. Thanks much.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Human Oligo Design Map 2024-02-05</title>
    <script src='https://cdn.jsdelivr.net/npm/igv@2.5.2/dist/igv.min.js'></script>
</head>
<body>
<div id="igv", style="height: 500;">

</div>

<script>
    let igvDiv = document.getElementById('igv')

    const genome = 'hg38';

    let options = {
        genome: 'hg38',
        name: "Human (GRCh38/hg38)",
        fastaURL: "https://s3.amazonaws.com/igv.broadinstitute.org/genomes/seq/hg38/hg38.fa",
        indexURL: "https://s3.amazonaws.com/igv.broadinstitute.org/genomes/seq/hg38/hg38.fa.fai",
        cytobandURL: "https://s3.amazonaws.com/igv.org.genomes/hg38/annotations/cytoBandIdeo.txt.gz",
        showKaryo: true,
        locus: 'GAPDH',
        trackDefaults: {
            annotation: {
                autoHeight: true
            }
        },
        tracks: [
            {
                name: "Gencode v28",
                type:'annotation',
                nameField:'transcript_id',
                format: "gtf",
                url: "https://s3.amazonaws.com/igv.org.genomes/hg38/annotations/gencode.v28.basic.annotation.sorted.gtf.gz",
                indexURL: "https://s3.amazonaws.com/igv.org.genomes/hg38/annotations/gencode.v28.basic.annotation.sorted.gtf.gz.tbi",
                visibilityWindow: -1,
                removable: true,
                order: 99999
            },
            {
                name: "Controls",
                order: 10,
                features: [
                    {'chr':'chr12','start':6537775,'end':6537795,'name':'GAPDH ASO','score':0,'strand':'-','exons':[{'start':6537775,'end':6537795}]}
                ],
                displayMode: "EXPANDED",
                format: "gtf"
            }
        ]
    }

    igv.createBrowser(igvDiv, options)
        .then(function (browser) {

        })

</script>
</body>
</html>
jrobinso commented 8 months ago

Ahh, yes that error is a particular problem with the refseq annotations for hg38. It should be fixed soon, its a data file problem. See https://github.com/igvteam/igv/issues/1482