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

can only visualize the "Test page" #2

Open
dalloliogm opened this issue Apr 11, 2019 · 45 comments
Open

can only visualize the "Test page" #2

dalloliogm opened this issue Apr 11, 2019 · 45 comments

Comments

@dalloliogm
Copy link
Contributor

Hello,
I've followed the instructions in the tutorial. However, when I open the server page, I can only see a "Test page" message.

What am I doing wrong?

episerver = createServer(
  #port=as.numeric(Sys.getenv("CDSW_PUBLIC_PORT")), 
  verbose=T,
  try_ports=T,
  daemonized=T)
# start the server
episerver$start_server()
episerver

### Start the epivizr app
#
# The epivizr app should connect to the episerver.
#
# You can specify the Epiviz server using the episerver variable defined above, or manually specify host and http_port
#
# For a full tutorial on epivizr, see http://bioconductor.org/packages/release/bioc/vignettes/epivizr/inst/doc/IntroToEpivizr.html 
epi = startEpiviz(
            #host=Sys.getenv("CDSW_IP_ADDRESS"),
   #         host=Sys.getenv("CDSW_IP_ADDRESS"),
            open_browser=F,
          server = episerver)
epi

Moreover, when I print the episerver or epiclient variables, I get a "not connected" message:

> episerver
<EpivizServer> port: 8080, not connected 
@jkanche
Copy link
Member

jkanche commented Apr 13, 2019

Hello @dalloliogm, are you using this with the epivizr package ?

@dalloliogm
Copy link
Contributor Author

Hi,
yes, I am. In the example above, I am loading epivizr and epivizrServer. Thanks for the answer.

@jkanche
Copy link
Member

jkanche commented Apr 15, 2019

if you use the epivizr package, you do not need to explicitly create the server. Once you start an epivizr session, it automatically creates an instance of the epivizrServer.

library(epivizr)
library(antiProfilesData)
library(SummarizedExperiment)
app <- startEpiviz(workspace="qyOTB6vVnff", gists="2caf8e891201130c7daa")
blocks_chart <- app$plot(tcga_colon_blocks, datasource_name="450k colon_blocks")
app$stop_app()

for more examples, please see the vignettes from the epivizr package. Let me know if you still have issues.

@dalloliogm
Copy link
Contributor Author

Thanks... unfortunately I still get the "Not Connected" error, when copying&pasting the code from your post:

Epiviz App connection:
Server: <EpivizServer> port: 7123, not connected 

Measurements:
                   id              name length connected columns
1 450k colon_blocks_1 450k colon_blocks    129

@jkanche
Copy link
Member

jkanche commented Apr 15, 2019

We've seen this happen with a few users before where they use enterprise laptops and the user has limited access to opening ports. Another way to test this might be to see if you can run a shiny app locally ? Also after running the startEpiviz function, does the app open the browser ? Opening the browser is necessary to establish the initial connection between the browser and the R-session.

@harrica
Copy link

harrica commented Apr 16, 2019

I am working with gio on trying to get this working on our system. When I execute the example a browser window opens but at the following location
http://epiviz.cbcb.umd.edu/4/index.php?websocket-host[]=ws://localhost:7123&debug=false&ws=qyOTB6vVnff&gist[]=2caf8e891201130c7daa&useCookie=true&settings=default&

is that the correct behaviour?

@jkanche
Copy link
Member

jkanche commented Apr 16, 2019

yes, opening the browser connects it with the R-session. Now you can visualize datasets from the R-session with the browser. If you would like to run everything locally, we have another package called epivizrStandalone. The API is very similar to epivizr but everything is run locally instead of our hosted web browser.

@harrica
Copy link

harrica commented Apr 16, 2019

Excellent I'll give that a try this afternoon. thank you very much

@dalloliogm
Copy link
Contributor Author

Thank you,
I've tried epivizrStandAlone and I was able to visualize something. It opened a browser on the local machine, which I can access from other machines.

library(epivizrStandalone)
library(Homo.sapiens)
app <- startStandalone(Homo.sapiens, 
                       keep_seqlevels=paste0("chr",c(1:22,"X","Y")), 
                       verbose=TRUE, 
                       use_viewer_option = TRUE,
                       non_interactive=F, host="10.137.232.212", try_ports=T)

However the browser is empty.. no genes and no chromosomes. Is that normal? Is there a guide to describe how to add them?
Moreover, the browser dies after a while, with the message:

