- Linux/Bash basics + conda setup (slides)
- Another good resource: Introduction to the UNIX command line
- small Bash cheat sheet:
# Print your user name
echo $USER
# change directory to your user home directory (all of these are the same)
cd /home/$USER
cd $HOME
cd ~ # <- the shortest version, I like this one
# show content of current directory
ls
# make a new directory called 'myfolder'
mkdir myfolder
# make conda environment and activate it
conda create -n nanoplot
conda activate nanoplot
conda install nanoplot
# run a program
NanoPlot reads.fq.gz ...
- Conda is a packaging manager that will help us to install bioinformatics tools and to handle their dependencies automatically
- In the terminal enter:
# Switch to a directory with enough space
cd /scratch/$USER
# make a new folder called 'workshop'
mkdir workshop
# switch to this folder
cd workshop
# Download conda installer
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
# Run conda installer
bash Miniconda3-latest-Linux-x86_64.sh
# Use space to scroll down the license agreement
# then type 'yes'
# accept the default install location with ENTER
# when asked whether to initialize Miniconda3 type 'yes'
# ATTENTION: the space in your home directory might be limited (e.g. 10 GB) and per default conda installs tools into ~/.conda/envs
# Thus, take care of your disk space!
# Now start a new shell or simply reload your current shell via
bash
# You should now be able to create environments, install tools and run them
- Set up conda
# add repository channels for bioconda
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
- Create and activate a new conda environment
# -n parameter to specify the name
conda create -n workshop
# activate this environment
conda activate workshop
# You should now see (workshop) at the start of each line.
# You switched from the default 'base' environment to the 'workshop' environment.
Hint: An often faster and more stable alternative to conda
is mamba
. Funningly, mamba
can be installed via conda
and then used in the similar way. Just replace conda
then with mamba
(like shown in the bioinformatics tool slides, linked below).