igvteam / igv.js

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

"data.splitLines is not a function" - using search on Rhodobacter sphaeroides gff file #673

Closed paul-shannon closed 6 years ago

paul-shannon commented 6 years ago

Delighted to discover the ease with which a gff.gz and gff.gz.tbi can be added to the latest igv.js, for what to me is a new organism, setting up the track like this:

type: "annotation",
nameField: "gene",
url: "http://trena.systemsbiology.net/rhos/GCF_000012905.2_ASM1290v2_genomic.gff.gz",
indexURL: "http://trena.systemsbiology.net/rhos/GCF_000012905.2_ASM1290v2_genomic.gff.gz.tbi",
format: 'gtf',
searchable: 'true',

and seeing gene names nicely displayed in EXPANDED displayMode, I nonetheless ran into this error

igv.js:31531 Uncaught TypeError: data.splitLines is not a function
    at parseSearchResults (igv.js:31531)
    at processSearchResult (igv.js:31358)
    at igv.js:31259
    at Array.forEach (<anonymous>)
    at igv.Browser.createGenomicStateList (igv.js:31253)
    at igv.Browser.search (igv.js:31162)

after entering one of the displayed gene names ("atpA") into the search box.

image

jrobinso commented 6 years ago

I will track this down and fix it, however you really cannot do a useful search on an indexed track. The search on track features is on the features loaded into memory. With an index this will be just what's in view. I realize that is the case here, but if the gene were somewhere else in the genome it would not be found.

The doc states that this field does not work for indexed files, meaning files with a tabix (.tbi) or tribble (.idx) index.

On Sat, Jun 2, 2018 at 10:09 AM, Paul Shannon notifications@github.com wrote:

Delighted to discover the ease with which a gff.gz and gff.gz.tbi can be added to the latest igv.js, for what to me is a new organism, setting up the track like this:

type: "annotation", nameField: "gene", url: "http://trena.systemsbiology.net/rhos/GCF_000012905.2_ASM1290v2_genomic.gff.gz", indexURL: "http://trena.systemsbiology.net/rhos/GCF_000012905.2_ASM1290v2_genomic.gff.gz.tbi", format: 'gtf', searchable: 'true',

and seeing gene names nicely displayed in EXPANDED displayMode, I nonetheless ran into this error

igv.js:31531 Uncaught TypeError: data.splitLines is not a function at parseSearchResults (igv.js:31531) at processSearchResult (igv.js:31358) at igv.js:31259 at Array.forEach () at igv.Browser.createGenomicStateList (igv.js:31253) at igv.Browser.search (igv.js:31162)

after entering one of the displayed gene names ("atpA") into the search box.

[image: image] https://user-images.githubusercontent.com/2480712/40877311-bf443ad4-6633-11e8-8f2d-823645ad0a6e.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673, or mute the thread https://github.com/notifications/unsubscribe-auth/AA49HCzDKlbhGCEJwZMv-t3m6z2pUdF0ks5t4pyfgaJpZM4UXs6U .

paul-shannon commented 6 years ago

Thanks, Jim. Sorry I failed to grasp that (now fairly obvious) point.

Is it good practice therefore to use a full, uncompressed gtf|gff annotation file for search?

On Jun 2, 2018, at 1:44 PM, Jim Robinson notifications@github.com wrote:

I will track this down and fix it, however you really cannot do a useful search on an indexed track. The search on track features is on the features loaded into memory. With an index this will be just what's in view. I realize that is the case here, but if the gene were somewhere else in the genome it would not be found.

The doc states that this field does not work for indexed files, meaning files with a tabix (.tbi) or tribble (.idx) index.

On Sat, Jun 2, 2018 at 10:09 AM, Paul Shannon notifications@github.com wrote:

Delighted to discover the ease with which a gff.gz and gff.gz.tbi can be added to the latest igv.js, for what to me is a new organism, setting up the track like this:

type: "annotation", nameField: "gene", url: "http://trena.systemsbiology.net/rhos/GCF_000012905.2_ASM1290v2_genomic.gff.gz", indexURL: "http://trena.systemsbiology.net/rhos/GCF_000012905.2_ASM1290v2_genomic.gff.gz.tbi", format: 'gtf', searchable: 'true',

and seeing gene names nicely displayed in EXPANDED displayMode, I nonetheless ran into this error

igv.js:31531 Uncaught TypeError: data.splitLines is not a function at parseSearchResults (igv.js:31531) at processSearchResult (igv.js:31358) at igv.js:31259 at Array.forEach () at igv.Browser.createGenomicStateList (igv.js:31253) at igv.Browser.search (igv.js:31162)

after entering one of the displayed gene names ("atpA") into the search box.

