NCBI Edirect

I am preparing some scripts for the automated retrieval of biological sequences from NCBI. I wanted to find a way to easily download CDS (coding DNA sequence), amino acid sequences and so on. I googled a bit and it seems that Entrez Direct: E-utilities is what I need. So, I decided to install them.

EDirect tools require PERL and include an installation script that will check your system if something is mising, then download and install it. I know that the ‘cleanest’ thing to do would be to create a SlackBuild, track all dependencies and make sure they are already installed. However, at the moment I just need the tools to work. There are installation instructions, however I installed them in /usr/local/bin, not in my $HOME:

First, navigate there and download Edirect:

cd /usr/local/bin/
perl -MNet::FTP -e \
'$ftp = new Net::FTP("", Passive => 1);
$ftp->login; $ftp->binary;

Extract the edirect.tar.gz tarball and remove it, then set the folder to root’s $PATH and execute the setup script:

gunzip -c edirect.tar.gz | tar xf –
rm edirect.tar.gz
export PATH=${PATH}:/usr/local/bin/edirect >& /dev/null || setenv PATH "${PATH}:/usr/local/bin/edirect"

The installation starts and when it is done it will tell you to add the install location to your $PATH:

Trying to establish local installations of any missing Perl modules
(as logged in /usr/local/bin/edirect/setup-deps.log).
Please be patient, as this step may take a little while.

When it is done, it will output the following:
Entrez Direct has been successfully downloaded and installed.

In order to complete the configuration process, please execute the following:

echo "export PATH=\${PATH}:/usr/local/bin/edirect" >> $HOME/.bashrc

or manually edit the PATH variable assignment in your .bash_profile file.

I added the $PATH for my normal user. That’s it.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s