Let’s create an interactive session on the HPC:
Code Block |
---|
qsub -I -S /bin/bash -l walltime=10:00:00 -l select=1:ncpus=2:mem=4gb |
Install tools using conda
Approach #1 - installing tools one at a time (faster option)
Create a conda environment called sniffles
Code Block |
---|
conda create -n snifflesONTvariant |
Code Block |
---|
Collecting package metadata (current_repodata.json): done Solving environment: done ==> WARNING: A newer version of conda exists. <== current version: 4.12.0 latest version: 24.5.0 Please update conda by running $ conda update -n base -c defaults conda ## Package Plan ## environment location: /home/barrero/miniconda3/envs/snifflesONTvariant Proceed ([y]/n)? y Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate snifflesONTvariant # # To deactivate an active environment, use # # $ conda deactivate |
Let’s activate the conda environment:
Code Block |
---|
conda activate deactivateONTvariant |
Next, we need to install few tools for today’s exercises. Now let’s go the https://anaconda.org and search for the following tools and instructions on how to install them:
Code Block |
---|
minimap2samtools, samtoolssniffles, snifflesminimap2 |
For example, search for the aligner minimap2samtools:
...
If the tool you are looking is available in conda, a list of options will be presented. Typically choose the option at the top with most downloads and compatible for your system:
...
Click on the link to the tool of interest and you will be presented with the conda command line to run in your system to install the tool:
...
...
Copy and paste the first command shown above in your terminal where you have activated the ‘ONTvariant’ conda environment:
Code Block |
---|
conda install bioconda::samtools |
Now repeat the process for ‘sniffles’, then install it:
Code Block |
---|
conda activate pvirdb |
...
install bioconda::sniffles |
Finally, let’s install minimap2:
Code Block |
---|
conda install bioconda::minimap2 |
Now we are done installing all the tools that we need for today.
Approach #2 (we are not doing this - this just for your information) - installing all tools at once (slower option!)
Prepare the following environment.yml file or go to step 3:
Code Block |
---|
name: pvirdbONTvariants channels: - conda-forge - defaults - bioconda dependencies: - bottlenecksamtools=1.3.5=py37h3a130e4_020 - sniffles=1.0.12 - ca-certificates=2022.6.15=h5b45459_0 |
...
minimap=2-2.28 |
Create a new environment:
Code Block |
---|
conda env updatecreate --filef environment.yml |
Installing more tools or dealing with compatibility issues between tools
As you have seen, we can search at anaconda.org for other tools that we might be interested to use.
Remember, if you run into compatibility issues or errors, you can always create a new environment using this file
...
conda environment for the tool of interest. NOTE: you can switch between conda environements as follows:
Code Block |
---|
conda activate myenvironment1
#... do so work with it
conda deactivate
#now we can activate another environment
conda activate myenvironment2
#... do some other tasks
conda deactivate #optional to deactivate last environment to use given that when we submit a job to the HPC cluster it will be closed automatically at the completion of the last task. |