Error in .wait_until_connected(app$server) : 
  [epivizrStandalone] Error starting app. UI unable to connect to websocket server.

I saw that there is also an epiviz project, with an application that runs via docker. I can start that without many issues, however I can't send data to it from R.

Apologies if this is already documented, I am a bit lost among the epiviz packages :-). Thanks for the great work, anyway.

@jkanche
Copy link
Member

jkanche commented Apr 19, 2019

Hello, We modularized our packages so that it is easier to use them across different projects. The packages that the end user would use would be either epivizr or epivizrStandalone. both these packages use the R-session to act as a backend webserver responding to requests from the UI and serve data loaded into the R-session. the packages differ where the UI is run from - epivizr package uses the UI hosted here at UMD (http://epiviz.cbcb.umd.edu) whereas the epivizrStandalone package downloads the UI locally from Github and serves the application.

I made a short screencast of the epivizrStandalone running inside Rstudio's viewer using some example datasets (I use chr11 because the sample datasets only contain data in this region).
https://www.loom.com/share/00aca7b2bc3a41278b0b2af74bed85dd

the code from the screencast

library(epivizrStandalone)
library(Homo.sapiens)

app <- startStandalone(Homo.sapiens, 
                       keep_seqlevels=paste0("chr",c(1:19,"X","Y")), 
                       chr="chr11",
                       start=110081455,
                       end=135006517,
                       verbose=TRUE, 
                       use_viewer_option = TRUE)

## load sample datasets
data("tcga_colon_blocks")
data("tcga_colon_curves")
data("tcga_colon_expression")

app$plot(tcga_colon_blocks, datasource_name = "tcga 450K blocks")
app$plot(tcga_colon_curves, datasource_name = "tcga 450K methylation", type="bp", 
         columns=c("cancerMean", "normalMean"))
## stops the app and removes the datasets from the UI
app$stop_app()

looking at your code, I think using the host= "10.137.232.212" might be causing the issue. Can you try this without this parameter ? Sorry for the confusion on the packages and This helps us get better at documenting. Let me know if you continue to have issues.

@harrica
Copy link

harrica commented Apr 22, 2019

I've run the above and it opens a blank EpiViz4 page and I get the following errors

app <- startStandalone(Homo.sapiens,

  •                    keep_seqlevels = paste0("chr",c(1:19,"X","Y")),
    
  •                    chr="chr11",
    
  •                    start=110081455,
    
  •                    end=135006517,
    
  •                    verbose=TRUE)
    

checking for updates to epiviz app...
Starting Epivizr!
Initializing session manager...
Opening connections...
Done starting Epivizr!
Starting epiviz websocket connection
Opening browser
Using url http://127.0.0.1:7123/epivizr-standalone.html?websocket-host[]=ws://127.0.0.1:7123&debug=false&useCookie=false&
Error in .wait_until_connected(app$server) :
[epivizrStandalone] Error starting app. UI unable to connect to websocket server.

data("tcga_colon_blocks")
data("tcga_colon_curves")
data("tcga_colon_expression")
app$plot(tcga_colon_blocks,datasource_name = "tcga 450K blocks")
Error in app$plot(tcga_colon_blocks, datasource_name = "tcga 450K blocks") :
Error adding measurements for data object
app$plot(tcga_colon_curves,datasource_name = "tcga 450K methylation",type="bp",

  •      columns=c("cancerMean","normalMean"))
    

Error in app$plot(tcga_colon_curves, datasource_name = "tcga 450K methylation", :
Error adding measurements for data object

Any ideas?

@jkanche
Copy link
Member

jkanche commented Apr 22, 2019

hello @harrica, can you run

setStandalone() before you execute the code snippet from the previous post ? Can you post the error if you see one ? Also can you post the sessionInfo() of the machine you are running this on ?

@harrica
Copy link

harrica commented Apr 22, 2019

here it is

setStandalone()
cloning epiviz from git...
cloning into '/home/rh682900/R/x86_64-redhat-linux-gnu-library/3.3/epivizrStandalone/www'...
Receiving objects: 1% (126/12514), 60 kb
Receiving objects: 11% (1377/12514), 742 kb
Receiving objects: 21% (2628/12514), 3253 kb
Receiving objects: 31% (3880/12514), 16227 kb
Receiving objects: 41% (5131/12514), 21858 kb
Receiving objects: 51% (6383/12514), 29217 kb
Receiving objects: 61% (7634/12514), 30513 kb
Receiving objects: 71% (8885/12514), 44527 kb
Receiving objects: 81% (10137/12514), 44879 kb
Receiving objects: 91% (11388/12514), 45295 kb
Receiving objects: 100% (12514/12514), 46099 kb, done.
[1] "/home/rh682900/R/x86_64-redhat-linux-gnu-library/3.3/epivizrStandalone/www"

sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] antiProfilesData_1.10.0 Homo.sapiens_1.3.1
[3] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2 org.Hs.eg.db_3.4.0
[5] GO.db_3.4.0 OrganismDbi_1.16.0
[7] GenomicFeatures_1.26.4 GenomicRanges_1.26.4
[9] GenomeInfoDb_1.10.3 AnnotationDbi_1.36.2
[11] IRanges_2.8.2 S4Vectors_0.12.2
[13] epivizrData_1.2.0 Biobase_2.34.0
[15] BiocGenerics_0.20.0 epivizrServer_1.2.0
[17] epivizrStandalone_1.2.0 epivizr_2.4.1

loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 git2r_0.25.2 BiocInstaller_1.24.0
[4] pillar_1.3.1 XVector_0.14.1 bitops_1.0-6
[7] tools_3.3.3 zlibbioc_1.20.0 biomaRt_2.30.0
[10] digest_0.6.12 bit_1.1-12 lattice_0.20-35
[13] RSQLite_2.0 memoise_1.1.0 tibble_2.1.1
[16] pkgconfig_2.0.2 rlang_0.3.4 graph_1.52.0
[19] Matrix_1.2-10 DBI_0.7 rstudioapi_0.6
[22] yaml_2.1.14 rtracklayer_1.34.2 Biostrings_2.42.1
[25] grid_3.3.3 bit64_0.9-7 R6_2.2.2
[28] RBGL_1.50.0 XML_3.98-1.9 BiocParallel_1.8.2
[31] blob_1.1.0 Rsamtools_1.26.2 GenomicAlignments_1.10.1
[34] SummarizedExperiment_1.4.0 mime_0.5 httpuv_1.3.3
[37] RCurl_1.95-4.8 crayon_1.3.4 rjson_0.2.20

@jkanche
Copy link
Member

jkanche commented Apr 22, 2019

does running the script after setStandalone() work now ? If not are you running this on rstudio locally or on a remote machine ?

@harrica
Copy link

harrica commented Apr 22, 2019

I get the same error, its running on a remote rstudio. I will attempt it locally on my Mac tomorrow

@harrica
Copy link

harrica commented Apr 23, 2019

good morning, I've upgraded rstudio and r on my mac and installed the new packages. on RStudio standalone the code successfully runs and shows itself in the viewer window in RStudio but now I'm not sure how to get it to a browser window

@jkanche
Copy link
Member

jkanche commented Apr 23, 2019

Hello @harrica, glad to hear it worked! if you remove this parameter use_viewer_option = TRUE when you start the app, this would open in a normal browser window.

@harrica
Copy link

harrica commented Apr 23, 2019 via email

@harrica
Copy link

harrica commented Apr 23, 2019

that worked great on a standalone RStudio on my desktop thanks

@harrica
Copy link

harrica commented Apr 24, 2019

Hello again, when looking at developer tools in chrome I get 3 errors.
epiviz-min.js:2794 Mixed Content: The page at 'https://us1salxhpe0012.corpnet2.com:8787/s/b08f2cfc78a31cc71c66f/p/7123/epivizr-standalone.html?websocket-host[]=ws://127.0.0.1:7123&debug=false&useCookie=false&' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://us1salxhpe0012.corpnet2.com:8787/s/b08f2cfc78a31cc71c66f/p/7123/websocket'. This request has been blocked; this endpoint must be available over WSS.
epiviz.data.WebsocketDataProvider._initialize @ epiviz-min.js:2794
:8787/s/b08f2cfc78a31cc71c66f/p/7123/css/epiviz_2_icon.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
epiviz-min.css:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)

