Launching the browser

Once both the data and browser are appropriately formatted and configured, you are ready to browse your data!

Ensuring your working directory contains the app_config.yml file, launch the application by executing the following line of code:

omicser::run_defaults()

Your application should automatically load in a new tab/window of your default browser (tested on Chrome and Firefox). If you prefer, there is also an exported run_in_browser() function which takes the database locations as arguments:

omicser::run_in_browser(db_root = "/path/to/database/folders",
                        database_names = c(`your db name`="database_folder_name")
                        )

Please note that you need to keep RStudio running to work with data in your browser.

When you are done browsing, you will need to close both the browser window and end the process running in RStudio. You can end the process in R by clicking on the red stop sign icon in your Console, or by entering Control C in the Console.

An example script illustrating all the different ways to spawn the app can be found in the examples path examples/run_browser_script.R.

If you would like an overview of the features and functionality of the browser, please view the Browsing vignette.

Troubleshooting

Assert the nescessary environment

You can check to see what python is set up on the backend with:

reticulate::py_discover_config()

We can ensure / enforce that the correct python (with anndata and/or scanpy libraries available) by using reticulate and R Sys calls. For instance we can make sure we have an environment with:

OMICSER_PYTHON <-  "pyenv_omicser"
OMICSER_PYTHON_EXISTS <- any(reticulate::conda_list()["name"]==OMICSER_PYTHON)

And we can force reticulate to use our properly configured python by setting the RETICULATED_PYTHON environment variable:

if ( Sys.getenv("RETICULATE_PYTHON") != "OMICSER_PYTHON" ) {
  Sys.setenv("RETICULATE_PYTHON"=reticulate::conda_python(envname = OMICSER_PYTHON))
}

If py_discover_config() does not now show your configured python environment, you will need to restart your R-session and set the RETICULATED_PYTHON environment variable again before spawning the browser.

  • What if I have a dev intallation of omicser? You should make sure to re-load the code before running the browser using the golem helpers. Please see examples/dev_run_browser_script.R.

  • Do I have to use RStudio No! You can run the functions from any R session.

  • The app didn’t open in my browser! What do I do? If the app does not load automatically, copy the URL shown into your Console (e.g., http://127.0.0.1:6329) and paste it into your browser of choice. (Chrome recommended.)

  • I closed my browser window! Do I need to relaunch my app? No, you don’t need to relaunch. Follow the instructions for the question above to view your app in a browser.