# HUNT Workbench FAQ

This page contain frequently asked questions about Workbench. Help us expand this section by sending us questions and ideas for new content.

Troubleshooting

Head over to our HUNT Workbench troubleshooting section if something is not working as expected.

# Storage

# Where is my data?

HUNT Workbench uses the same storages volumes as your home machine. This means that you can access all lab data, including your home-directory, using the same paths in your scripts, for example:

/mnt/archive/<my-data-folder>

# Where is my code stored?

Your Jupyter Notebooks and code files are stored in the following shared work-volume on your home machine:

/mnt/work/workbench

# Reproducibility

# Can I create my own Conda environment for Jupyter?

Yes. This allows you to install packages and package versions of your choice.

Below is an example on how you create a Conda environments with Python and IPython kernel from your workbench terminal::

mamba create -n <name> 'python~=3.10.*' 'ipykernel'

If you have older setup and missing mamba, you can use Conda command instead:

mamba create -n <name> 'python~=3.10.*' 'ipykernel'

And here's an example on how to create a Conda environment with R and R-IRkernel kernel and commonly used packages:

mamba create -n <name> 'r-base>=4.0,<5.0' 'r-irkernel' 'r-devtools' 'r-remotes' 'r-dplyr' 'r-tidyverse' 'r-haven' 'cmake' 'compilers' 'cmake' 'gmp'

You need to replace <name> with your own environment name in the example above, such as conda-test-environment.

# How can I start a Notebook with my new Conda environment?

You should see Notebooks with the conda env-tag. Here are two examples of such Notebooks that are connected to custom Conda environments.

wb_notebook_envs.png

# How can I change a Conda environment for my Notebook?

You can change the Conda environment for your Jupyter Notebook when it is open: Open your Jupyter Notebook of choice and switch the kernel in the top right corner of menu:

wb_notebook_kernel.png

You will be able to select default environments including MATLAB kernel and custom environments which contain either ipykernel (Python) or r-irkernel (R 4.0):

wb_notebook_conda_env.png

# Can others use packages I have installed?

Not directly. The packages you install in your Workbench are usually not shared. The separation prevent others from breaking your packages, for example during upgrades. However, you may utilize the powers of Conda to export the definition of your environments so others can use restore function to be able to use the very same packages that you use. Learn how to manage environments on docs.conda.io (opens new window) or skip directly to sharing an environment guide (opens new window).

# How can I share my Conda environments with others?

It might be handy to share your exact setup with your lab colleagues when you have perfected your workflows.

The packages that you have installed in your HUNT Workbench environment are usually not shared. The separation prevent others from breaking your packages and it allows you to explore packages without breaking the workflows of others.

So, to share environments you will need to export your environments definition to your colleagues so they can reuse them. Read more on how to share (opens new window) and manage Code environments on docs.conda.io (opens new window). Below is a principle guide run in your Workbench terminal:

  1. In your Workbench:
# -- export your active environment
conda env export > /mnt/scratch/test-environment.yml
  1. In your lab colleague's Workbench (run by your lab-colleague):
# -- create a new environment from the saved environment file
conde env create -f /mnt/scratch/test-environment.yml

# -- activate the environment (it will have the same name as your original environment)
conda activate <name>

# -- verify the installation
conda env list

# How can I install apt packages?

We recommend that instead of using apt, you install your packages into your environment using Conda since these will be installed on disk and such be persistent during restarts. Regular apt commands run in terminal will be removed during your next restart. Search Conda repository (opens new window) to identify your package name and get going with your installation.

Example with plink2 (opens new window) package:

mamba install -n default -c bioconda -y plink2
conda activate default
plink2 --help

# Management

# How can I restart my workbench environment?

Sometimes you might want to start over with a fresh environment:

(1) Select control panel in top right corner:

wb_topbar_cp.png

(2) Then in the control panel hit stop server:

wb_cp_stopserver.png

You can either start the new instance by hitting the button or by logging in again.

# Can I install Jupyter extensions?

No. Due to security reasons, we have disabled the Jupyter extension manager. Contact us if you would like useful extensions to be added to the HUNT Workbench.

# MATLAB

# Are there any limitations to MATLAB in HUNT Workbench?

Yes, there are some limitations to the web-based version of MATLAB (MATLAB Online). Read more in the official documentation (opens new window) from MathWorks.

# How do I report issues with MATLAB?

Try to document the time when the issue occurred and save the error logs from your Status information window. Additionally, it would also help if you could take a screenshot of the error logs in the browser console. Usually you can open the console with the shortcuts: CTRL + SHIFT + J (MacOS: CMD + Option + J), although this may vary between browsers. Share the information with us on Slack or email.