It looks like it wants to connect to secure websocket and is failing that. Is there a way to ask it to go to a secure web socket?

@jkanche
Copy link
Member

jkanche commented Apr 24, 2019

from the url, I notice that the server is running on

https://us1salxhpe0012.corpnet2.com:8787

but the websocket is trying to connect to localhost on the client

websocket-host[]=ws://127.0.0.1:7123

Instead of 127.0.0.1, can you replace this with where the server is running, may be us1salxhpe0012.corpnet2.com

is this on a rstudio server ?

@harrica
Copy link

harrica commented Apr 24, 2019

yes it's on rstudio server. the https://us1salxhpe0012.corpnet2.com:8787 is rstudio server pro. do I just use the host parameter

@jkanche
Copy link
Member

jkanche commented Apr 24, 2019

Can you try this url ? (using the same host for ui and websocket)

https://us1salxhpe0012.corpnet2.com:8787/s/b08f2cfc78a31cc71c66f/p/7123/epivizr-standalone.html?websocket-host[]=ws://us1salxhpe0012.corpnet2.com:7123&debug=false&useCookie=false&

@dalloliogm
Copy link
Contributor Author

Hello,
I've tried the URL (I'm in the same network as @harrica ) but it says "Connection Refused"

@jkanche
Copy link
Member

