In this workshop you will use conda environments to run the exercises. This is because conda environments allow all students to have the save computing environment, i.e. package versions. This enforces reproducibility for you to run this material without the need to re-install or change your local versions. See and graphical example below:
Conda environments are a self-contained directory that you can use in order to reproduce all your results. Two of the required software are not available as Conda packages, please see the separate instructions for installing SingleR and CHETAH.
Briefly, you need to:
.yml
fileYou can read more about Conda environments and other important concepts to help you make your research reproducible.
You should start by installing Conda. We suggest installing either Miniconda3 (NOT Anaconda). After installing Conda, download the course Conda file and put it in your working folder.
curl -o Miniconda3-latest-MacOSX-x86_64.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
sh Miniconda3-latest-MacOSX-x86_64.sh
Follow the instructions on screen replying yes
when necessary. Restart your terminal window to apply modifications.
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh
Follow the instructions on screen replying yes
when necessary. Restart your terminal window to apply modifications.
Several packages are not available for Windows. However, on windows10 we can run a Ubuntu subsystem to overcome this issue. Please follow the instructions Alternative option on Windows (WLS)
below to install it.
To download the environment_r.yml
file using the command on Terminal:
#Ubuntu
wget https://nbisweden.github.io/workshop-scRNAseq/labs/environment_r.yml
#MacOSX
curl -o environment_r.yml https://nbisweden.github.io/workshop-scRNAseq/labs/environment_r.yml
After this, you should have a file named environment_r.yml
in your directory (it does not matter where, you can save on Downloads folder for example). Next, type:
conda env create -p scRNAseq2020 -f environment_r.yml
Several messages will show up on your screen and will tell you about the installation process. This may take a few minutes depending on how many packages are to be installed.
##Collecting package metadata: done
##Solving environment: done
##
##Downloading and Extracting Packages
##libcblas-3.8.0 | 6 KB | ############################################################################# | 100%
##liblapack-3.8.0 | 6 KB | ############################################################################# | 100%
##...
##Preparing transaction: done
##Verifying transaction: done
##Executing transaction: done
Once the environment is created, we need to activate it in order to use the softwares and packages inside it. To activate an environment type:
source activate scRNAseq2020
From this point on you can run any of the contents from the course. For instance, you can directly launch RStudio by
typing rstudio
. Here it is important to add the &
symbol in the end to be able to use the command line at the same time if needed. You can open other files from Rstudio later as well.
rstudio ./labs/compiled/my_script.Rmd &
Similarly, you can open python notebooks by typing:
jupyter notebook ./labs/scapy/01_qc.ipynb &
After you’ve ran all your analyses, you can deactivate the environment by typing:
conda deactivate
Unfortunately, not all packages available on conda are compatible with windows machines. The good news is that is changed on windows10, in which they offer native linux support via the Windows Subsystem for Linux (WSL2). This allows you to run linux/bash commands from within windows without the need of a virtual machine nor a dual-boot setup (i.e. having 2 operational systems). However, WSL does not offer a complete support for graphical interfaces (such as RStudio in our case), so we need an additional steps to make that happen.
On Windows10, install the WSL if you don’t have it. Follow the instructions here: https://docs.microsoft.com/en-us/windows/wsl/install-win10
Once you have that installed, you can download and install MobaXterm (which is the enhanced terminal with graphical capacity): https://mobaxterm.mobatek.net
Inside MobaXterm, you will probably will see that your WSL is already listed on the left panel as an available connection. Just double-click it and you will be accessing it via MobaXterm. If by any chance you don’t see it there, close MobaXterm and go to the WSL terminal, because probably the WSL is not allowing SSH connections. You can follow this link for the instructions on how to do it. You need to complete until the step Start or restart the SSH service
, while the further steps are optional, but might be useful.
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
cd ~/Downloads
sh Miniconda3-latest-Linux-x86_64.sh
sudo apt-get update
sudo apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
mkdir ~/Desktop/course
cd ~/Desktop/course
wget https://raw.githubusercontent.com/NBISweden/workshop-scRNAseq/master/labs/environment_r.yml
conda env create -n scRNAseq2020 -f environment_r.yml
conda activate scRNAseq2020
rstudio &
If by any means you see that the installations are not working as it should on your computer, you can try to create a virtual machine to run UBUNTU and install everything there.
Download and install on your machine VIRTUALBOX https://www.virtualbox.org
Download the ISO disk of UBUNTU https://ubuntu.com/download/desktop
On VIRTUALBOX, click on Settings
(yellow engine) > General
> Advanced
and make sure that both settings Shared Clipboard and Drag’n’Drop are set to Bidirectional
.
Completely close VIRTUALBOX and start it again to apply changes.
Proceed with the Ubuntu installation as recommended. You can set to do “Minimal Installation” and deactivate to get updates during installation.
sudo apt-get update
sudo apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
cd ~/Downloads
sh Miniconda3-latest-Linux-x86_64.sh
mkdir ~/Desktop/course
cd ~/Desktop/course
wget https://raw.githubusercontent.com/NBISweden/workshop-scRNAseq/master/labs/environment_r.yml
conda env create -n scRNAseq2020 -f environment_r.yml
conda activate scRNAseq2020
rstudio &