# How can I increase the number of parallel workers?

If you already have "Parallel Computing Toolbox" and cannot set the higher number parallel workers in the pool, select Parallel menu and click on Create and Manage Clusters:

MATLAB-manage-clusters.png

Then, hit Edit and update the NumWorkers value (usually number of CPUs):

MATLAB-numWorkers.png

# Can I install new toolboxes

We need to initiate such installation. Contact us on email if you need new toolboxes in your MATLAB installation.

# RStudio

# Which R version is available in RStudio?

RStudio is configured to use packages installed in the Conda environment named r-base. You can identify your current R version packages in your Workbench Terminal following these steps:

  1. Open your Workbench Terminal.

workbench_terminal.png

  1. List the packages in your r-base Conda environment.
conda list -n r-base | grep r-base

# Which R packages are preinstalled?

Currently, we install your r-base environment with the following Conda packages:

- r-base
- r-haven
- r-irkernel
- r-devtools
- r-dplyr
- r-remotes
- r-tidyverse

If you have older setup and missing some of these packages you can follow the "How do I install additional R packages"-answer below to add them to your Conda environment.

# How do I install additional R packages?

If you want to install your own R packages, we recommend that you use Conda where ever possible:

  1. Open Workbench Terminal:

workbench_terminal.png

  1. Activate r-base environment
conda activate r-base
  1. Add packages to your r-base code environment:
# -- Principal example
conda install -n r-base -c conda-forge r-'<package-name>' r-'<another-package-name>'

# -- Practical example*
mamba install -n r-base -c conda-forge r-dplyr

For example, the above example installs the dplyr package (opens new window).

  1. When the installation is complete, open RStudio or R in your workbench and load your new package:
# -- Principal example
library(<package-name>)

# -- Practical example
library(dplyr)

You can defer to alternative methods such as install.packages() when the package is not available in Conda (see below).

# How do I install R packages not found in Conda?

Never install R / Bioconductor packages from inside RStudio


If you don't find a R package in Conda as described above, you may need to defer to running the install.packages() or BiocManager::install() commands inside R. We recommend to use R in your workbench terminal for such installations (instead of installing directly in RStudio) to avoid broken environment states in RStudio.

Packages installed into your r-base environment through R in terminal will be available in RStudio.

Make sure to activate the r-base environment before running R command.

conda activate r-base
R

# How can I use R in my Workbench Terminal?

First, open your Workbench Terminal.

Start by activating r-base environment:

conda activate r-base

Then run R inside your r-base environment:

R

Enjoy!

# How can I recover my R environment in case of broken package installation?

Sometimes you may get errors about the a library not being found (e.g. GLIBCXX, OPENSSL) and/or essential R packages are not working. This happens typically after installation of custom package. In such cases, you might consider to recreate your r-base environment from scratch:

  1. Open your workbench terminal and run the following code to reset your r-base environment:
mamba create --yes -n r-base 'r-base>=4.0,<5.0' 'compilers' 'cmake' 'gmp' 'r-irkernel' 'r-devtools' 'r-remotes' 'r-dplyr' 'r-tidyverse' 'r-haven' 'r-languageserver' 'r-lintr'

If you have older setup without mamba, use Conda command instead:

conda create --yes -n r-base 'r-base>=4.0,<5.0' 'compilers' 'cmake' 'gmp' 'r-irkernel' 'r-devtools' 'r-remotes' 'r-dplyr' 'r-tidyverse' 'r-haven' 'r-languageserver' 'r-lintr'

WARNING

This removes custom packages that you might have installed.

# Can others use my R packages?

When you have perfected your workflows, you can share your setup with your colleagues, although not directly.

The R-packages in your HUNT Workbench environment are usually not shared. This separation prevent others from breaking your packages and it allows you to explore packages without breaking the workflow of others.

So, to share environments you will need to export your environments definitions so others can reuse them:

Learn how to manage environments on docs.conda.io (opens new window).

# How do I reset my user state in RStudio?

When you restart your HUNT Workbench, your RStudio user state might still be preserved. Read the RStudio support pages about how you can manually remove your user state (opens new window) to achieve a complete reset.

# Visual Studio Code

# Pre-installed extensions

VSCode in Workbench comes with jupyter and python extension.

# Can I install my own extensions?

No. This option is not available to user. If you need additional extensions contact us.

# Terminal

# Can I use a terminal from my Workbench?

Yes. You can find your Workbench Terminal in the main view of applications under the section: Other.

other_apps_terminal.png

# When do I need to use a terminal?

Workbench Terminal can be handy when it comes to managing Conda packages, monitoring resources (htop), or handling other tasks.

Last Updated: 11/20/2024