jkanche commented Apr 24, 2019

@harrica
Copy link

harrica commented Apr 25, 2019

ok I have tried the following with no success.

library(epivizrStandalone)
library(epivizrData)
library(Homo.sapiens)
setStandalone()
app <- startStandalone(Homo.sapiens,
keep_seqlevels = paste0("chr",c(1:19,"X","Y")),
chr="chr11",
start=110081455,
end=135006517,
verbose=TRUE,
use_viewer_option=FALSE,
host="https://us1salxhpe0012.corpnet2.com:8787/s/b08f2cfc78a31cc71c66f/p/7123/epivizr-standalone.html?websocket-host[]=ws://us1salxhpe0012.corpnet2.com:7123&debug=false&useCookie=false&")
data("tcga_colon_blocks")
data("tcga_colon_curves")
data("tcga_colon_expression")
app$plot(tcga_colon_blocks,datasource_name = "tcga 450K blocks")
app$plot(tcga_colon_curves,datasource_name = "tcga 450K methylation",type="bp",
columns=c("cancerMean","normalMean"))
Using url http://https://us1salxhpe0012.corpnet2.com:8787/s/b08f2cfc78a31cc71c66f/p/7123/epivizr-standalone.html?websocket-host[]=ws://us1salxhpe0012.corpnet2.com:7123&debug=false&useCookie=false&:7123/epivizr-standalone.html?websocket-host[]=ws://https://us1salxhpe0012.corpnet2.com:8787/s/b08f2cfc78a31cc71c66f/p/7123/epivizr-standalone.html?websocket-host[]=ws://us1salxhpe0012.corpnet2.com:7123&debug=false&useCookie=false&:7123&debug=false&useCookie=false&
Error in .wait_until_connected(app$server) :
[epivizrStandalone] Error starting app. UI unable to connect to websocket server

is there a way to do a wss to the local host?

@jkanche
Copy link
Member

jkanche commented Apr 25, 2019

Hi @harrica

the host parameter is where the server is running, in your case it'll be us1salxhpe0012.corpnet2.com

@harrica
Copy link

harrica commented Apr 25, 2019 via email

@harrica
Copy link

harrica commented Apr 26, 2019

i put in the host parameter suggested and get a UI unable to connect to WebSocket server, and while it throws a page to the localhost we have seen the behavior previously. I think we may need to talk on gitter chat

@jkanche
Copy link
Member

jkanche commented Apr 26, 2019

Hello @harrica, I am on gitter.

@harrica
Copy link

harrica commented Apr 26, 2019

as am I not sure how to find you though

@jkanche
Copy link
Member

jkanche commented Apr 26, 2019

I added you to the gitter chat room, if you don't see the invite, you can sign in here -

https://gitter.im/epiviz/general?utm_source=share-link&utm_medium=link&utm_campaign=share-link

@harrica
Copy link

harrica commented Apr 29, 2019

Gio, it's going to take a bit of work to attempt this, but I'm also unsure if it will work. The base problem is that we apparently have a different version of R from the CLI than from RStudio that isn't something I can change. I will attempt to install all the bioconductor stuff locally and give this a try. I think we will run into the same problem in not supporting secure websockets because the underlying code being used by epiviz is based upon httpuv, the owner of that package has said it does not support wss and that hey have no plans to do it.

@dalloliogm
Copy link
Contributor Author

Hi @harrica, if you prefer I can try it as I already have an R installation with some bioconductor packages installed, so that will save time.

@harrica
Copy link

