Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

igvShiny/inst/demos/tiny.R fails on some stock genomes #34

Closed
malcook opened this issue Oct 5, 2022 · 12 comments
Closed

igvShiny/inst/demos/tiny.R fails on some stock genomes #34

malcook opened this issue Oct 5, 2022 · 12 comments

Comments

@malcook
Copy link

malcook commented Oct 5, 2022

In my hands, igvShiny/inst/demos/tiny. works in R 4.2.0 as provided (using genomeName="hg38" ).

I installed earlier today with remotes::install_github("paul-shannon/igvShiny")

From the documentation, I expect it should work with many other of the currently.supported.stock.genomes().

However, for me, changing to another stock genome with genomeName="danRer11" (or: sacCer3 hg19 dm3 dm6 chm13v2.0), fails with:

igvShiny.js:66 Uncaught TypeError: Cannot read properties of null (reading 'height')
    at Object.renderValue (igvShiny.js:66:77)
    at Object.renderValue (htmlwidgets.js:886:25)
    at shinyBinding.renderValue (htmlwidgets.js:541:20)
    at e.value (outputBinding.ts:48:12)
    at delegator.<computed> [as onValueChange] (htmlwidgets.js:112:23)
    at e.value (outputAdapter.ts:38:20)
    at e.value (shinyapp.ts:559:17)
    at e.<anonymous> (shinyapp.ts:736:20)
    at e.value (shinyapp.ts:717:29)
    at e.value (shinyapp.ts:700:12)
renderValue @ igvShiny.js:66
renderValue @ htmlwidgets.js:886
shinyBinding.renderValue @ htmlwidgets.js:541
value @ outputBinding.ts:48
delegator.<computed> @ htmlwidgets.js:112
value @ outputAdapter.ts:38
value @ shinyapp.ts:559
(anonymous) @ shinyapp.ts:736
value @ shinyapp.ts:717
value @ shinyapp.ts:700
i.onmessage @ shinyapp.ts:350

This is under Google Chrome (Version 105.0.5195.127 (Official Build) (64-bit)) .

Additionally there are warnings in the console of:

DevTools failed to load source map: Could not load content for http://hd1991356yb:9998/igv-ui-1_3_0.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://hd1991356yb:9998/circular-view.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://hd1991356yb:9998/dom.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

but these warnings are also present with "hg38".

The issue persists after updating all packages:

sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS:   /n/apps/CentOS7/install/r-4.2.0/lib64/R/lib/libRblas.so
LAPACK: /n/apps/CentOS7/install/r-4.2.0/lib64/R/lib/libRlapack.so

locale:
[1] C

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] igvShiny_1.5.6         htmlwidgets_1.5.4      rtracklayer_1.56.1    
 [4] GenomeInfoDbData_1.2.8 GenomicRanges_1.48.0   GenomeInfoDb_1.32.3   
 [7] IRanges_2.30.1         S4Vectors_0.34.0       BiocGenerics_0.42.0   
[10] shiny_1.7.2           

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9                  lattice_0.20-45            
 [3] Rsamtools_2.12.0            Biostrings_2.64.1          
 [5] digest_0.6.29               V8_4.2.1                   
 [7] mime_0.12                   R6_2.5.1                   
 [9] httr_1.4.4                  zlibbioc_1.42.0            
[11] rlang_1.0.6                 curl_4.3.2                 
[13] jquerylib_0.1.4             Matrix_1.5-1               
[15] randomcoloR_1.1.0.1         BiocParallel_1.30.3        
[17] Rtsne_0.16                  stringr_1.4.1              
[19] RCurl_1.98-1.9              munsell_0.5.0              
[21] DelayedArray_0.22.0         compiler_4.2.0             
[23] httpuv_1.6.6                htmltools_0.5.3            
[25] SummarizedExperiment_1.26.1 codetools_0.2-18           
[27] matrixStats_0.62.0          XML_3.99-0.11              
[29] crayon_1.5.2                later_1.3.0                
[31] GenomicAlignments_1.32.1    bitops_1.0-7               
[33] grid_4.2.0                  jsonlite_1.8.2             
[35] xtable_1.8-4                lifecycle_1.0.2            
[37] magrittr_2.0.3              scales_1.2.1               
[39] cli_3.4.1                   stringi_1.7.8              
[41] cachem_1.0.6                XVector_0.36.0             
[43] promises_1.2.0.1            bslib_0.4.0                
[45] ellipsis_0.3.2              rjson_0.2.21               
[47] restfulr_0.0.15             tools_4.2.0                
[49] Biobase_2.56.0              MatrixGenerics_1.8.1       
[51] parallel_4.2.0              fastmap_1.1.0              
[53] yaml_2.3.5                  colorspace_2.0-3           
[55] cluster_2.1.4               memoise_2.0.1              
[57] sass_0.4.2                  BiocIO_1.6.0                

