igvteam / igv.js

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

offset is outside the bounds of the DataView #1545

Closed Tong-Chen closed 2 years ago

Tong-Chen commented 2 years ago

Dear developers,

Thanks for this great tool.

I am using the latest igv.js (v2.12.6) released in 2022.Jun.

I am trying to load one large genome using igv.js. One popup box with information like offset is outside the bounds of the DataView *.gtf.gz is shown. Only loading genome works well.

This error is supposed to be caused by the GTF file. Here is the code for generating GTF index.

sort -k1,1 -k4,4n cper_sub.gtf | bgzip -c > cper.gtf.gz
tabix -p gff cper.gtf.gz

I have checked the maximum position in GTF file is 1,147,417,888 which is smaller than 2^31.

I wonder if you could kindly help me with what is wrong with this.

Thanks!

Chen Tong

Attachments:

Here is the genome.fa.fai file content (totally 7383 chromosomes/contigs, small contigs are not shown here):

chr1.1  1000000000      8       1000000000      1000000001
chr1.2  1364278061      1000000017      1364278061      1364278062
chr10.1 1000000000      2364278088      1000000000      1000000001
chr10.2 752849333       3364278098      752849333       752849334
chr11.1 1000000000      4117127441      1000000000      1000000001
chr11.2 650012615       5117127451      650012615       650012616
chr12.1 1000000000      5767140076      1000000000      1000000001
chr12.2 392452741       6767140086      392452741       392452742
chr2.1  1000000000      7159592836      1000000000      1000000001
chr2.2  1317450362      8159592845      1317450362      1317450363
chr3.1  1000000000      9477043216      1000000000      1000000001
chr3.2  1291775479      10477043225     1291775479      1291775480
chr4.1  1000000000      11768818713     1000000000      1000000001
chr4.2  1192534405      12768818722     1192534405      1192534406
chr5.1  1000000000      13961353136     1000000000      1000000001
chr5.2  1148190925      14961353145     1148190925      1148190926
chr6.1  1000000000      16109544079     1000000000      1000000001
chr6.2  1107674557      17109544088     1107674557      1107674558
chr7.1  1000000000      18217218654     1000000000      1000000001
chr7.2  1082167746      19217218663     1082167746      1082167747
chr8.1  1000000000      20299386418     1000000000      1000000001
chr8.2  1081484518      21299386427     1081484518      1081484519
chr9.1  1000000000      22380870954     1000000000      1000000001
chr9.2  1024734096      23380870963     1024734096      1024734097
tig00000026     127350  24405605073     127350  127351
tig00000069     62723   24405732437     62723   62724

Here are the error messages in the FIreFox console log

XML syntax error
position:xxxx.fa.fai
row 1,column 1: xxxx.fa.fai:1:1

RangeError: offset is outside the bounds of the DataView
    getVPointer binary.js:192
    parse bamIndex.js:85
    Vu bamIndex.js:18
    Vu indexFactory.js:37
    loadIndex featureFileReader.js:316
    getIndex featureFileReader.js:306
    readHeader featureFileReader.js:118
    getHeader textFeatureSource.js:114
    postInit featureTrack.js:117
    _loadTrack browser.js:836
    loadTrackList browser.js:766
    loadSessionObject browser.js:565
    createBrowser igv-create.js:77
    async* igv_cper.html:44
    EventListener.handleEvent* igv_cper.html:17
[browser.js:866:20](hxxxxx/browser.js)
    _loadTrack browser.js:866
    loadTrackList browser.js:766
    loadSessionObject browser.js:565
    createBrowser igv-create.js:77
    <anonymous> igv_cper.html:44
    (ASYNC:EventListener.handleEvent)
    <anonymous> igv_cper.html:17

XML parse error:syntax error
location:xxxx.fa
row 1,column 1:

Here is part of the GTF file:

chr10.1 transdecoder    exon    46594   48431   .       -       .       transcript_id "PtXG00010.1"; gene_id "PtXG00010";
chr10.1 transdecoder    transcript      46594   79431   .       -       .       transcript_id "PtXG00010.1"; gene_id "PtXG00010";
chr10.1 transdecoder    CDS     47614   48288   .       -       0       transcript_id "PtXG00010.1"; gene_id "PtXG00010";
chr10.1 maker   exon    49558   50031   .       +       .       transcript_id "PtXG00020.1"; gene_id "PtXG00020";
chr10.1 maker   transcript      49558   50031   2317    +       .       transcript_id "PtXG00020.1"; gene_id "PtXG00020";
chr10.1 maker   CDS     49573   49836   .       +       0       transcript_id "PtXG00020.1"; gene_id "PtXG00020";
chr10.1 transdecoder    exon    79141   79431   .       -       .       transcript_id "PtXG00010.1"; gene_id "PtXG00010";
chr10.1 transdecoder    exon    281372  282307  .       -       .       transcript_id "PtXG00030.1"; gene_id "PtXG00030";
chr10.1 transdecoder    exon    281372  282307  .       -       .       transcript_id "PtXG00030.2"; gene_id "PtXG00030";
chr10.1 transdecoder    exon    281372  282307  .       -       .       transcript_id "PtXG00030.3"; gene_id "PtXG00030";
chr10.1 transdecoder    transcript      281372  410530  .       -       .       transcript_id "PtXG00030.2"; gene_id "PtXG00030";
jrobinso commented 2 years ago

The tabix "tbi" index can handle postions up to 2^29 bases . For positions larger than this you must use the "csi" index. See the tabix documentation for more details.

Tong-Chen commented 2 years ago

Thanks! I ignored this. Problems solved.