harrica commented Jul 8, 2019

I finally have a http version of rstudio server pro running and am trying to get the standalone code running again. to refresh memories.
library(epivizrStandalone)
library(epivizrData)
library(Homo.sapiens)
#setStandalone()
app <- startStandalone(Homo.sapiens,
keep_seqlevels = paste0("chr",c(1:19,"X","Y")),
chr="chr11",
start=110081455,
end=135006517,
verbose=TRUE,
use_viewer_option=FALSE,
host="us1salxhpg0012.corpnet2.com")
data("tcga_colon_blocks")
data("tcga_colon_curves")
data("tcga_colon_expression")
app$plot(tcga_colon_blocks,datasource_name = "tcga 450K blocks")
app$plot(tcga_colon_curves,datasource_name = "tcga 450K methylation",type="bp",
columns=c("cancerMean","normalMean"))
when I run this in rstudio I get
checking for updates to epiviz app...
Starting Epivizr!
Initializing session manager...
Opening connections...
Done starting Epivizr!
Starting epiviz websocket connection
Opening browser
Using url http://us1salxhpg0012.corpnet2.com:7123/epivizr-standalone.html?websocket-host[]=ws://us1salxhpg0012.corpnet2.com:7123&debug=false&useCookie=false&
Error in .wait_until_connected(app$server) :
[epivizrStandalone] Error starting app. UI unable to connect to websocket server.

any ideas?

@harrica
Copy link

harrica commented Jul 8, 2019

after messing around a bit I now get the following I pasted since it is a little long
epiviz.txt

@jkanche
Copy link
Member

jkanche commented Jul 8, 2019

do you see a browser tab open with epiviz ? From what you pasted, the server and the UI seems to be communicating, can you run this first,

library(epivizrStandalone)
library(epivizrData)
library(Homo.sapiens)
#setStandalone()
app <- startStandalone(Homo.sapiens,
keep_seqlevels = paste0("chr",c(1:19,"X","Y")),
chr="chr11",
start=110081455,
end=135006517,
verbose=TRUE,
use_viewer_option=FALSE,
host="us1salxhpg0012.corpnet2.com")

wait from the browser tab to open and then run the remaining script

@harrica
Copy link

harrica commented Jul 8, 2019

the web socket seems to be working since I can close it with app$stop_app

@harrica
Copy link

harrica commented Jul 8, 2019

ok I have a web page - ran the startStandalone and then when the page appears I get

data("tcga_colon_curves")

data("tcga_colon_expression")
app$plot(tcga_colon_blocks,datasource_name = "tcga 450K blocks")
Error in .self$visualize(chart_type, datasource = measurement_object, :
Can't visualize BlocksTrack, it is not registered
app$plot(tcga_colon_curves,datasource_name = "tcga 450K methylation",type="bp",

  •      columns=c("cancerMean","normalMean"))
    

Error in .self$visualize(chart_type, datasource = measurement_object, :
Can't visualize LineTrack, it is not registered

@jkanche
Copy link
Member

jkanche commented Jul 8, 2019

can you send me the screenshot of what the page looks like ?

@harrica
Copy link

harrica commented Jul 8, 2019

here it is
Capture

@jkanche
Copy link
Member

jkanche commented Jul 9, 2019

Since your server can now establish websocket connections, can you try this code, this uses the UI we host at UMD

library(epivizr)
library(antiProfilesData)
library(SummarizedExperiment)
data("tcga_colon_blocks")
app <- startEpiviz(workspace="qyOTB6vVnff", gists="2caf8e891201130c7daa")
blocks_chart <- app$plot(tcga_colon_blocks, datasource_name="450k colon_blocks")
app$stop_app()

don't run the last line as that closes the session and removes the chart.

@harrica
Copy link

harrica commented Jul 10, 2019

when I run the above it spawns a browser draws a picture and produces the following error

blocks_chart <- app$plot(tcga_colon_blocks, datasource_name="450k colon_blocks")
Error in app$plot(tcga_colon_blocks, datasource_name = "450k colon_blocks") :
Error adding measurements for data object
Capture

@harrica
Copy link

harrica commented Jul 10, 2019

if it's of any use to you I get the same results from the RStudio-server instance I'm running from home for bot Standalone and this snippet

@harrica
Copy link

harrica commented Jul 10, 2019

also is there a way to increase the wait time for the web socket server, I can't tell if we are timing out.

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

3 participants