I tried it in R 4.1.2 and still get

Uncaught TypeError: Cannot read properties of null (reading 'height')
    at Object.renderValue (igvShiny.js:66:77)
    at Object.renderValue (htmlwidgets.js:886:25)
    at shinyBinding.renderValue (htmlwidgets.js:541:20)
    at e.value (outputBinding.ts:48:12)
    at delegator.<computed> [as onValueChange] (htmlwidgets.js:112:23)
    at e.value (outputAdapter.ts:38:20)
    at e.value (shinyapp.ts:559:17)
    at e.<anonymous> (shinyapp.ts:736:20)
    at e.value (shinyapp.ts:717:29)
    at e.value (shinyapp.ts:700:12)

again with updated packages:

sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS:   /n/apps/CentOS7/install/r-4.1.2/lib64/R/lib/libRblas.so
LAPACK: /n/apps/CentOS7/install/r-4.1.2/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.utf8       LC_NUMERIC=C             
 [3] LC_TIME=en_US.utf8        LC_COLLATE=en_US.utf8    
 [5] LC_MONETARY=en_US.utf8    LC_MESSAGES=en_US.utf8   
 [7] LC_PAPER=en_US.utf8       LC_NAME=C                
 [9] LC_ADDRESS=C              LC_TELEPHONE=C           
[11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C      

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] igvShiny_1.5.6         htmlwidgets_1.5.4      rtracklayer_1.57.0    
 [4] GenomeInfoDbData_1.2.7 GenomicRanges_1.46.1   GenomeInfoDb_1.30.1   
 [7] IRanges_2.28.0         S4Vectors_0.30.2       BiocGenerics_0.40.0   
[10] shiny_1.7.2           

loaded via a namespace (and not attached):
 [1] SummarizedExperiment_1.24.0 bslib_0.4.0                
 [3] lattice_0.20-45             V8_4.2.1                   
 [5] colorspace_2.0-3            htmltools_0.5.3            
 [7] yaml_2.3.5                  XML_3.99-0.9               
 [9] rlang_1.0.1                 jquerylib_0.1.4            
[11] later_1.3.0                 BiocParallel_1.28.3        
[13] randomcoloR_1.1.0.1         matrixStats_0.62.0         
[15] lifecycle_1.0.1             stringr_1.4.1              
[17] zlibbioc_1.40.0             MatrixGenerics_1.6.0       
[19] Biostrings_2.62.0           munsell_0.5.0              
[21] memoise_2.0.1               restfulr_0.0.13            
[23] Biobase_2.54.0              fastmap_1.1.0              
[25] httpuv_1.6.6                parallel_4.1.2             
[27] curl_4.3.2                  Rcpp_1.0.8                 
[29] xtable_1.8-4                promises_1.2.0.1           
[31] scales_1.2.1                cachem_1.0.6               
[33] DelayedArray_0.20.0         jsonlite_1.8.2             
[35] XVector_0.34.0              mime_0.12                  
[37] Rsamtools_2.10.0            rjson_0.2.21               
[39] digest_0.6.29               stringi_1.7.8              
[41] Rtsne_0.16                  BiocIO_1.4.0               
[43] grid_4.1.2                  cli_3.3.0                  
[45] tools_4.1.2                 bitops_1.0-7               
[47] sass_0.4.2                  magrittr_2.0.3             
[49] RCurl_1.98-1.6              cluster_2.1.2              
[51] crayon_1.5.2                ellipsis_0.3.2             
[53] Matrix_1.4-1                httr_1.4.4                 
[55] R6_2.5.1                    GenomicAlignments_1.30.0   
[57] compiler_4.1.2             

Similarly, igvShinyDemo.R fails when changing hg38 to e.g. danRer11.

What other diagnostics can I provide?

