Today in this article we will learn how we can install and set up the SRA Toolkit in our ubuntu 20.04. I have given all the commands to install it step by step below.
So, do read this article till the end so that you will not face any problem in installing the SRA Toolkit in your ubuntu 20.04.
Install SRA Toolkit in Ubuntu 20.04 -
Now let’s see how we can install sra toolkit in our Ubuntu 20.04. It will be easy and quick.
Before installing the SRA toolkit, we will first update our packages. We will use the below commands to update our packages.
sudo apt-get update
After we updated our packages, now let us see how we will install the SRA Toolkit.
Create Local Directory -
Before installing sra toolkit we have to create a local directory for this in our ubuntu system. To create a local directory, we will use the command given below, where you can create a directory of any name in place of “yourdirectoryname”.
mkdir -p yourdirectoryname/local
Now that we have created a directory, now we will have to change our working directory. We will use the command given below for this, which will change our current working directory to the one that we made.
Download SRA Toolkit -
Now you will have to download the sra toolkit inside this directory. We will download tar.gz of sra toolkit for this. To download this tar file copy the below commands and paste it in your terminal and press enter.
wget – output-document sratoolkit.tar.gz https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/current/sratoolkit.current-ubuntu64.tar.gz
Check and Extract SRA Toolkit -
Now we will check whether our sra toolkit has been downloaded or not in our directory. To check that we have to type the following command in the terminal while our working directory is “ yourdirectoryname”. You can also manually open your file manager and go to the “yourdirectoryname” folder where you can see the downloaded tar file.
After typing the above command, if you see sratoolkit.tar.gz in terminal then it means that sra toolkit has been downloaded which we have to extract now.
To extract, we will use the below command which will extract the sra toolkit in the same directory.
tar -vxzf sratoolkit.tar.gz
Append binary path to path environment variable -
Now we will have to append the path of our binary to the path environment variable. To append it we will copy the below command and then paste it in our terminal.
Here in this command if your system is 32-bit then you have to write ubuntu32 instead of ubuntu 64 and also sratoolkit version will be different due to updates. So make sure you use the correct version name in this command. You can see what version you downloaded in your terminal when downloading the tar file.
After entering the above command, now we have to check whether our system can find this binary or not. To see that we will type the command given below.
After typing this above command, if you see “ /yourdirectoryname/local/sratoolkit.2.11.1-ubuntu64/bin/fastq-dump” in your terminal it means that our system can find the binary.
SRA Toolkit Configuration -
Now we have to configure our sra toolkit. To configure the sra toolkit, first of all type the following command in the terminal after which the configuration panel of the sra toolkit will open from where we can complete the final steps.
After entering the command you will get the configuration panel of sra toolkit where the red color mark on the side of the first option means that you have just selected that option and to change that you have to press “TAB KEY” in your computer keyboard.You can choose other options using tab key and enter key.
Keep pressing TAB KEY until your red mark appears at the side of CACHE. When your red mark is at the side of the CACHE option then you have to press ENTER KEY.
After you hit enter and get inside the CACHE option here you will have to press TAB KEY again and then select the choose button below the location of user-repository option.
Now after we have selected the choose option here we will have to select the directory that we created at the beginning of the tutorial, which in our case is yourdirectoryname.
Enter the directory by selecting it with the help of the arrow key on our keyboard and then select the folder named local and press enter.
After this, again with the help of TAB KEY, go to the option of OK and press it and then select the option yes and present enter.
Now we have to click on save option here and then click on ok. After this we have to go to the exit button and then press enter.
Check SRA Toolkit -
Now we have to see whether our sra toolkit is working and is functional or not. To see this, we will type the command given below in our terminal.
fastq-dump – stdout SRR390728 | head -n 8
After typing the above command in the terminal you will need to wait a few seconds and after that if you see the following output in the terminal, then it means that the sra toolkit is working and is fully functional.
Uninstall SRA Toolkit -
If for some reason you want to uninstall SRA Toolkit from your ubuntu system, then you can use the below command for this, which will completely uninstall the sra toolkit from your Ubuntu system.
sudo apt-get purge – auto-remove sra-toolkit
NOTE: In some cases you might need to run the source command for sra toolkit installation to complete. You can also close the active terminal window and open a new one.
And just like this you can install and setup sra toolkit in your ubuntu 20.04. If you liked this tutorial, then definitely share it with your friends who want to install sra toolkit in their ubuntu 20.04 system. If you face any problem in installing it, then comment below and I will definitely solve it and provide the solution to you. Thank you.
Can we install SRA Toolkit in our ubuntu 18.04 with the help of this tutorial.
Yes, you can install and run sra toolkit in your Ubuntu 18.04 also with the help of this tutorial. The commands will remain same for your system but if your system is 32-bit then keep in mind that in the command “ export PATH=$PATH:$PWD/sratoolkit.2.11.1-ubuntu64/bin ” you have to use ubuntu32 instead of ubuntu64 along with a different sra toolkit version if yours is different.
Can we create a directory with any name?
Yes, you can create a directory with any name here, like we had created a directory here by the name of “yourdirectoryname” and “local”, you can create a directory with any such name.