[image: image] https://user-images.githubusercontent.com/2480712/40877311-bf443ad4-6633-11e8-8f2d-823645ad0a6e.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673, or mute the thread https://github.com/notifications/unsubscribe-auth/AA49HCzDKlbhGCEJwZMv-t3m6z2pUdF0ks5t4pyfgaJpZM4UXs6U .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jrobinso commented 6 years ago

Yes, but it can't be too large. I would suggest stripping out all the non-essential parts (CDS, exon, etc) to create a small track to load just for searching. In fact it would be a good idea to add an option for a non-visible track. Then load the full gff/gtf separately as an indexed file.

I'm still uncertain what is causing the bug you referenced, that will need fixed before any of this works.

On Sat, Jun 2, 2018 at 5:13 PM, Paul Shannon notifications@github.com wrote:

Thanks, Jim. Sorry I failed to grasp that (now fairly obvious) point.

Is it good practice therefore to use a full, uncompressed gtf|gff annotation file for search?

  • Paul

On Jun 2, 2018, at 1:44 PM, Jim Robinson notifications@github.com wrote:

I will track this down and fix it, however you really cannot do a useful search on an indexed track. The search on track features is on the features loaded into memory. With an index this will be just what's in view. I realize that is the case here, but if the gene were somewhere else in the genome it would not be found.

The doc states that this field does not work for indexed files, meaning files with a tabix (.tbi) or tribble (.idx) index.

On Sat, Jun 2, 2018 at 10:09 AM, Paul Shannon notifications@github.com wrote:

Delighted to discover the ease with which a gff.gz and gff.gz.tbi can be added to the latest igv.js, for what to me is a new organism, setting up the track like this:

type: "annotation", nameField: "gene", url: "http://trena.systemsbiology.net/rhos/GCF_000012905.2_ ASM1290v2_genomic.gff.gz", indexURL: "http://trena.systemsbiology.net/rhos/GCF_000012905.2_ ASM1290v2_genomic.gff.gz.tbi", format: 'gtf', searchable: 'true',

and seeing gene names nicely displayed in EXPANDED displayMode, I nonetheless ran into this error

igv.js:31531 Uncaught TypeError: data.splitLines is not a function at parseSearchResults (igv.js:31531) at processSearchResult (igv.js:31358) at igv.js:31259 at Array.forEach () at igv.Browser.createGenomicStateList (igv.js:31253) at igv.Browser.search (igv.js:31162)

after entering one of the displayed gene names ("atpA") into the search box.

[image: image] https://user-images.githubusercontent.com/2480712/ 40877311-bf443ad4-6633-11e8-8f2d-823645ad0a6e.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673, or mute the thread https://github.com/notifications/unsubscribe- auth/AA49HCzDKlbhGCEJwZMv-t3m6z2pUdF0ks5t4pyfgaJpZM4UXs6U .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673#issuecomment-394117535, or mute the thread https://github.com/notifications/unsubscribe-auth/AA49HFMk6L3LHxu6Ix9yq8SsvShkHSpDks5t4wANgaJpZM4UXs6U .

paul-shannon commented 6 years ago

If indexed files do not support search - for those regions not currently in memory - could you explain why gene symbol search works flawlessly with this configuration? Sorry to be slow on the uptake…

On Jun 2, 2018, at 2:28 PM, Jim Robinson notifications@github.com wrote:

I will track this down and fix it, however you really cannot do a useful search on an indexed track. The search on track features is on the features loaded into memory. With an index this will be just what's in view. I realize that is the case here, but if the gene were somewhere else in the genome it would not be found.

The doc states that this field does not work for indexed files, meaning files with a tabix (.tbi) or tribble (.idx) index.

jrobinso commented 6 years ago

Gene search works on some common genomes because it uses our web service. It is possible to configure your own webservice to do this, see https://github.com/igvteam/igv.js/wiki/Browser-Configuration-2.0 (scroll to the bottom).

On Wed, Jun 6, 2018 at 10:30 AM, Paul Shannon notifications@github.com wrote:

If indexed files do not support search - for those regions not currently in memory - could you explain why gene symbol search works flawlessly with this configuration? Sorry to be slow on the uptake…

  • Paul

options = {locus: "MEF2C", minimumBases: 5, showRuler: true, reference: {id: "hg38", fastaURL: "https://s3.amazonaws.com/igv.broadinstitute.org/genomes/ seq/hg38/hg38.fa", cytobandURL: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/cytoBandIdeo.txt" }, tracks: [ {name: 'Gencode v24', url: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/genes/gencode.v24.annotation.sorted.gtf.gz", indexURL: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/genes/gencode.v24.annotation.sorted.gtf.gz.tbi", format: 'gtf', visibilityWindow: 2000000, displayMode: 'EXPANDED' }, ] }; // options

On Jun 2, 2018, at 2:28 PM, Jim Robinson notifications@github.com wrote:

I will track this down and fix it, however you really cannot do a useful search on an indexed track. The search on track features is on the features loaded into memory. With an index this will be just what's in view. I realize that is the case here, but if the gene were somewhere else in the genome it would not be found.

The doc states that this field does not work for indexed files, meaning files with a tabix (.tbi) or tribble (.idx) index.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673#issuecomment-395089122, or mute the thread https://github.com/notifications/unsubscribe-auth/AA49HNtryKbh5vp3Zp8gjxpilqXAlf2Fks5t5-d8gaJpZM4UXs6U .

paul-shannon commented 6 years ago

Thanks, Jim. Good solution - but perhaps rather than maintain web services for species we might be interested, I’d be interested instead in the possible “invisible track” you mentioned. Could this go on the requested features list?

jrobinso commented 6 years ago

Yes, what should the property be?

visible: false

invisible: true

hide: true

displayMode: hide (in addition to squish/collapse/expand).

I'm being really lazy.

On Thu, Jun 7, 2018 at 8:08 PM, Paul Shannon notifications@github.com wrote:

Thanks, Jim. Good solution - but perhaps rather than maintain web services for species we might be interested, I’d be interested instead in the possible “invisible track” you mentioned. Could this go on the requested features list?

  • Paul

On Jun 7, 2018, at 7:00 AM, Jim Robinson notifications@github.com wrote:

Gene search works on some common genomes because it uses our web service. It is possible to configure your own webservice to do this, see https://github.com/igvteam/igv.js/wiki/Browser-Configuration-2.0 (scroll to the bottom).

On Wed, Jun 6, 2018 at 10:30 AM, Paul Shannon notifications@github.com wrote:

If indexed files do not support search - for those regions not currently in memory - could you explain why gene symbol search works flawlessly with this configuration? Sorry to be slow on the uptake…

  • Paul

options = {locus: "MEF2C", minimumBases: 5, showRuler: true, reference: {id: "hg38", fastaURL: "https://s3.amazonaws.com/igv.broadinstitute.org/genomes/ seq/hg38/hg38.fa", cytobandURL: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/cytoBandIdeo.txt" }, tracks: [ {name: 'Gencode v24', url: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/genes/gencode.v24.annotation.sorted.gtf.gz", indexURL: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/genes/gencode.v24.annotation.sorted.gtf.gz.tbi", format: 'gtf', visibilityWindow: 2000000, displayMode: 'EXPANDED' }, ] }; // options

On Jun 2, 2018, at 2:28 PM, Jim Robinson notifications@github.com wrote:

I will track this down and fix it, however you really cannot do a useful search on an indexed track. The search on track features is on the features loaded into memory. With an index this will be just what's in view. I realize that is the case here, but if the gene were somewhere else in the genome it would not be found.

The doc states that this field does not work for indexed files, meaning files with a tabix (.tbi) or tribble (.idx) index.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673#issuecomment-395089122, or mute the thread https://github.com/notifications/unsubscribe-auth/ AA49HNtryKbh5vp3Zp8gjxpilqXAlf2Fks5t5-d8gaJpZM4UXs6U .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673#issuecomment-395604117, or mute the thread https://github.com/notifications/unsubscribe-auth/AA49HGO3fUZEMGVZgrrEbzAHumne2sz-ks5t6cBtgaJpZM4UXs6U .

paul-shannon commented 6 years ago

hidden: false // the default

How’s that?

On Jun 7, 2018, at 6:36 PM, Jim Robinson notifications@github.com wrote:

Yes, what should the property be?

visible: false

invisible: true

hide: true

displayMode: hide (in addition to squish/collapse/expand).

I'm being really lazy.

On Thu, Jun 7, 2018 at 8:08 PM, Paul Shannon notifications@github.com wrote:

Thanks, Jim. Good solution - but perhaps rather than maintain web services for species we might be interested, I’d be interested instead in the possible “invisible track” you mentioned. Could this go on the requested features list?

  • Paul

On Jun 7, 2018, at 7:00 AM, Jim Robinson notifications@github.com wrote:

Gene search works on some common genomes because it uses our web service. It is possible to configure your own webservice to do this, see https://github.com/igvteam/igv.js/wiki/Browser-Configuration-2.0 (scroll to the bottom).

On Wed, Jun 6, 2018 at 10:30 AM, Paul Shannon notifications@github.com wrote:

If indexed files do not support search - for those regions not currently in memory - could you explain why gene symbol search works flawlessly with this configuration? Sorry to be slow on the uptake…

  • Paul

options = {locus: "MEF2C", minimumBases: 5, showRuler: true, reference: {id: "hg38", fastaURL: "https://s3.amazonaws.com/igv.broadinstitute.org/genomes/ seq/hg38/hg38.fa", cytobandURL: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/cytoBandIdeo.txt" }, tracks: [ {name: 'Gencode v24', url: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/genes/gencode.v24.annotation.sorted.gtf.gz", indexURL: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/genes/gencode.v24.annotation.sorted.gtf.gz.tbi", format: 'gtf', visibilityWindow: 2000000, displayMode: 'EXPANDED' }, ] }; // options

On Jun 2, 2018, at 2:28 PM, Jim Robinson notifications@github.com wrote:

I will track this down and fix it, however you really cannot do a useful search on an indexed track. The search on track features is on the features loaded into memory. With an index this will be just what's in view. I realize that is the case here, but if the gene were somewhere else in the genome it would not be found.

The doc states that this field does not work for indexed files, meaning files with a tabix (.tbi) or tribble (.idx) index.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673#issuecomment-395089122, or mute the thread https://github.com/notifications/unsubscribe-auth/ AA49HNtryKbh5vp3Zp8gjxpilqXAlf2Fks5t5-d8gaJpZM4UXs6U .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673#issuecomment-395604117, or mute the thread https://github.com/notifications/unsubscribe-auth/AA49HGO3fUZEMGVZgrrEbzAHumne2sz-ks5t6cBtgaJpZM4UXs6U .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jrobinso commented 6 years ago

That works, its much easier to have properties with "false" as the default since the absence of any value evaluates to "false" in javascript.

On Thu, Jun 7, 2018 at 9:39 PM, Paul Shannon notifications@github.com wrote:

hidden: false // the default

How’s that?

On Jun 7, 2018, at 6:36 PM, Jim Robinson notifications@github.com wrote:

Yes, what should the property be?

visible: false

invisible: true

hide: true

displayMode: hide (in addition to squish/collapse/expand).

I'm being really lazy.

On Thu, Jun 7, 2018 at 8:08 PM, Paul Shannon notifications@github.com wrote:

Thanks, Jim. Good solution - but perhaps rather than maintain web services for species we might be interested, I’d be interested instead in the possible “invisible track” you mentioned. Could this go on the requested features list?

  • Paul

On Jun 7, 2018, at 7:00 AM, Jim Robinson notifications@github.com wrote:

Gene search works on some common genomes because it uses our web service. It is possible to configure your own webservice to do this, see https://github.com/igvteam/igv.js/wiki/Browser-Configuration-2.0 (scroll to the bottom).

On Wed, Jun 6, 2018 at 10:30 AM, Paul Shannon < notifications@github.com> wrote:

If indexed files do not support search - for those regions not currently in memory - could you explain why gene symbol search works flawlessly with this configuration? Sorry to be slow on the uptake…

  • Paul

options = {locus: "MEF2C", minimumBases: 5, showRuler: true, reference: {id: "hg38", fastaURL: "https://s3.amazonaws.com/igv. broadinstitute.org/genomes/ seq/hg38/hg38.fa", cytobandURL: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/cytoBandIdeo.txt" }, tracks: [ {name: 'Gencode v24', url: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/genes/gencode.v24.annotation.sorted.gtf.gz", indexURL: "https://s3.amazonaws.com/igv.broadinstitute.org/ annotations/hg38/genes/gencode.v24.annotation.sorted.gtf.gz.tbi", format: 'gtf', visibilityWindow: 2000000, displayMode: 'EXPANDED' }, ] }; // options

On Jun 2, 2018, at 2:28 PM, Jim Robinson < notifications@github.com> wrote:

I will track this down and fix it, however you really cannot do a useful search on an indexed track. The search on track features is on the features loaded into memory. With an index this will be just what's in view. I realize that is the case here, but if the gene were somewhere else in the genome it would not be found.

The doc states that this field does not work for indexed files, meaning files with a tabix (.tbi) or tribble (.idx) index.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673# issuecomment-395089122, or mute the thread https://github.com/notifications/unsubscribe-auth/ AA49HNtryKbh5vp3Zp8gjxpilqXAlf2Fks5t5-d8gaJpZM4UXs6U .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673#issuecomment-395604117, or mute the thread https://github.com/notifications/unsubscribe-auth/ AA49HGO3fUZEMGVZgrrEbzAHumne2sz-ks5t6cBtgaJpZM4UXs6U .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv.js/issues/673#issuecomment-395618456, or mute the thread https://github.com/notifications/unsubscribe-auth/AA49HAJMs8Don7kxIgC-2A608PPuqcgwks5t6dXEgaJpZM4UXs6U .