Or am I just using it incorrectly?

@paul-shannon
Copy link
Collaborator

paul-shannon commented Oct 5, 2022 via email

@paul-shannon
Copy link
Collaborator

paul-shannon commented Oct 5, 2022 via email

@malcook
Copy link
Author

malcook commented Oct 5, 2022

Yes, in my hands inst/demos/igvShinyDemo.R suffers similarly - hg38 works fine and the sidebar pane buttons show the various tracks, but upon changing to danRer11, the app loads and shows the side bar pane (with Search, Add As Bed, etc) but the genome pane is blank.

Of possible additional diagnostic value to you is that upon initial display I see in R console:

Listening on http://0.0.0.0:9997
--- starting renderIgvShiny
--- ending renderIgvShiny
[1] --- igvReady
[1] igv ready, igvShiny_0
[1] --- igvReady
[1] igv ready, igvShiny_0

whereas changing to danRer11 shows only

Listening on http://0.0.0.0:9997
--- starting renderIgvShiny
--- ending renderIgvShiny

(you will note I changed the port to 9997 and host to 0.0.0.0, but it happens with original values too)

@malcook
Copy link
Author

malcook commented Oct 5, 2022

while I have your attention, once this works, should I expect to be able to display bigbed tracks?

@paul-shannon
Copy link
Collaborator

paul-shannon commented Oct 5, 2022 via email

@malcook
Copy link
Author

malcook commented Oct 5, 2022

sleuthing a little in your codebase for refereneces to hg38, I find this which leads me to test the other genomes similarly hardcoded (mm10, tair10, rhos) and find that:

  • hg19 and mm10 both work
  • tair10 - works, except for CORS related error [1]
  • rhos fails with
Currently supported: chm13v2.0,chm13v1.1,hg38,hg38_1kg,hg19,hg18,mm39,mm10,mm9,rn7,rn6,gorGor6,gorGor4,panTro6,panTro5,panTro4,macFas5,panPan2,canFam3,canFam5,bosTau9,bosTau8,susScr11,galGal6,danRer11,danRer10,ce11,dm6,dm3,dmel_r5.9,sacCer3,ASM294v2,ASM985889v3,tair10,GCA_003086295.2

So it seems that as written there is some hardcoded rigging needed in igvGenomes.js

@malcook
Copy link
Author

malcook commented Oct 5, 2022

inst/unitTests/test_genomeSpec.R yields:

runTests()
--- test_url.exists
--- test_supportedGenomes
Error in currently.supported.genomes() (from test_genomeSpec.R!W7QDWR#30) : 
  could not find function "currently.supported.genomes"

Commenting out that test - all others succeed.

Changing it to call currently.supported.stock.genomes instead of currently.supported.genomes (referencing igvR manual) and it now succeeds along with all other tests. i'm pretty sure my observation above about hardcoded options in the javascript library is where the issue lies.

Also, it continues to pass after adding "danRer11" to the list of stock genomes it asserts must be included.

@paul-shannon
Copy link
Collaborator

@malcook - Malcolm,

I hacked together a usable macbook/RStudio setup, but lack a git client. So I offer the fixed stock Genome code - a modified igvShiny.js and stockGenomesDemo.R - as a clumsy zip file here.

I hope that this is easy for you to blend with your current local version of igvShiny. When I get back to Seattle at the end of the month I will push this code to the master branch, run the tests, make more changes, to include:

  • doing a long overdue refactoring of igvShiny.js genomeSpecificOptions function
  • creating a new class for BedGraph tracks, supporting both local files and urls.

patch.zip

@paul-shannon
Copy link
Collaborator

@malcook - any feedback on this patch? I am now back in Seattle, about to push the changes, and I'd be grateful to hear from you if you made any use of the patch.

@paul-shannon
Copy link
Collaborator

igvShiny 1.5.8 supports all igv.js-provided stock genomes, test/demo in inst/demos/stockGenomesDemo.R

@malcook
Copy link
Author

malcook commented Oct 31, 2022

Hi. I wound up not using the patch as I had a workaround of using a local genome and it was easier to wait for this release, which I can confirm now works as expected for danRer11.

@malcook malcook closed this as completed Oct 31, 2022
@paul-shannon
Copy link
Collaborator

Glad to hear this, Malcolm. I welcome other requests and bug reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants